only build the Qt4 GUI subpackage on distributions that have a libqt4 that is recent enough
OBS-URL: https://build.opensuse.org/package/show/devel:tools/ansifilter?expand=0&rev=3
This commit is contained in:
parent
695aed8b58
commit
dd18540cee
@ -1,5 +1,11 @@
|
||||
# norootforbuild
|
||||
|
||||
%if 0%{?suse_version} > 1030
|
||||
%define with_gui 1
|
||||
%else
|
||||
%define with_gui 0
|
||||
%endif
|
||||
|
||||
Name: ansifilter
|
||||
Version: 1.3
|
||||
Release: 0
|
||||
@ -10,10 +16,13 @@ URL: http://www.andre-simon.de/
|
||||
Group: Development/Tools/Other
|
||||
License: GNU General Public License version 2 (GPL v2)
|
||||
BuildRoot: %{_tmppath}/build-%{name}-%{version}
|
||||
BuildRequires: libqt4-devel gcc-c++ libstdc++-devel pkgconfig
|
||||
BuildRequires: gcc-c++ libstdc++-devel pkgconfig
|
||||
BuildRequires: gcc make glibc-devel
|
||||
BuildRequires: ImageMagick
|
||||
BuildRequires: update-desktop-files
|
||||
%if %with_gui
|
||||
BuildRequires: libqt4-devel
|
||||
%endif
|
||||
|
||||
%description
|
||||
Ansifilter handles text files containing ANSI terminal escape codes.
|
||||
@ -27,6 +36,7 @@ Authors:
|
||||
--------
|
||||
Andre Simon <andre.simon1@gmx.de>
|
||||
|
||||
%if %with_gui
|
||||
%package gui
|
||||
Summary: ANSI Terminal Escape Code Converter
|
||||
Group: Development/Tools/Other
|
||||
@ -45,7 +55,7 @@ This package provides a Qt4 Graphical User Interface to run %{name}.
|
||||
Authors:
|
||||
--------
|
||||
Andre Simon <andre.simon1@gmx.de>
|
||||
|
||||
%endif
|
||||
|
||||
%debug_package
|
||||
%prep
|
||||
@ -59,7 +69,9 @@ convert src/qt-gui/ansifilter.{ico,png}
|
||||
man_dir="%{_mandir}/man1" \
|
||||
doc_dir="%{_docdir}/%{name}" \
|
||||
all \
|
||||
%if %with_gui
|
||||
all-gui
|
||||
%endif
|
||||
|
||||
%install
|
||||
%__make \
|
||||
@ -69,18 +81,22 @@ convert src/qt-gui/ansifilter.{ico,png}
|
||||
man_dir="%{_mandir}/man1" \
|
||||
doc_dir="%{_docdir}/%{name}" \
|
||||
install \
|
||||
%if %with_gui
|
||||
install-gui
|
||||
%endif
|
||||
|
||||
%__rm "%{buildroot}%{_docdir}/%{name}"/INSTALL
|
||||
for f in "%{buildroot}%{_mandir}/man1"/*.gz; do
|
||||
[ -e "$f" ] && %__gzip -d "$f"
|
||||
done
|
||||
|
||||
%if %with_gui
|
||||
%__install -D -m0644 "%{SOURCE1}" "%{buildroot}%{_datadir}/applications/ansifilter.desktop"
|
||||
%__install -D -m0644 src/qt-gui/ansifilter.png "%{buildroot}%{_datadir}/pixmaps/ansifilter.png"
|
||||
%__sed -i 's|^\(Icon=\).*$|$1ansifilter.png|g' "%{buildroot}%{_datadir}/applications/ansifilter.desktop"
|
||||
|
||||
%suse_update_desktop_file -r ansifilter Development Documentation
|
||||
%endif
|
||||
|
||||
%clean
|
||||
%__rm -rf "%{buildroot}"
|
||||
@ -92,11 +108,13 @@ done
|
||||
%{_bindir}/ansifilter
|
||||
%doc %{_mandir}/man1/ansifilter.1*
|
||||
|
||||
%if %with_gui
|
||||
%files gui
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/ansifilter-gui
|
||||
%{_datadir}/applications/ansifilter.desktop
|
||||
%{_datadir}/pixmaps/ansifilter.png
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Fri Jul 24 2009 Pascal Bleser <pascal.bleser@opensuse.org> 1.3
|
||||
|
Loading…
Reference in New Issue
Block a user