# HG changeset patch # User Ludwig Nussel # Date 1301129048 -3600 # Node ID 9d68a664c42aa403a646c0e0e38f95b86e6feb91 # Parent ec8f4a65808678bb0aa8179a1b01b46f2341709c add devel package with RPM macros diff -r ec8f4a658086 -r 9d68a664c42a MozillaFirefox/MozillaFirefox.changes --- a/MozillaFirefox/MozillaFirefox.changes Sat Mar 19 23:14:33 2011 +0100 +++ b/MozillaFirefox/MozillaFirefox.changes Sat Mar 26 09:44:08 2011 +0100 @@ -1,13 +1,22 @@ +------------------------------------------------------------------- +Fri Mar 25 13:33:17 UTC 2011 - lnussel@suse.de + +- add macros file similar to Mandriva in order to simplify + packaging extensions + ------------------------------------------------------------------- Sat Mar 19 22:13:40 UTC 2011 - wr@rosenauer.org - security update to 3.6.16 (bnc#680771) + * MFSA 2011-11 (bmo#642395) + Update HTTPS certificate blacklist ------------------------------------------------------------------- Fri Mar 4 12:45:50 UTC 2011 - wr@rosenauer.org - update to 3.6.15 - * fix a few regressions introduced with previous update + * fix a regression introduced with previous update affecting + Java applet integration (bmo#629030) ------------------------------------------------------------------- Tue Feb 22 08:17:39 UTC 2011 - wr@rosenauer.org diff -r ec8f4a658086 -r 9d68a664c42a MozillaFirefox/MozillaFirefox.spec --- a/MozillaFirefox/MozillaFirefox.spec Sat Mar 19 23:14:33 2011 +0100 +++ b/MozillaFirefox/MozillaFirefox.spec Sat Mar 26 09:44:08 2011 +0100 @@ -18,6 +18,8 @@ # norootforbuild +%define major 3 +%define mainver %major.6 Name: MozillaFirefox %define xulrunner mozilla-xulrunner192 @@ -32,10 +34,12 @@ BuildRequires: wireless-tools %endif License: GPLv2+ ; LGPLv2.1+ ; MPLv1.1+ -Version: 3.6.16 +Version: %mainver.16 +Release: 1 Provides: web_browser +Provides: firefox = %{mainver} +Provides: firefox = %{version}-%{release} Provides: firefox = %{version} -Release: 1 %define releasedate 2011031900 Summary: Mozilla Firefox Web Browser Url: http://www.mozilla.org/ @@ -52,6 +56,7 @@ Source9: firefox-lockdown.js Source16: firefox.1 Source17: firefox-suse-default-prefs.js +Source18: mozilla-get-app-id Patch1: firefox-libxul-sdk.patch Patch2: firefox-credits.patch Patch3: toolkit-download-folder.patch @@ -73,6 +78,7 @@ Requires: %{xulrunner}-32bit = %(rpm -q --queryformat '%{VERSION}' %{xulrunner}) %endif Requires: %{name}-branding >= 3.5 +%define firefox_appid \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\} %define _use_internal_dependency_generator 0 %define __find_requires sh %{SOURCE4} %global provfind sh -c "grep -v '.so' | %__find_provides" @@ -99,9 +105,19 @@ compliance and performance. Its functionality can be enhanced via a plethora of extensions. +%package devel +License: GPLv2+ ; LGPLv2.1+ ; MPLv1.1+ +Summary: Devel package for Firefox +Group: Development/Tools/Other +Provides: firefox-devel = %{version}-%{release} +Requires: %{name} = %{version} +Requires: perl(XML::Simple) +Requires: perl(Archive::Zip) + +%description devel +Development files for Firefox to make packaging of addons easier. %if %localize - %package translations-common Summary: Common translations for MozillaFirefox License: GPLv2+ ; LGPLv2.1+ ; MPLv1.1+ @@ -276,6 +292,8 @@ ########## # ADDONS # +mkdir -p $RPM_BUILD_ROOT%{_datadir}/mozilla/extensions/%{firefox_appid} +mkdir -p $RPM_BUILD_ROOT%{_libdir}/mozilla/extensions/%{firefox_appid} mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps/ ln -sf %{progdir}/icons/mozicon128.png $RPM_BUILD_ROOT/usr/share/pixmaps/%{progname}.png ln -sf %{progdir}/icons/mozicon128.png $RPM_BUILD_ROOT/usr/share/pixmaps/%{progname}-gnome.png @@ -294,6 +312,29 @@ rm -f $RPM_BUILD_ROOT%{progdir}/old-homepage-default.properties rm -f $RPM_BUILD_ROOT%{progdir}/run-mozilla.sh rm -f $RPM_BUILD_ROOT%{progdir}/LICENSE +# devel +mkdir -p %{buildroot}%{_bindir} +install -m 755 %SOURCE18 %{buildroot}%{_bindir} +# inspired by mandriva +mkdir -p %{buildroot}/etc/rpm +cat <<'FIN' >%{buildroot}/etc/rpm/macros.%{progname} +# Macros from %{name} package +%%firefox_major %{major} +%%firefox_version %{version} +%%firefox_mainver %{mainver} +%%firefox_mozillapath %%{_libdir}/%{progname} +%%firefox_xulrunner %{xulrunner} +%%firefox_xulrunner_version %(rpm -q --queryformat '%{VERSION}' %{xulrunner}) +%%firefox_pluginsdir %%{_libdir}/browser-plugins +%%firefox_appid \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\} +%%firefox_extdir %%(if [ "%%_target_cpu" = "noarch" ]; then echo %%{_datadir}/mozilla/extensions/%%{firefox_appid}; else echo %%{_libdir}/mozilla/extensions/%%{firefox_appid}; fi) + +%%firefox_ext_install() \ + extdir="%%{buildroot}%%{firefox_extdir}/`mozilla-get-app-id '%%1'`" \ + mkdir -p "$extdir" \ + %%{__unzip} -q -d "$extdir" "%%1" \ + %%{nil} +FIN # fdupes %if %suse_version > 1020 %fdupes $RPM_BUILD_ROOT%{progdir} @@ -356,6 +397,12 @@ %{progdir}/components/ %exclude %{progdir}/defaults/profile/bookmarks.html %{progdir}/defaults/ +%dir %{_datadir}/mozilla +%dir %{_datadir}/mozilla/extensions +%dir %{_datadir}/mozilla/extensions/%{firefox_appid} +%dir %{_libdir}/mozilla +%dir %{_libdir}/mozilla/extensions +%dir %{_libdir}/mozilla/extensions/%{firefox_appid} %{progdir}/extensions/ %{progdir}/icons/ %{progdir}/searchplugins/ @@ -396,4 +443,9 @@ %{progdir}/browserconfig.properties %{progdir}/defaults/profile/bookmarks.html +%files devel +%defattr(-,root,root) +%{_bindir}/mozilla-get-app-id +/etc/rpm/macros.%{progname} + %changelog diff -r ec8f4a658086 -r 9d68a664c42a MozillaFirefox/mozilla-get-app-id --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MozillaFirefox/mozilla-get-app-id Sat Mar 26 09:44:08 2011 +0100 @@ -0,0 +1,51 @@ +#!/usr/bin/perl -w +use XML::Simple; + +my $file = shift || die "Usage: $0 [install.rdf|somefile.xpi]\n"; +my $xml; + +if ($file =~ /\.xpi$/) { + use Archive::Zip qw/:ERROR_CODES :CONSTANTS/; + my $zip = Archive::Zip->new(); + if ( $zip->read($file) != AZ_OK ) { + die "zip file read error\n"; + } + my $data = $zip->contents("install.rdf"); + die "missing install.rdf in $file\n" unless $data; + $xml = XMLin($data) || die "$!\n"; +} elsif ($file =~ /install.rdf/) { + $xml = XMLin($file) || die "$!\n"; +} else { + die "unsupported file format\n"; +} + +my $desc; +for my $tag (qw/RDF:Description Description/) { + if (exists $xml->{$tag}) { + if (ref $xml->{$tag} eq 'ARRAY') { + $desc = $xml->{$tag}; + } else { + $desc = [ $xml->{$tag} ]; + } + } +} + +my $uuid; +my $id; +for my $x (@$desc) { + if ($x->{"em:id"} =~ /{[[:xdigit:]]+-/) { + print STDERR "Warning: multiple uuids!\n" if defined $uuid; + $uuid = $x->{"em:id"}; + } elsif ($x->{"em:id"} =~ /@/) { + print STDERR "Warning: multiple ids!\n" if defined $id; + $id = $x->{"em:id"}; + } +} + +if (defined $id) { + print "$id\n"; +} elsif (defined $uuid) { + print "$uuid\n"; +} else { + exit 1; +}