diff options
author | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2013-11-26 23:43:18 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2013-11-26 23:43:18 +0000 |
commit | 69017ac3bdc0877765817e5cd50279a78da2fc11 (patch) | |
tree | f67d8f45bfc7c810e203c694b51f63bb721a8ddb | |
parent | cc538dbb6c7f1f31552f39809a241b43442acea5 (diff) | |
download | wireshark-69017ac3bdc0877765817e5cd50279a78da2fc11.tar.gz |
Overhaul rpm-building options a bit: as suggested by Anders, have the RPM follow
./configure's options for gtk2 vs gtk3 vs qt.
Make it possible to not build the GNOME package (now both UIs' packages are
optional). I think Chris requested this a while ago.
If this works out it may make sense to control the rest of the options via
./configure .
svn path=/trunk/; revision=53607
-rw-r--r-- | Makefile.am | 6 | ||||
-rw-r--r-- | configure.ac | 41 | ||||
-rw-r--r-- | packaging/rpm/SPECS/wireshark.spec.in | 45 |
3 files changed, 71 insertions, 21 deletions
diff --git a/Makefile.am b/Makefile.am index 671155123f..3ea7abaab6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1090,6 +1090,8 @@ stagedir=$(top_stagedir)/$(PACKAGE).inst host_cpu=@host_cpu@ host_os=@host_os@ +solaris-package: svr4-package + svr4-package: $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) @if test x$(HAVE_SVR4_PACKAGING) = xyes ; then \ rm -rf $(stagedir) ; \ @@ -1104,7 +1106,6 @@ svr4-package: $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) echo "Package build abandoned." ; \ fi -solaris-package: svr4-package rpm_topdir=`cd $(top_builddir) && pwd`/packaging/rpm rpm-package: dist @@ -1114,7 +1115,8 @@ rpm-package: dist cd SOURCES ; \ ln -sf ../../../$(distdir).tar.bz2 ; \ cd .. ; \ - rpmbuild --define "_topdir `cd . && pwd`" --define "_prefix $(prefix)" --clean -ba SPECS/wireshark.spec && \ + rpmbuild --define "_topdir `cd . && pwd`" --define "_prefix $(prefix)" \ + @RPMBUILD_WITH_ARGS@ --clean -ba SPECS/wireshark.spec && \ echo "Package successfully built in `pwd`/RPMS." && \ rm -f SOURCES/$(distdir).tar.bz2 $(distdir).tar.bz2 ; \ else \ diff --git a/configure.ac b/configure.ac index 5eb9c1c9b6..6ad85ae50b 100644 --- a/configure.ac +++ b/configure.ac @@ -8,6 +8,8 @@ m4_define([version_micro_extra], version_micro) m4_append([version_micro_extra], []) AC_INIT(wireshark, [version_major.version_minor.version_micro_extra], http://bugs.wireshark.org/, , http://www.wireshark.org/) +CONFIG_ARGS="$*" +AC_SUBST(CONFIG_ARGS) # Minimum autoconf version we require. AC_PREREQ(2.60) @@ -1719,9 +1721,7 @@ AM_CONDITIONAL(HAVE_GTK, test "$have_gtk" = "yes") AC_SUBST(OSX_APP_FLAGS) AC_SUBST(OSX_DMG_FLAGS) - # Enable/disable tshark - AC_ARG_ENABLE(tshark, AC_HELP_STRING( [--enable-tshark], [build TShark @<:@default=yes@:>@]), @@ -2643,6 +2643,43 @@ case $host_cpu in ;; esac +# Gather only the "--with*" arguments and also a list of --with arguments for rpmbuild +for f in $CONFIG_ARGS +do + case $f in + --with-gtk2*) + CONFIG_WITH_ARGS="$CONFIG_WITH_ARGS $f" + RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with gtk2" + ;; + --without-gtk2*) + CONFIG_WITH_ARGS="$CONFIG_WITH_ARGS $f" + RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --without gtk2" + ;; + --with-gtk3*) + CONFIG_WITH_ARGS="$CONFIG_WITH_ARGS $f" + RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with gtk3" + ;; + --without-gtk3*) + CONFIG_WITH_ARGS="$CONFIG_WITH_ARGS $f" + RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --without gtk3" + ;; + --with-qt*) + CONFIG_WITH_ARGS="$CONFIG_WITH_ARGS $f" + RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with qt" + ;; + --without-qt*) + CONFIG_WITH_ARGS="$CONFIG_WITH_ARGS $f" + RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --without qt" + ;; + --with*) + CONFIG_WITH_ARGS="$CONFIG_WITH_ARGS $f" + ;; + esac + +done +AC_SUBST(CONFIG_WITH_ARGS) +AC_SUBST(RPMBUILD_WITH_ARGS) + dnl libtool defs # # Yes, AM_PROG_LIBTOOL is redundant with newer version(s) of some tool(s) diff --git a/packaging/rpm/SPECS/wireshark.spec.in b/packaging/rpm/SPECS/wireshark.spec.in index 0957de4b31..c99d91ceb6 100644 --- a/packaging/rpm/SPECS/wireshark.spec.in +++ b/packaging/rpm/SPECS/wireshark.spec.in @@ -1,6 +1,11 @@ # Note that this is NOT a relocatable package # $Id$ # @configure_input@ +# configure options: @CONFIG_ARGS@ + +%bcond_without gtk2 +%bcond_with gtk3 +%bcond_with qt # Set these to 1 if you want to ensure your package inclues support for them: %global with_adns 0 @@ -8,11 +13,6 @@ %global with_lua 1 %global with_portaudio 0 -# Set to 1 if you want GTK3 instead of GTK2: -%global with_gtk3 0 -# Set to 1 if you want the Qt GUI too -%global with_qt 1 - # Set at most one of these two: # Note that setcap requires rpmbuild 4.7.0 or later. %global setuid_dumpcap 0 @@ -116,16 +116,19 @@ view the reconstructed stream of a TCP session. This package contains command-line utilities, plugins, and documentation for Wireshark. A GTK+ and a Qt graphical user interface are packaged separately. +%if %{with gtk2} || %{with gtk3} %package gnome Summary: Gnome desktop integration for Wireshark Group: Applications/Internet -%if %{with_gtk3} +%if %{with gtk3} Requires: gtk3 >= @GTK3_MIN_VERSION@ BuildRequires: gtk3-devel >= @GTK3_MIN_VERSION@ %else +%if %{with gtk2} Requires: gtk2 >= @GTK2_MIN_VERSION@ BuildRequires: gtk2-devel >= @GTK2_MIN_VERSION@ %endif +%endif Requires: %{name} = %{version}-%{release} Requires: xdg-utils Requires: hicolor-icon-theme @@ -150,8 +153,9 @@ Requires: portaudio %description gnome Contains the Gnome (GTK+) Wireshark GUI and desktop integration files. +%endif -%if %{with_qt} +%if %{with qt} %package qt Summary: Qt GUI for Wireshark Group: Applications/Internet @@ -201,14 +205,9 @@ Contains the Qt Wireshark GUI and desktop integration files. %if %{with_portaudio} --with-portaudio \ %endif -%if %{with_gtk3} - --with-gtk3 \ -%else - --with-gtk2 \ -%endif -%if %{with_qt} - --with-qt \ -%endif + %{?_with_gtk2} \ + %{?_with_gtk3} \ + %{?_with_qt} \ --disable-warnings-as-errors # Suggestion: put this in your ~/.rpmmacros (without the hash sign, of course): @@ -218,8 +217,11 @@ make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT install +%if %{with gtk3} || %{with gtk2} # Change the program name for 'alternatives' mv %{buildroot}%{_bindir}/wireshark %{buildroot}%{_bindir}/wireshark-gtk +%endif +%if %{with gtk2} || %{with gtk3} || %{with qt} # Create the 'alternative' file touch %{buildroot}%{_bindir}/wireshark make DESTDIR=$RPM_BUILD_ROOT install_desktop_files @@ -233,6 +235,7 @@ make DESTDIR=$RPM_BUILD_ROOT install_desktop_files # require this (at least if desktop-file-install was not used to install it). desktop-file-validate %{buildroot}/usr/share/applications/wireshark.desktop %endif +%endif %clean rm -rf $RPM_BUILD_ROOT @@ -246,6 +249,7 @@ getent group wireshark >/dev/null || groupadd -r wireshark %postun -p /sbin/ldconfig +%if %{with gtk2} || %{with gtk3} %post gnome update-desktop-database &> /dev/null ||: update-mime-database /usr/share/mime &> /dev/null || : @@ -261,8 +265,9 @@ if [ $1 -eq 0 ] ; then gtk-update-icon-cache /usr/share/icons/hicolor &>/dev/null || : %{_sbindir}/update-alternatives --remove %{name} %{_bindir}/wireshark-gtk fi +%endif -%if %{with_qt} +%if %{with qt} %post qt update-desktop-database &> /dev/null ||: update-mime-database /usr/share/mime &> /dev/null || : @@ -331,6 +336,7 @@ gtk-update-icon-cache /usr/share/icons/hicolor &>/dev/null || : %{_mandir}/man4/* %{_datadir}/wireshark +%if %{with gtk2} || %{with gtk3} %files gnome %defattr(-,root,root) /usr/share/applications/wireshark.desktop @@ -340,8 +346,9 @@ gtk-update-icon-cache /usr/share/icons/hicolor &>/dev/null || : %{_bindir}/wireshark-gtk %{_mandir}/man1/wireshark.* %ghost %{_bindir}/wireshark +%endif -%if %{with_qt} +%if %{with qt} %files qt %defattr(-,root,root) /usr/share/applications/wireshark.desktop @@ -354,6 +361,10 @@ gtk-update-icon-cache /usr/share/icons/hicolor &>/dev/null || : %endif %changelog +* Tue Nov 26 2013 Jeff Morriss +- Overhaul options handling to pull in the UI choice from ./configure. +- Make it possible to not build the GNOME package. + * Tue Nov 12 2013 Jeff Morriss - Add q qt package using 'alternatives' to allow the administrator to choose which one they actually use. |