freekdesktop.org says all themes must fall back to 'hicolor' if they don't find

a theme-specific icon (and as such hicolor is where applications should
install their icons).  So: don't install some of our icons in the gnome area,
install them all in hicolor.

While we're at it, go ahead and install all the icon sizes we have.

If we're on SuSE, use their desktop-file-updater macro; without that they
won't recognize our desktop file.

Fix bug which prevented the MIME database from being updated if our install
prefix is not /usr .

svn path=/trunk/; revision=48204
This commit is contained in:
Jeff Morriss 2013-03-08 23:40:37 +00:00
parent cfbba71508
commit 6eb2e2899a
2 changed files with 21 additions and 21 deletions

View File

@ -1027,23 +1027,19 @@ patch-bzip2: distdir
# What we (probably) should do is check `pkg-config --variable=prefix gtk+-2.0` to know where
# to install this stuff...
install_desktop_files:
mkdir -p $(DESTDIR)/usr/share/{icons/gnome/{16x16,32x32,48x48,256x256}/mimetypes,mime/packages,applications}
mkdir -p $(DESTDIR)/usr/share/{mime/packages,applications}
install -m 644 -T wireshark-mime-package.xml $(DESTDIR)/usr/share/mime/packages/wireshark.xml
if test x$(DESKTOP_FILE_INSTALL) != x ; then \
$(DESKTOP_FILE_INSTALL) --dir $(DESTDIR)/usr/share/applications wireshark.desktop; \
else \
install -m 644 -T wireshark.desktop $(DESTDIR)/usr/share/applications/wireshark.desktop; \
fi
mkdir -p $(DESTDIR)/usr/share/icons/hicolor/{16x16,32x32,48x48,64x64,256x256}/apps
install -m 644 image/wsicon16.png $(DESTDIR)/usr/share/icons/hicolor/16x16/apps/wireshark.png
install -m 644 image/wsicon32.png $(DESTDIR)/usr/share/icons/hicolor/32x32/apps/wireshark.png
install -m 644 image/wsicon48.png $(DESTDIR)/usr/share/icons/hicolor/48x48/apps/wireshark.png
install -m 644 image/wsicon64.png $(DESTDIR)/usr/share/icons/hicolor/64x64/apps/wireshark.png
install -m 644 image/wsicon256.png $(DESTDIR)/usr/share/icons/hicolor/256x256/apps/wireshark.png
install -m 644 -T image/WiresharkDoc-16.png $(DESTDIR)/usr/share/icons/gnome/16x16/mimetypes/application-wireshark-doc.png
install -m 644 -T image/WiresharkDoc-32.png $(DESTDIR)/usr/share/icons/gnome/32x32/mimetypes/application-wireshark-doc.png
install -m 644 -T image/WiresharkDoc-48.png $(DESTDIR)/usr/share/icons/gnome/48x48/mimetypes/application-wireshark-doc.png
install -m 644 -T image/WiresharkDoc-256.png $(DESTDIR)/usr/share/icons/gnome/256x256/mimetypes/application-wireshark-doc.png
for size in 16 32 48 64 256 ; \
do \
mkdir -p $(DESTDIR)/usr/share/icons/hicolor/$${size}x$${size}/{apps,mimetypes} ; \
install -m 644 image/wsicon$${size}.png $(DESTDIR)/usr/share/icons/hicolor/$${size}x$${size}/apps/wireshark.png ; \
install -m 644 -T image/WiresharkDoc-$${size}.png $(DESTDIR)/usr/share/icons/hicolor/$${size}x$${size}/mimetypes/application-wireshark-doc.png ; \
done
@echo "Don't forget to run \"update-desktop-database\" and \"update-mime-database /usr/share/mime\""
# Used by svr4-package and osx-package
@ -1076,7 +1072,7 @@ rpm-package: dist
cd $(rpm_topdir) ; \
mkdir -p BUILD RPMS SOURCES SRPMS; \
cd SOURCES ; \
ln -s ../../../$(distdir).tar.bz2 ; \
ln -sf ../../../$(distdir).tar.bz2 ; \
cd .. ; \
rpmbuild --define "_topdir `cd . && pwd`" --define "_prefix $(prefix)" --clean -ba SPECS/wireshark.spec && \
echo "Package successfully built in `pwd`/RPMS." && \

View File

@ -176,9 +176,13 @@ make %{?_smp_mflags}
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
make DESTDIR=$RPM_BUILD_ROOT install_desktop_files
%if 0%{?suse_version}
%suse_update_desktop_file %{name}
%else
# 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}/usr/share/applications/wireshark.desktop
%endif
%clean
rm -rf $RPM_BUILD_ROOT
@ -194,24 +198,19 @@ getent group wireshark >/dev/null || groupadd -r wireshark
%post gnome
update-desktop-database &> /dev/null ||:
update-mime-database %{_datadir}/mime &> /dev/null || :
touch --no-create %{_datadir}/icons/gnome &>/dev/null || :
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
update-mime-database /usr/share/mime &> /dev/null || :
touch --no-create /usr/share/icons/hicolor &>/dev/null || :
%postun gnome
update-desktop-database &> /dev/null ||:
update-mime-database /usr/share/mime &> /dev/null || :
if [ $1 -eq 0 ] ; then
touch --no-create /usr/share/icons/gnome &>/dev/null
gtk-update-icon-cache /usr/share/icons/gnome &>/dev/null || :
touch --no-create /usr/share/icons/hicolor &>/dev/null
touch --no-create /usr/share/icons/hicolor &>/dev/null || :
gtk-update-icon-cache /usr/share/icons/hicolor &>/dev/null || :
fi
# Is this really needed?
%posttrans
gtk-update-icon-cache /usr/share/icons/gnome &>/dev/null || :
gtk-update-icon-cache /usr/share/icons/hicolor &>/dev/null || :
@ -263,12 +262,17 @@ gtk-update-icon-cache /usr/share/icons/hicolor &>/dev/null || :
%defattr(-,root,root)
/usr/share/applications/wireshark.desktop
/usr/share/icons/hicolor/*/apps/*
/usr/share/icons/gnome/*/mimetypes/*
/usr/share/icons/hicolor/*/mimetypes/*
/usr/share/mime/packages/wireshark.xml
%{_bindir}/wireshark
%{_mandir}/man1/wireshark.*
%changelog
* Fri Mar 8 2013 Jeff Morriss
- Put all icons in hicolor
- Use SuSE's desktop-update macro.
- Actually update MIME database when Wireshark's prefix is not /usr .
* Thu Mar 6 2013 Jeff Morriss
- List more build dependencies.
- Update to work on SuSE too: some of their package names are different.