packages: wireshark/wireshark-desktop.patch, wireshark/wireshark.spec - use...

glen glen at pld-linux.org
Sat Jun 2 18:21:45 CEST 2012


Author: glen                         Date: Sat Jun  2 16:21:45 2012 GMT
Module: packages                      Tag: HEAD
---- Log message:
- use setcaps instead of .desktop file hacks
  http://wiki.wireshark.org/CaptureSetup/CapturePrivileges

---- Files affected:
packages/wireshark:
   wireshark-desktop.patch (1.4 -> 1.5) , wireshark.spec (1.238 -> 1.239) 

---- Diffs:

================================================================
Index: packages/wireshark/wireshark-desktop.patch
diff -u packages/wireshark/wireshark-desktop.patch:1.4 packages/wireshark/wireshark-desktop.patch:1.5
--- packages/wireshark/wireshark-desktop.patch:1.4	Wed Jan 11 23:02:40 2012
+++ packages/wireshark/wireshark-desktop.patch	Sat Jun  2 18:21:40 2012
@@ -1,35 +1,14 @@
---- wireshark-1.2.4/wireshark-kde.desktop	2009-12-09 10:09:05.765409184 +0200
-+++ wireshark-1.2.4/wireshark-kde.desktop	2009-12-09 10:18:48.798894254 +0200
-@@ -71,7 +71,11 @@
-+Comment[ja]=The Wireshark ネットワーク・アナライザー
-+Comment[pl]=Wireshark - analizator ruchu w sieci
- Icon=wireshark.png
- TryExec=wireshark
- Exec=wireshark %f
- Terminal=false
-+X-KDE-SubstituteUID=true
-+OnlyShowIn=KDE;
- MimeType=application/vnd.tcpdump.pcap;
- # Categorie entry according to version 1.0 of
- # http://www.freedesktop.org/wiki/Specifications/menu-spec
--Categories=System;Monitor;GTK;
-+Categories=GTK;Network;
---- wireshark-1.2.4/wireshark.desktop~	2009-11-16 22:33:26.000000000 +0200
-+++ wireshark-1.2.4/wireshark.desktop	2009-12-09 10:16:55.333281083 +0200
-@@ -68,10 +68,13 @@
+--- wireshark-1.6.7/wireshark.desktop	2012-06-02 18:29:44.784985048 +0300
++++ wireshark-1.6.7/wireshark.desktop	2012-06-02 18:30:27.236953001 +0300
+@@ -67,6 +67,8 @@
+ Comment=Network traffic analyzer
  Comment[fi]=Verkkoliikenne analysaattori
  Comment[fr]=Analyseur de trafic réseau
- Comment[sv]=Nätverkstrafikanalysator
 +Comment[ja]=The Wireshark ネットワーク・アナライザー
 +Comment[pl]=Wireshark - analizator ruchu w sieci
+ Comment[sv]=Nätverkstrafikanalysator
  Icon=wireshark.png
  TryExec=wireshark
--Exec=wireshark %f
-+Exec=gksu -u root wireshark
-+NotShowIn=KDE;
- Terminal=false
- MimeType=application/vnd.tcpdump.pcap;
- # Categorie entry according to version 1.0 of
- # http://www.freedesktop.org/wiki/Specifications/menu-spec
+@@ -78 +80 @@
 -Categories=System;Monitor;GTK;
 +Categories=GTK;Network;

================================================================
Index: packages/wireshark/wireshark.spec
diff -u packages/wireshark/wireshark.spec:1.238 packages/wireshark/wireshark.spec:1.239
--- packages/wireshark/wireshark.spec:1.238	Tue Apr 10 23:05:02 2012
+++ packages/wireshark/wireshark.spec	Sat Jun  2 18:21:40 2012
@@ -1,6 +1,7 @@
 # $Revision$, $Date$
 # TODO
