[ansifilter/epel7: 2/3] Update to 1.11 %bcond_without now works for people don't want gui!

Christopher Meng cicku at fedoraproject.org
Mon Feb 23 10:32:00 UTC 2015


commit b0f834655796eda0b4befff1cdc4903d18ac582f
Author: Christopher Meng <i at cicku.me>
Date:   Mon Feb 23 18:28:15 2015 +0800

    Update to 1.11
    %bcond_without now works for people don't want gui!

 .gitignore      |  1 +
 ansifilter.spec | 54 +++++++++++++++++++++++++++++++++---------------------
 sources         |  2 +-
 3 files changed, 35 insertions(+), 22 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index dc7941c..2707042 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 /ansifilter-1.8.tar.gz
+/ansifilter-1.11.tar.gz
diff --git a/ansifilter.spec b/ansifilter.spec
index 99daac4..b4f21a3 100644
--- a/ansifilter.spec
+++ b/ansifilter.spec
@@ -1,31 +1,31 @@
-%global with_gui 1
+%bcond_without  gui
 
 Name:           ansifilter
-Version:        1.8
-Release:        3%{?dist}
+Version:        1.11
+Release:        1%{?dist}
 Summary:        ANSI terminal escape code converter
 License:        GPLv3+
 URL:            http://www.andre-simon.de/doku/ansifilter/ansifilter.php
 Source0:        http://www.andre-simon.de/zip/%{name}-%{version}.tar.gz
-%if 0%{?with_gui}
+%if %{with gui}
 Source1:        ansifilter.desktop
 Source2:        http://www.andre-simon.de/img/af_icon.png
 %endif
 
 %description
-Ansifilter handles text files containing ANSI terminal escape codes.
-The command sequences may be stripped or be interpreted to generate formatted
+Ansifilter handles text files containing ANSI terminal escape codes. The
+command sequences may be stripped or be interpreted to generate formatted
 output (HTML, RTF, TeX, LaTeX, BBCode).
 
-%if 0%{?with_gui}
+%if %{with gui}
 %package        gui
 Summary:        GUI for %{name} based on Qt4
 BuildRequires:  desktop-file-utils
 BuildRequires:  qt4-devel
 
 %description    gui
-Ansifilter handles text files containing ANSI terminal escape codes.
-The command sequences may be stripped or be interpreted to generate formatted
+Ansifilter handles text files containing ANSI terminal escape codes. The
+command sequences may be stripped or be interpreted to generate formatted
 output (HTML, RTF, TeX, LaTeX, BBCode).
 
 This is a GUI of %{name} based on Qt4.
@@ -33,48 +33,60 @@ This is a GUI of %{name} based on Qt4.
 
 %prep
 %setup -q
-# Multilib fix.
-sed -i s'|/usr/lib|%{_libdir}|g' src/qt-gui/Makefile
-# Remove redundant moc files which will cause errors during building.
+
+# Preserve timestamps.
+sed -i 's|install -m|install -pm|g' makefile
+
+%if %{with gui}
+# Remove pre-configured files which may cause errors during building.
 rm -frv src/qt-gui/moc_*.cpp
+rm -frv src/qt-gui/Makefile*
+%endif
+
 # CLTR quickfix
 find . -type f -exec sed -i 's/\r$//' {} + -print
 
 %build
 # Upstream embed the cli code in gui so no need to requires cli using GUI
 # program, in order to achieve this we need to preserve the objects with -c.
-%make_build CFLAGS="%{optflags} -c" LDFLAGS="%{?__global_ldflags}"
-%if 0%{?with_gui}
+%make_build CFLAGS+="%{optflags} -c" LDFLAGS="%{?__global_ldflags}"
+
+%if %{with gui}
 # %%_qt4_qmake will respect the redhat-rpm-config
 %make_build all-gui QMAKE="%{_qt4_qmake}"
 %endif
 
 %install
-%make_install INSTALL_DATA="install -pm644" INSTALL_PROGRAM="install -pm755"
-%if 0%{?with_gui}
-make install-gui INSTALL_DATA="install -pm644" INSTALL_PROGRAM="install -pm755" DESTDIR=%{buildroot}
+%make_install
 
+%if %{with gui}
+make install-gui DESTDIR=%{buildroot}
 desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{S:1}
-
 install -pDm644 %{S:2} %{buildroot}%{_datadir}/pixmaps/%{name}.png
 %endif
 
+# Use %%doc and %%license to handle docs.
 rm -frv %{buildroot}%{_docdir}
 
 %files
-%doc ChangeLog COPYING README
+%doc ChangeLog README
+%license COPYING
 %{_bindir}/ansifilter
 %{_mandir}/man1/ansifilter.1*
 
-%if 0%{?with_gui}
+%if %{with gui}
 %files gui
-%doc ChangeLog COPYING README
+%doc ChangeLog README
+%license COPYING
 %{_bindir}/ansifilter-gui
 %{_datadir}/applications/%{name}.desktop
 %{_datadir}/pixmaps/%{name}.png
 %endif
 
 %changelog
+* Mon Feb 16 2015 Christopher Meng <rpm at cicku.me> - 1.11-1
+- Update to 1.11
+
 * Fri Aug 15 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.8-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
 
diff --git a/sources b/sources
index c9b4baf..5df390a 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-b92442d841c1ea7b6d4139cdc61f38bc  ansifilter-1.8.tar.gz
+2c452e5d91ec2cdc34f539eeb31c0b98  ansifilter-1.11.tar.gz


More information about the scm-commits mailing list