[gpsbabel] Fix EL build by making GUI build optional
Hans Ulrich Niedermann
ndim at fedoraproject.org
Thu Jan 13 15:31:37 UTC 2011
commit 9d2bcdb22ee23cc694506e476e69a83d2073a7a4
Author: Hans Ulrich Niedermann <hun at n-dimensional.de>
Date: Thu Jan 13 16:15:48 2011 +0100
Fix EL build by making GUI build optional
This spec file or .src.rpm has been verified to mock build for:
f15, f14, f13, f12, el6
gpsbabel.spec | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/gpsbabel.spec b/gpsbabel.spec
index b04271b..94bb07d 100644
--- a/gpsbabel.spec
+++ b/gpsbabel.spec
@@ -34,12 +34,20 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: expat-devel
BuildRequires: libusb-devel
BuildRequires: zlib-devel
-%if (0%{?fedora} >= 14) || (0%{?rhel} >= 6)
+%if (0%{?fedora} >= 14)
+# f14, f15, etc.
BuildRequires: qt-devel
BuildRequires: qt-webkit-devel
+%define build_gui 1
%else
+%if 0%{?fedora}
+# f13 mainly
BuildRequires: qt4-devel
BuildRequires: qt4-webkit-devel
+%define build_gui 1
+%else
+# EL stuff, e.g. el6
+%endif
%endif
BuildRequires: desktop-file-utils
BuildRequires: libxslt
@@ -50,6 +58,7 @@ BuildRequires: shapelib-devel
Converts GPS waypoint, route, and track data from one format type
to another.
+%if 0%{?build_gui}
%package gui
Summary: Qt GUI interface for GPSBabel
Group: Applications/Engineering
@@ -58,6 +67,7 @@ Requires: %{name} = %{version}-%{release}
%description gui
Qt GUI interface for GPSBabel
+%endif
%prep
%setup -q
@@ -80,15 +90,19 @@ make %{?_smp_mflags}
perl xmldoc/makedoc
make gpsbabel.html
+%if 0%{?build_gui}
pushd gui
qmake-qt4
lrelease-qt4 *.ts
make %{?_smp_mflags}
popd
+%endif
%install
rm -rf %{buildroot}
make DESTDIR=%{buildroot} install
+
+%if 0%{?build_gui}
make -C gui DESTDIR=%{buildroot} install
install -m 0755 -d %{buildroot}%{_bindir}/
@@ -104,10 +118,12 @@ install -m 0755 -d %{buildroot}%{_datadir}/icons/hicolor/256x256/apps
install -m 0644 -p %{SOURCE2} %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/
%find_lang %{name} --with-qt --all-name
+%endif
%clean
rm -rf %{buildroot}
+%if 0%{?build_gui}
%post gui
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
@@ -119,6 +135,7 @@ fi
%posttrans gui
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+%endif
%files
%defattr(-,root,root,-)
@@ -126,12 +143,14 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%doc gpsbabel.html gpsbabel.org-style3.css
%{_bindir}/gpsbabel
+%if 0%{?build_gui}
%files gui -f %{name}.lang
%defattr(-,root,root,-)
%doc gui/{AUTHORS,COPYING,README*,TODO}
%{_bindir}/gpsbabelfe-bin
%{_datadir}/applications/*
%{_datadir}/icons/hicolor/256x256/apps/*
+%endif
%changelog
* Thu Jan 13 2011 Hans Ulrich Niedermann <hun at n-dimensional.de> - 1.4.2-3
More information about the scm-commits
mailing list