-# - use policykit to gain root instead of .desktop file hacks
+# - use policykit to gain root
+# - use %caps when rpm supports it: %attr(750,root,wireshark) %caps(cap_net_raw,cap_net_admin=eip) %{_sbindir}/dumpcap
 # - think of loosing dependency loop:
 #   Executing rpm --upgrade -vh --root /...
 #   error: LOOP:
@@ -26,7 +27,7 @@
 Summary(uk.UTF-8):	Аналізатор мережевого трафіку
 Name:		wireshark
 Version:	1.6.7
-Release:	1
+Release:	2
 License:	GPL
 Group:		Networking/Utilities
 Source0:	http://www.wireshark.org/download/src/%{name}-%{version}.tar.bz2
@@ -105,8 +106,11 @@
 Requires:	libwiretap = %{version}-%{release}
 Provides:	%{name}-tools
 Provides:	ethereal-common
+Provides:	group(wireshark)
 Obsoletes:	ethereal-common
 Obsoletes:	wireshark-tools
+Requires(post,postun):	/sbin/ldconfig
+Requires(post,postun):	/sbin/setcap
 
 %description common
 Wireshark is the name for powerful graphical network sniffer, traffic
@@ -217,8 +221,7 @@
 pakietów.
 
 %prep
-%setup -q -n %{name}-%{version}
-cp wireshark.desktop wireshark-kde.desktop
+%setup -q
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
@@ -252,9 +255,8 @@
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
 
-cp -a image/hi48-app-wireshark.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
-cp -a wireshark.desktop $RPM_BUILD_ROOT%{_desktopdir}
-cp -a wireshark-kde.desktop $RPM_BUILD_ROOT%{_desktopdir}
+cp -p image/hi48-app-wireshark.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
+cp -p wireshark.desktop $RPM_BUILD_ROOT%{_desktopdir}
 
 cp -a wiretap/*.h $RPM_BUILD_ROOT%{_includedir}/wiretap
 
@@ -267,8 +269,19 @@
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post	common -p /sbin/ldconfig
-%postun	common -p /sbin/ldconfig
+%pre common
+%groupadd -P %{name}-common -g 104 wireshark
+
+%post	common
+/sbin/ldconfig
+/sbin/setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' %{_bindir}/dumpcap
+exit 0
+
+%postun	common
+/sbin/ldconfig
+if [ "$1" = "0" ]; then
+	%groupremove wireshark
+fi
 
 %post	-n libwiretap -p /sbin/ldconfig
 %postun	-n libwiretap -p /sbin/ldconfig
@@ -282,7 +295,6 @@
 %attr(755,root,root) %{_libdir}/%{name}/plugins/%{version}*/*.so
 %{_datadir}/%{name}
 %{_desktopdir}/%{name}.desktop
-%{_desktopdir}/%{name}-kde.desktop
 %{_pixmapsdir}/*.png
 %{_mandir}/man1/wireshark.1*
 
@@ -291,7 +303,7 @@
 %doc AUTHORS* ChangeLog NEWS README{,.[lv]*} doc/{randpkt.txt,README.*}
 %attr(755,root,root) %{_bindir}/capinfos
 %attr(755,root,root) %{_bindir}/dftest
-%attr(755,root,root) %{_bindir}/dumpcap
+%attr(750,root,wireshark) %{_bindir}/dumpcap
 %attr(755,root,root) %{_bindir}/editcap
 %attr(755,root,root) %{_bindir}/idl2wrs
 %attr(755,root,root) %{_bindir}/mergecap
@@ -338,6 +350,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.239  2012/06/02 16:21:40  glen
+- use setcaps instead of .desktop file hacks
+  http://wiki.wireshark.org/CaptureSetup/CapturePrivileges
+
 Revision 1.238  2012/04/10 21:05:02  arekm
 - up to 1.6.7
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/packages/wireshark/wireshark-desktop.patch?r1=1.4&r2=1.5
    http://cvs.pld-linux.org/packages/wireshark/wireshark.spec?r1=1.238&r2=1.239



More information about the pld-cvs-commit mailing list