From 521bf94336bdac82206c4e5eaec9871115e71149 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Nov 15 2018 21:07:34 +0000 Subject: workaround/fix cases of: #!/usr/bin/env python (#1649919) make qt5 unconditional use %license %make_build %make_install, %metainfodir simplify scriptlets (mostly remove, due to nice triggers these days) --- diff --git a/lyx.spec b/lyx.spec index 98c0ba4..f7af525 100644 --- a/lyx.spec +++ b/lyx.spec @@ -14,11 +14,9 @@ BuildRequires: fontpackages-devel # Trim changelog to a reasonable size %global _changelog_trimtime %(date +%s -d "1 year ago") -%global use_qt5 1 - Name: lyx Version: 2.3.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: WYSIWYM (What You See Is What You Mean) document processor License: GPLv2+ Url: http://www.lyx.org/ @@ -60,17 +58,13 @@ BuildRequires: hunspell-devel BuildRequires: mythes-devel BuildRequires: python2 -%if %{use_qt5} BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5Widgets) BuildRequires: pkgconfig(Qt5Gui) BuildRequires: pkgconfig(Qt5Svg) BuildRequires: pkgconfig(Qt5X11Extras) -%else -BuildRequires: qt4-devel -%endif -%if 0%{?fedora} > 17 || 0%{?rhel} > 6 +%if 0%{?fedora} || 0%{?rhel} > 6 BuildRequires: texlive-texmf-fonts %else BuildRequires: texlive-fonts @@ -78,7 +72,7 @@ BuildRequires: texlive-fonts BuildRequires: tex(dvips) BuildRequires: tex(latex) BuildRequires: zlib-devel -%if 0%{?fedora} > 20 +%if 0%{?fedora} BuildRequires: libappstream-glib %endif @@ -105,14 +99,13 @@ Requires: /usr/bin/dvipost Requires: tex(simplecv.cls) # convert doc files to lyx (bug #193858) Requires: wv + +Recommends: texlive-collection-latexrecommended %endif Requires: tex(dvips) Requires: tex(latex) Requires: tex(ulem.sty) Requires: tex(xcolor.sty) -%if 0%{?fedora} > 20 -Recommends: texlive-collection-latexrecommended -%endif %description LyX is a modern approach to writing documents which breaks with the @@ -174,13 +167,18 @@ A collection of Math symbol fonts for %{name}. # %patch100 -p1 -b .input_handling %patch50 -p1 -b .xdg_open +# workaround/fix cases of: #!/usr/bin/env python +# https://bugzilla.redhat.com/show_bug.cgi?id=1649919 +grep 'usr/bin/env python' . -R | \ + cut -d: -f1 | \ + xargs sed -i.shbang -e "s|^#!/usr/bin/env python$|#!%{__python2}|g" + %if 0%{?autotools} ./autogen.sh %endif %build - %configure \ --disable-dependency-tracking \ --disable-rpath \ @@ -188,17 +186,15 @@ A collection of Math symbol fonts for %{name}. --enable-build-type=release \ --enable-optimization="%{optflags}" \ --without-included-boost \ -%if %{use_qt5} --enable-qt5 \ -%endif --with-enchant \ --with-hunspell -make %{?_smp_mflags} +%make_build %install -make install DESTDIR=%{buildroot} +%make_install # misc/extras install -p -m644 -D %{SOURCE1} %{buildroot}%{_datadir}/lyx/lyxrc.dist @@ -227,7 +223,7 @@ rm -rf %{buildroot}%{_datadir}/lyx/fonts # Add AppStream metadata install -Dm 0644 -p %{SOURCE20} \ - %{buildroot}%{_datadir}/appdata/%{fontname}.metainfo.xml + %{buildroot}%{_metainfodir}/%{fontname}.metainfo.xml %find_lang %{name} @@ -235,35 +231,27 @@ install -Dm 0644 -p %{SOURCE20} \ install -p -D -m 0644 lib/scripts/bash_completion %{buildroot}%{_sysconfdir}/bash_completion.d/lyx ## appdata -install -p -D lib/appdata.xml %{buildroot}%{_datadir}/appdata/lyx.appdata.xml +install -p -D lib/appdata.xml %{buildroot}%{_metainfodir}/lyx.appdata.xml %check desktop-file-validate %{buildroot}%{_datadir}/applications/lyx.desktop -appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml ||: +appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{name}.appdata.xml ||: # tests/test_filetools error bogus ( see http://bugzilla.redhat.com/723938 ) make -k check ||: -%post common -touch --no-create %{_datadir}/icons/hicolor &> /dev/null || : - %postun common if [ $1 -eq 0 ] ; then texhash >& /dev/null - update-desktop-database -q &> /dev/null - touch --no-create %{_datadir}/icons/hicolor &> /dev/null - gtk-update-icon-cache %{_datadir}/icons/hicolor &> /dev/null || : fi %posttrans common texhash >& /dev/null -update-desktop-database -q &> /dev/null -gtk-update-icon-cache %{_datadir}/icons/hicolor &> /dev/null || : - %files -%doc ANNOUNCE COPYING lib/CREDITS NEWS README +%doc ANNOUNCE lib/CREDITS NEWS README +%license COPYING %{_bindir}/* %files common -f %{name}.lang @@ -275,17 +263,23 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &> /dev/null || : %ghost %{_datadir}/lyx/lyxrc.defaults %ghost %{_datadir}/lyx/*.lst %{_datadir}/texmf/tex/latex/lyx/ -%{_datadir}/appdata/lyx.appdata.xml +%{_metainfodir}/lyx.appdata.xml %{_sysconfdir}/bash_completion.d/lyx %_font_pkg %{_fontdir}/*.ttf %doc lib/fonts/BaKoMaFontLicense.txt %doc lib/fonts/ReadmeBaKoMa4LyX.txt -%{_datadir}/appdata/%{fontname}.metainfo.xml +%{_metainfodir}/%{fontname}.metainfo.xml + +%changelog +* Thu Nov 15 2018 Rex Dieter - 2.3.1-4 +- workaround/fix cases of: #!/usr/bin/env python (#1649919) +- make qt5 unconditional +- use %%license %%make_build %%make_install, %%metainfodir +- simplify scriptlets (mostly remove, due to nice triggers these days) -%Changelog * Tue Nov 13 2018 Caolán McNamara - 2.3.1-3 - rebuild for hunspell 1.7.0