aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2013-02-28 23:02:38 +0000
committerJeff Morriss <jeff.morriss.ws@gmail.com>2013-02-28 23:02:38 +0000
commit663e6a6d6b3a3e03677c5fefea3f50e1157c2b7a (patch)
tree170b6fa10fe2cb07c4e02e17668aeaf9966a70f9
parent7eac6729d8ce9ed1c9b62167b942fd16691a423b (diff)
Make it so that alternate-prefix RPM builds actually work.
Use the prefix from 'configure' in the RPM (so: to build an RPM which installs in /opt do "./configure --prefix=/opt && make rpm-package"). (Maybe this approach should also be used for the other options in the .spec file.) Only clean up if building the RPM was successful. svn path=/trunk/; revision=47957
-rw-r--r--Makefile.am6
-rw-r--r--packaging/rpm/SPECS/wireshark.spec.in10
2 files changed, 8 insertions, 8 deletions
diff --git a/Makefile.am b/Makefile.am
index 8024e3a71c..a9b72fd5a9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1054,9 +1054,9 @@ rpm-package: dist
cd SOURCES ; \
ln -s ../../../$(distdir).tar.bz2 ; \
cd .. ; \
- rpmbuild --define "_topdir `cd . && pwd`" --clean -ba SPECS/wireshark.spec && \
- echo "Package successfully built in `pwd`/RPMS." ; \
- rm -f SOURCES/$(distdir).tar.bz2 $(distdir).tar.bz2; \
+ rpmbuild --define "_topdir `cd . && pwd`" --define "_prefix $(prefix)" --clean -ba SPECS/wireshark.spec && \
+ echo "Package successfully built in `pwd`/RPMS." && \
+ rm -f SOURCES/$(distdir).tar.bz2 $(distdir).tar.bz2 ; \
else \
echo "Error: RPM executable and/or source directory not found." ; \
false; \
diff --git a/packaging/rpm/SPECS/wireshark.spec.in b/packaging/rpm/SPECS/wireshark.spec.in
index 6bc950873e..ddc878f121 100644
--- a/packaging/rpm/SPECS/wireshark.spec.in
+++ b/packaging/rpm/SPECS/wireshark.spec.in
@@ -2,8 +2,6 @@
# $Id$
# @configure_input@
-%global prefix /usr
-
# Set these to 1 if you want to ensure your package inclues support for them:
%global with_adns 0
%global with_lua 1
@@ -122,9 +120,11 @@ Contains the Gnome (GTK+) Wireshark GUI and desktop integration files.
%prep
%setup -q -n %{name}-%{version}
+# Don't specify the prefix here: %configure is a macro which expands to set
+# the prefix and everything else too. If you need to change the prefix
+# set _prefix (note the underscore) either in this file or on rpmbuild's
+# command-line.
%configure \
- --prefix=%{prefix} \
- --libdir=%{_libdir} \
--with-gnu-ld \
%if %{with_adns}
--with-adns \
@@ -148,7 +148,7 @@ make DESTDIR=$RPM_BUILD_ROOT install
make DESTDIR=$RPM_BUILD_ROOT install_desktop_files
# Fedora's packaging guidelines (https://fedoraproject.org/wiki/Packaging:Guidelines)
# require this (at least if desktop-file-install was not used to install it).
-desktop-file-validate %{buildroot}/%{_datadir}/applications/wireshark.desktop
+desktop-file-validate %{buildroot}/usr/share/applications/wireshark.desktop
%clean
rm -rf $RPM_BUILD_ROOT