MozillaFirefox/firefox-esr.spec
branchfirefox52
changeset 950 266ac4247974
child 957 b28ad21f195e
equal deleted inserted replaced
949:d91c918a6511 950:266ac4247974
       
     1 #
       
     2 # spec file for package firefox-esr
       
     3 #
       
     4 # Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
       
     5 #               2006-2017 Wolfgang Rosenauer
       
     6 #
       
     7 # All modifications and additions to the file contributed by third parties
       
     8 # remain the property of their copyright owners, unless otherwise agreed
       
     9 # upon. The license for this file, and modifications and additions to the
       
    10 # file, is the same license as for the pristine package itself (unless the
       
    11 # license for the pristine package is not an Open Source License, in which
       
    12 # case the license is the MIT License). An "Open Source License" is a
       
    13 # license that conforms to the Open Source Definition (Version 1.9)
       
    14 # published by the Open Source Initiative.
       
    15 
       
    16 # Please submit bugfixes or comments via http://bugs.opensuse.org/
       
    17 #
       
    18 
       
    19 
       
    20 # changed with every update
       
    21 %define major 52
       
    22 %define mainver %major.0.1
       
    23 %define update_channel esr52
       
    24 %define releasedate 20170317000000
       
    25 
       
    26 # PIE, full relro (x86_64 for now)
       
    27 %define build_hardened 1
       
    28 
       
    29 %if 0%{?suse_version} > 1320
       
    30 %define firefox_use_gtk3 1
       
    31 %ifarch %ix86 x86_64
       
    32 %define firefox_use_rust 1
       
    33 %endif
       
    34 %endif
       
    35 
       
    36 # general build definitions
       
    37 %if "%{update_channel}" != "aurora"
       
    38 %define progname firefox
       
    39 %define pkgname  firefox-esr
       
    40 %define appname  Firefox
       
    41 %else
       
    42 %define progname firefox-dev
       
    43 %define pkgname  firefox-dev-edition
       
    44 %define appname  Firefox Developer Edition
       
    45 %endif
       
    46 %define progdir %{_prefix}/%_lib/%{progname}
       
    47 %define gnome_dir     %{_prefix}
       
    48 %define desktop_file_name %{progname}
       
    49 %define firefox_appid \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
       
    50 %define _use_internal_dependency_generator 0
       
    51 %define __find_requires sh %{SOURCE4}
       
    52 %global provfind sh -c "grep -v '.so' | %__find_provides"
       
    53 %global __find_provides %provfind
       
    54 # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys
       
    55 # Note: these are for the openSUSE Firefox builds ONLY. For your own distribution,
       
    56 # please get your own set of keys.
       
    57 %define _google_api_key AIzaSyD1hTe85_a14kr1Ks8T3Ce75rvbR1_Dx7Q
       
    58 %if %update_channel == "aurora"
       
    59 %define branding 0
       
    60 %else
       
    61 %define branding 1
       
    62 %endif
       
    63 %define localize 1
       
    64 %ifarch %ix86 x86_64
       
    65 %define crashreporter 1
       
    66 %else
       
    67 %define crashreporter 0
       
    68 %endif
       
    69 
       
    70 Name:           %{pkgname}
       
    71 BuildRequires:  Mesa-devel
       
    72 BuildRequires:  autoconf213
       
    73 BuildRequires:  dbus-1-glib-devel
       
    74 BuildRequires:  fdupes
       
    75 BuildRequires:  gcc-c++
       
    76 BuildRequires:  libXcomposite-devel
       
    77 BuildRequires:  libcurl-devel
       
    78 BuildRequires:  libgnomeui-devel
       
    79 BuildRequires:  libidl-devel
       
    80 BuildRequires:  libiw-devel
       
    81 BuildRequires:  libnotify-devel
       
    82 BuildRequires:  libproxy-devel
       
    83 BuildRequires:  makeinfo
       
    84 BuildRequires:  mozilla-nspr-devel >= 4.13.1
       
    85 BuildRequires:  mozilla-nss-devel >= 3.28.3
       
    86 BuildRequires:  nss-shared-helper-devel
       
    87 BuildRequires:  python-devel
       
    88 BuildRequires:  startup-notification-devel
       
    89 BuildRequires:  unzip
       
    90 BuildRequires:  update-desktop-files
       
    91 BuildRequires:  xorg-x11-libXt-devel
       
    92 BuildRequires:  yasm
       
    93 BuildRequires:  zip
       
    94 BuildRequires:  pkgconfig(libpulse)
       
    95 BuildRequires:  pkgconfig(libffi)
       
    96 %if 0%{?firefox_use_gtk3}
       
    97 BuildRequires:  pkgconfig(glib-2.0)
       
    98 BuildRequires:  pkgconfig(gobject-2.0)
       
    99 BuildRequires:  pkgconfig(gtk+-3.0) >= 3.4.0
       
   100 BuildRequires:  pkgconfig(gtk+-unix-print-3.0)
       
   101 %endif
       
   102 %if 0%{?firefox_use_rust}
       
   103 BuildRequires:  cargo
       
   104 BuildRequires:  rust >= 1.10
       
   105 BuildRequires:  rust-std
       
   106 %endif
       
   107 # libavcodec is required for H.264 support but the
       
   108 # openSUSE version is currently not able to play H.264
       
   109 # therefore the Packman version is required
       
   110 # minimum version of libavcodec is 53
       
   111 Recommends:     libavcodec-full >= 0.10.16
       
   112 Version:        %{mainver}
       
   113 Release:        0
       
   114 %if "%{name}" == "MozillaFirefox"
       
   115 Provides:       firefox-esr = %{mainver}
       
   116 Provides:       firefox-esr = %{version}-%{release}
       
   117 %endif
       
   118 Provides:       web_browser
       
   119 Provides:       browser(npapi)
       
   120 %if "%{update_channel}" != "aurora"
       
   121 Provides:       appdata()
       
   122 Provides:       appdata(firefox.appdata.xml)
       
   123 %endif
       
   124 # this is needed to match this package with the kde4 helper package without the main package
       
   125 # having a hard requirement on the kde4 package
       
   126 %define kde_helper_version 6
       
   127 Provides:       mozilla-kde4-version = %{kde_helper_version}
       
   128 Conflicts:      firefox
       
   129 Summary:        Mozilla %{appname} Web Browser
       
   130 License:        MPL-2.0
       
   131 Group:          Productivity/Networking/Web/Browsers
       
   132 Url:            http://www.mozilla.org/
       
   133 Source:         firefox-%{version}-source.tar.xz
       
   134 Source1:        MozillaFirefox.desktop
       
   135 Source2:        MozillaFirefox-rpmlintrc
       
   136 Source3:        mozilla.sh.in
       
   137 Source4:        find-external-requires.sh
       
   138 Source5:        source-stamp.txt
       
   139 Source6:        kde.js
       
   140 Source7:        l10n-%{version}.tar.xz
       
   141 Source8:        firefox-mimeinfo.xml
       
   142 Source9:        firefox.js
       
   143 Source10:       compare-locales.tar.xz
       
   144 Source11:       firefox.1
       
   145 Source12:       mozilla-get-app-id
       
   146 Source13:       spellcheck.js
       
   147 Source14:       create-tar.sh
       
   148 Source15:       firefox-appdata.xml
       
   149 Source16:       firefox-esr.changes
       
   150 Source17:       l10n_changesets.txt
       
   151 # Gecko/Toolkit
       
   152 Patch1:         mozilla-nongnome-proxies.patch
       
   153 Patch2:         mozilla-shared-nss-db.patch
       
   154 Patch3:         mozilla-kde.patch
       
   155 Patch4:         mozilla-preferences.patch
       
   156 Patch5:         mozilla-language.patch
       
   157 Patch6:         mozilla-ntlm-full-path.patch
       
   158 Patch7:         mozilla-openaes-decl.patch
       
   159 Patch8:         mozilla-no-stdcxx-check.patch
       
   160 Patch9:         mozilla-reduce-files-per-UnifiedBindings.patch
       
   161 Patch10:        mozilla-aarch64-startup-crash.patch
       
   162 # Firefox/browser
       
   163 Patch101:       firefox-kde.patch
       
   164 Patch102:       firefox-no-default-ualocale.patch
       
   165 Patch103:       firefox-branded-icons.patch
       
   166 
       
   167 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
       
   168 Requires(post):   coreutils shared-mime-info desktop-file-utils
       
   169 Requires(postun): shared-mime-info desktop-file-utils
       
   170 %if %branding
       
   171 Requires:       %{name}-branding > 44.0
       
   172 %endif
       
   173 Requires:       mozilla-nspr >= %(rpm -q --queryformat '%{VERSION}' mozilla-nspr)
       
   174 Requires:       mozilla-nss >= %(rpm -q --queryformat '%{VERSION}' mozilla-nss)
       
   175 Recommends:     libcanberra0
       
   176 Recommends:     libpulse0
       
   177 # addon leads to startup crash (bnc#908892)
       
   178 Obsoletes:      tracker-miner-firefox < 0.15
       
   179 # libproxy's mozjs pacrunner crashes FF (bnc#759123)
       
   180 %if 0%{?suse_version} < 1220
       
   181 Obsoletes:      libproxy1-pacrunner-mozjs <= 0.4.7
       
   182 %endif
       
   183 
       
   184 %description
       
   185 Mozilla Firefox is a standalone web browser, designed for standards
       
   186 compliance and performance.  Its functionality can be enhanced via a
       
   187 plethora of extensions.
       
   188 
       
   189 %package devel
       
   190 Summary:        Devel package for %{appname}
       
   191 Group:          Development/Tools/Other
       
   192 Provides:       firefox-devel = %{version}-%{release}
       
   193 Requires:       %{name} = %{version}
       
   194 Requires:       perl(Archive::Zip)
       
   195 Requires:       perl(XML::Simple)
       
   196 
       
   197 %description devel
       
   198 Development files for %{appname} to make packaging of addons easier.
       
   199 
       
   200 %if %localize
       
   201 %package translations-common
       
   202 Summary:        Common translations for %{appname}
       
   203 Group:          System/Localization
       
   204 Provides:       locale(%{name}:ar;ca;cs;da;de;en_GB;el;es_AR;es_CL;es_ES;fi;fr;hu;it;ja;ko;nb_NO;nl;pl;pt_BR;pt_PT;ru;sv_SE;zh_CN;zh_TW)
       
   205 Requires:       %{name} = %{version}
       
   206 Obsoletes:      %{name}-translations < %{version}-%{release}
       
   207 
       
   208 %description translations-common
       
   209 This package contains several common languages for the user interface
       
   210 of %{appname}.
       
   211 
       
   212 %package translations-other
       
   213 Summary:        Extra translations for %{appname}
       
   214 Group:          System/Localization
       
   215 Provides:       locale(%{name}:ach;af;an;as;ast;az;bg;bn_BD;bn_IN;br;bs;cak;cy;dsb;en_ZA;eo;es_MX;et;eu;fa;ff;fy_NL;ga_IE;gd;gl;gn;gu_IN;he;hi_IN;hr;hsb;hy_AM;id;is;ka;kab;kk;km;kn;lij;lt;lv;mai;mk;ml;mr;ms;nn_NO;or;pa_IN;rm;ro;si;sk;sl;son;sq;sr;ta;te;th;tr;uk;uz;vi;xh)
       
   216 Requires:       %{name} = %{version}
       
   217 Obsoletes:      %{name}-translations < %{version}-%{release}
       
   218 
       
   219 %description translations-other
       
   220 This package contains rarely used languages for the user interface
       
   221 of %{appname}.
       
   222 %endif
       
   223 
       
   224 %if %branding
       
   225 %package branding-upstream
       
   226 Summary:        Upstream branding for %{appname}
       
   227 Group:          Productivity/Networking/Web/Browsers
       
   228 Provides:       %{name}-branding = %{version}
       
   229 Conflicts:      otherproviders(MozillaFirefox-branding)
       
   230 Supplements:    packageand(%{name}:branding-upstream)
       
   231 #BRAND: Provide three files -
       
   232 #BRAND: /usr/lib/firefox/browserconfig.properties that contains the
       
   233 #BRAND: default homepage and some other default configuration options
       
   234 #BRAND: /usr/lib/firefox/defaults/profile/bookmarks.html that contains
       
   235 #BRAND: the list of default bookmarks
       
   236 #BRAND: It's also possible to create a file
       
   237 #BRAND: /usr/lib/firefox/defaults/preferences/firefox-$vendor.js to set
       
   238 #BRAND: custom preference overrides.
       
   239 #BRAND: It's also possible to drop files in /usr/lib/firefox/distribution/searchplugins/common/
       
   240 
       
   241 %description branding-upstream
       
   242 This package provides upstream look and feel for %{appname}.
       
   243 %endif
       
   244 
       
   245 %if %crashreporter
       
   246 %package buildsymbols
       
   247 Summary:        Breakpad buildsymbols for %{appname}
       
   248 Group:          Development/Debug
       
   249 
       
   250 %description buildsymbols
       
   251 This subpackage contains the Breakpad created and compatible debugging
       
   252 symbols meant for upload to Mozilla's crash collector database.
       
   253 %endif
       
   254 
       
   255 %prep
       
   256 %if %localize
       
   257 %setup -q -n mozilla -b 7 -b 10
       
   258 %else
       
   259 %setup -q -n mozilla
       
   260 %endif
       
   261 cd $RPM_BUILD_DIR/mozilla
       
   262 %patch1 -p1
       
   263 %patch2 -p1
       
   264 %patch3 -p1
       
   265 %patch4 -p1
       
   266 %patch5 -p1
       
   267 %patch6 -p1
       
   268 %patch7 -p1
       
   269 %patch8 -p1
       
   270 %patch9 -p1
       
   271 %patch10 -p1
       
   272 # Firefox
       
   273 %patch101 -p1
       
   274 %patch102 -p1
       
   275 %patch103 -p1
       
   276 
       
   277 %build
       
   278 # no need to add build time to binaries
       
   279 modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/firefox-esr.changes")"
       
   280 DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\""
       
   281 TIME="\"$(date -d "${modified}" "+%%R")\""
       
   282 find . -regex ".*\.c\|.*\.cpp\|.*\.h" -exec sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g" {} +
       
   283 #
       
   284 kdehelperversion=$(cat toolkit/xre/nsKDEUtils.cpp | grep '#define KMOZILLAHELPER_VERSION' | cut -d ' ' -f 3)
       
   285 if test "$kdehelperversion" != %{kde_helper_version}; then
       
   286   echo fix kde helper version in the .spec file
       
   287   exit 1
       
   288 fi
       
   289 source %{SOURCE5}
       
   290 export MOZ_SOURCE_CHANGESET=$REV
       
   291 export SOURCE_REPO=$REPO
       
   292 export source_repo=$REPO
       
   293 export MOZ_SOURCE_REPO=$REPO
       
   294 export MOZ_BUILD_DATE=%{releasedate}
       
   295 export MOZILLA_OFFICIAL=1
       
   296 export BUILD_OFFICIAL=1
       
   297 export MOZ_TELEMETRY_REPORTING=1
       
   298 export MOZ_GOOGLE_API_KEY=%{_google_api_key}
       
   299 export CFLAGS="%{optflags} -fno-strict-aliasing"
       
   300 # boo#986541: add -fno-delete-null-pointer-checks and -fno-inline-small-functions for gcc6
       
   301 %if 0%{?suse_version} > 1320
       
   302 export CFLAGS="$CFLAGS -fno-delete-null-pointer-checks -fno-inline-small-functions"
       
   303 %endif
       
   304 %ifarch %arm
       
   305 export CFLAGS="${CFLAGS/-g / }"
       
   306 %endif
       
   307 %ifarch %arm %ix86
       
   308 # Limit RAM usage during link
       
   309 export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
       
   310 %endif
       
   311 %if 0%{?build_hardened}
       
   312 %ifarch x86_64
       
   313 export LDFLAGS="${LDFLAGS} -Wl,-z,relro,-z,now"
       
   314 %endif
       
   315 %endif
       
   316 %ifarch ppc64 ppc64le
       
   317 export CFLAGS="$CFLAGS -mminimal-toc"
       
   318 %endif
       
   319 export CXXFLAGS="$CFLAGS"
       
   320 export MOZCONFIG=$RPM_BUILD_DIR/mozconfig
       
   321 cat << EOF > $MOZCONFIG
       
   322 mk_add_options MOZILLA_OFFICIAL=1
       
   323 mk_add_options BUILD_OFFICIAL=1
       
   324 mk_add_options MOZ_MAKE_FLAGS=%{?jobs:-j%jobs}
       
   325 mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../obj
       
   326 . \$topsrcdir/browser/config/mozconfig
       
   327 ac_add_options --prefix=%{_prefix}
       
   328 ac_add_options --libdir=%{_libdir}
       
   329 ac_add_options --includedir=%{_includedir}
       
   330 ac_add_options --enable-release
       
   331 %if 0%{?firefox_use_rust}
       
   332 ac_add_options --enable-rust
       
   333 %endif
       
   334 %if 0%{?firefox_use_gtk3}
       
   335 ac_add_options --enable-default-toolkit=cairo-gtk3
       
   336 %else
       
   337 ac_add_options --enable-default-toolkit=cairo-gtk2
       
   338 %endif
       
   339 %if 0%{?build_hardened}
       
   340 ac_add_options --enable-pie
       
   341 %endif
       
   342 %ifarch %ix86 %arm
       
   343 %if 0%{?suse_version} > 1230
       
   344 ac_add_options --disable-optimize
       
   345 %endif
       
   346 %endif
       
   347 %ifarch ppc ppc64 ppc64le %arm
       
   348 ac_add_options --disable-elf-hack
       
   349 %endif
       
   350 ac_add_options --with-system-nspr
       
   351 ac_add_options --with-system-nss
       
   352 %if %{localize}
       
   353 ac_add_options --with-l10n-base=$RPM_BUILD_DIR/l10n
       
   354 %endif
       
   355 #ac_add_options --with-system-jpeg    # libjpeg-turbo is used internally
       
   356 #ac_add_options --with-system-png     # doesn't work because of missing APNG support
       
   357 ac_add_options --with-system-zlib
       
   358 ac_add_options --disable-updater
       
   359 ac_add_options --disable-tests
       
   360 ac_add_options --enable-alsa
       
   361 ac_add_options --disable-debug
       
   362 ac_add_options --enable-startup-notification
       
   363 #ac_add_options --enable-chrome-format=jar
       
   364 ac_add_options --enable-update-channel=%{update_channel}
       
   365 %if %branding
       
   366 ac_add_options --enable-official-branding
       
   367 %endif
       
   368 ac_add_options --enable-libproxy
       
   369 %if ! %crashreporter
       
   370 ac_add_options --disable-crashreporter
       
   371 %endif
       
   372 %ifarch %arm
       
   373 ac_add_options --with-fpu=vfpv3-d16
       
   374 ac_add_options --with-float-abi=hard
       
   375 ac_add_options --with-arch=armv7-a
       
   376 %endif
       
   377 %ifarch %arm s390x
       
   378 ac_add_options --disable-webrtc
       
   379 %endif
       
   380 EOF
       
   381 make -f client.mk build
       
   382 
       
   383 %install
       
   384 cd $RPM_BUILD_DIR/obj
       
   385 source %{SOURCE5}
       
   386 export MOZ_SOURCE_STAMP=$REV
       
   387 export MOZ_SOURCE_REPO=$REPO
       
   388 # need to remove default en-US firefox-l10n.js before it gets
       
   389 # populated into browser's omni.ja; it only contains general.useragent.locale
       
   390 # which should be loaded from each language pack (set in firefox.js)
       
   391 rm dist/bin/browser/defaults/preferences/firefox-l10n.js
       
   392 make -C browser/installer STRIP=/bin/true MOZ_PKG_FATAL_WARNINGS=0
       
   393 #DEBUG (break the build if searchplugins are missing / temporary)
       
   394 grep amazondotcom dist/firefox/browser/omni.ja
       
   395 # copy tree into RPM_BUILD_ROOT
       
   396 mkdir -p %{buildroot}%{progdir}
       
   397 cp -rf $RPM_BUILD_DIR/obj/dist/firefox/* %{buildroot}%{progdir}
       
   398 mkdir -p %{buildroot}%{progdir}/distribution/extensions
       
   399 mkdir -p %{buildroot}%{progdir}/browser/defaults/preferences/
       
   400 # install gre prefs
       
   401 install -m 644 %{SOURCE13} %{buildroot}%{progdir}/defaults/pref/
       
   402 # install browser prefs
       
   403 install -m 644 %{SOURCE6} %{buildroot}%{progdir}/browser/defaults/preferences/kde.js
       
   404 install -m 644 %{SOURCE9} %{buildroot}%{progdir}/browser/defaults/preferences/firefox.js
       
   405 # install additional locales
       
   406 %if %localize
       
   407 rm -f %{_tmppath}/translations.*
       
   408 touch %{_tmppath}/translations.{common,other}
       
   409 for locale in $(awk '{ print $1; }' %{SOURCE17}); do
       
   410   case $locale in
       
   411    ja-JP-mac|en-US|'')
       
   412 	;;
       
   413    *)
       
   414    	pushd $RPM_BUILD_DIR/compare-locales
       
   415 	PYTHONPATH=lib \
       
   416 	  scripts/compare-locales -m ../l10n-merged/$locale \
       
   417 	  ../mozilla/browser/locales/l10n.ini ../l10n $locale
       
   418 	popd
       
   419 	LOCALE_MERGEDIR=$RPM_BUILD_DIR/l10n-merged/$locale \
       
   420   	make -C browser/locales langpack-$locale
       
   421 	cp -rL dist/xpi-stage/locale-$locale \
       
   422 	       %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org
       
   423 	# remove prefs, profile defaults, and hyphenation from langpack
       
   424 	rm -rf %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org/defaults
       
   425 	rm -rf %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org/hyphenation
       
   426 	# check against the fixed common list and sort into the right filelist
       
   427 	_matched=0
       
   428 	for _match in ar ca cs da de en-GB el es-AR es-CL es-ES fi fr hu it ja ko nb-NO nl pl pt-BR pt-PT ru sv-SE zh-CN zh-TW; do
       
   429 	  [ "$_match" = "$locale" ] && _matched=1
       
   430 	done
       
   431 	[ $_matched -eq 1 ] && _l10ntarget=common || _l10ntarget=other
       
   432   	echo %{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org \
       
   433 	  >> %{_tmppath}/translations.$_l10ntarget
       
   434   esac
       
   435 done
       
   436 %endif
       
   437 # remove some executable permissions
       
   438 find %{buildroot}%{progdir} \
       
   439      -name "*.js" -o \
       
   440      -name "*.jsm" -o \
       
   441      -name "*.rdf" -o \
       
   442      -name "*.properties" -o \
       
   443      -name "*.dtd" -o \
       
   444      -name "*.txt" -o \
       
   445      -name "*.xml" -o \
       
   446      -name "*.css" | xargs chmod a-x
       
   447 # remove mkdir.done files from installed base
       
   448 find %{buildroot}%{progdir} -name ".mkdir.done" | xargs rm
       
   449 # overwrite the mozilla start-script and link it to /usr/bin
       
   450 mkdir --parents %{buildroot}/usr/bin
       
   451 sed "s:%%PREFIX:%{_prefix}:g
       
   452 s:%%PROGDIR:%{progdir}:g
       
   453 s:%%APPNAME:firefox:g
       
   454 s:%%PROFILE:.mozilla/firefox:g" \
       
   455   %{SOURCE3} > %{buildroot}%{progdir}/%{progname}.sh
       
   456 chmod 755 %{buildroot}%{progdir}/%{progname}.sh
       
   457 ln -sf ../..%{progdir}/%{progname}.sh %{buildroot}%{_bindir}/%{progname}
       
   458 # desktop file
       
   459 mkdir -p %{buildroot}%{_datadir}/applications
       
   460 sed "s:%%NAME:%{appname}:g
       
   461 s:%%EXEC:%{progname}:g
       
   462 s:%%ICON:%{progname}:g" \
       
   463   %{SOURCE1} > %{buildroot}%{_datadir}/applications/%{desktop_file_name}.desktop
       
   464 %suse_update_desktop_file %{desktop_file_name} Network WebBrowser GTK
       
   465 # additional mime-types
       
   466 mkdir -p %{buildroot}%{_datadir}/mime/packages
       
   467 cp %{SOURCE8} %{buildroot}%{_datadir}/mime/packages/%{progname}.xml
       
   468 # appdata
       
   469 %if "%{update_channel}" != "aurora"
       
   470 mkdir -p %{buildroot}%{_datadir}/appdata
       
   471 cp %{SOURCE15} %{buildroot}%{_datadir}/appdata/%{desktop_file_name}.appdata.xml
       
   472 %endif
       
   473 # install man-page
       
   474 mkdir -p %{buildroot}%{_mandir}/man1/
       
   475 cp %{SOURCE11} %{buildroot}%{_mandir}/man1/%{progname}.1
       
   476 ##########
       
   477 # ADDONS
       
   478 #
       
   479 mkdir -p %{buildroot}%{_datadir}/mozilla/extensions/%{firefox_appid}
       
   480 mkdir -p %{buildroot}%{_libdir}/mozilla/extensions/%{firefox_appid}
       
   481 mkdir -p %{buildroot}/usr/share/pixmaps/
       
   482 ln -sf %{progdir}/browser/icons/mozicon128.png %{buildroot}/usr/share/pixmaps/%{progname}.png
       
   483 ln -sf %{progdir}/browser/icons/mozicon128.png %{buildroot}/usr/share/pixmaps/%{progname}-gnome.png
       
   484 %if %branding
       
   485 for size in 16 22 24 32 48 256; do
       
   486 %else
       
   487 for size in 16 32 48; do
       
   488 %endif
       
   489   mkdir -p %{buildroot}%{gnome_dir}/share/icons/hicolor/${size}x${size}/apps/
       
   490   cp %{buildroot}%{progdir}/browser/chrome/icons/default/default$size.png \
       
   491          %{buildroot}%{gnome_dir}/share/icons/hicolor/${size}x${size}/apps/%{progname}.png
       
   492 done
       
   493 # excludes
       
   494 rm -f %{buildroot}%{progdir}/updater.ini
       
   495 rm -f %{buildroot}%{progdir}/removed-files
       
   496 rm -f %{buildroot}%{progdir}/README.txt
       
   497 rm -f %{buildroot}%{progdir}/old-homepage-default.properties
       
   498 rm -f %{buildroot}%{progdir}/run-mozilla.sh
       
   499 rm -f %{buildroot}%{progdir}/LICENSE
       
   500 rm -f %{buildroot}%{progdir}/precomplete
       
   501 rm -f %{buildroot}%{progdir}/dictionaries/en-US*
       
   502 rm -f %{buildroot}%{progdir}/update-settings.ini
       
   503 # devel
       
   504 mkdir -p %{buildroot}%{_bindir}
       
   505 install -m 755 %SOURCE12 %{buildroot}%{_bindir}
       
   506 # inspired by mandriva
       
   507 mkdir -p %{buildroot}%{_sysconfdir}/rpm
       
   508 cat <<'FIN' >%{buildroot}%{_sysconfdir}/rpm/macros.%{progname}
       
   509 # Macros from %{name} package
       
   510 %%firefox_major              %{major}
       
   511 %%firefox_version            %{version}
       
   512 %%firefox_mainver            %{mainver}
       
   513 %%firefox_mozillapath        %%{_libdir}/%{progname}
       
   514 %%firefox_pluginsdir         %%{_libdir}/browser-plugins
       
   515 %%firefox_appid              \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
       
   516 %%firefox_extdir             %%(if [ "%%_target_cpu" = "noarch" ]; then echo %%{_datadir}/mozilla/extensions/%%{firefox_appid}; else echo %%{_libdir}/mozilla/extensions/%%{firefox_appid}; fi)
       
   517 
       
   518 %%firefox_ext_install() \
       
   519    extdir="%%{buildroot}%%{firefox_extdir}/`mozilla-get-app-id '%%1'`" \
       
   520    mkdir -p "$extdir" \
       
   521    %%{__unzip} -q -d "$extdir" "%%1" \
       
   522    %%{nil}
       
   523 FIN
       
   524 # just dumping an xpi file there doesn't work...
       
   525 #%%firefox_ext_install() \
       
   526 #       extdir="%%{buildroot}%%{firefox_extdir}" \
       
   527 #       mkdir -p "$extdir" \
       
   528 #       cp "%%1" "$extdir" \
       
   529 #       %%{nil}
       
   530 # fdupes
       
   531 %fdupes %{buildroot}%{progdir}
       
   532 %fdupes %{buildroot}%{_datadir}
       
   533 # create breakpad debugsymbols
       
   534 %if %crashreporter
       
   535 SYMBOLS_NAME="firefox-%{version}-` echo '%{release}' | sed 's@\.[^\.]\+$@@' `.%{_arch}-%{suse_version}-symbols"
       
   536 make buildsymbols \
       
   537   SYMBOL_INDEX_NAME="$SYMBOLS_NAME.txt" \
       
   538   SYMBOL_FULL_ARCHIVE_BASENAME="$SYMBOLS_NAME-full" \
       
   539   SYMBOL_ARCHIVE_BASENAME="$SYMBOLS_NAME"
       
   540 if [ -e dist/*symbols.zip ]; then
       
   541   mkdir -p %{buildroot}%{_datadir}/mozilla/
       
   542   cp dist/*symbols.zip %{buildroot}%{_datadir}/mozilla/
       
   543 fi
       
   544 %endif
       
   545 
       
   546 %clean
       
   547 rm -rf %{buildroot}
       
   548 %if %localize
       
   549 rm -rf %{_tmppath}/translations.*
       
   550 %endif
       
   551 
       
   552 %post
       
   553 # update mime and desktop database
       
   554 %mime_database_post
       
   555 %desktop_database_post
       
   556 %icon_theme_cache_post
       
   557 exit 0
       
   558 
       
   559 %postun
       
   560 %icon_theme_cache_postun
       
   561 %desktop_database_postun
       
   562 %mime_database_postun
       
   563 exit 0
       
   564 
       
   565 %files
       
   566 %defattr(-,root,root)
       
   567 %dir %{progdir}
       
   568 %dir %{progdir}/browser/
       
   569 %dir %{progdir}/browser/chrome/
       
   570 %dir %{progdir}/browser/extensions/
       
   571 %{progdir}/browser/defaults
       
   572 %{progdir}/browser/features/
       
   573 %{progdir}/browser/icons/
       
   574 %{progdir}/browser/chrome/icons
       
   575 %{progdir}/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi
       
   576 %{progdir}/browser/blocklist.xml
       
   577 %{progdir}/browser/chrome.manifest
       
   578 %{progdir}/browser/omni.ja
       
   579 %dir %{progdir}/distribution/
       
   580 %{progdir}/distribution/extensions/
       
   581 %{progdir}/defaults/
       
   582 %{progdir}/dictionaries/
       
   583 %if 0%{?firefox_use_gtk3}
       
   584 %dir %{progdir}/gtk2
       
   585 %{progdir}/gtk2/libmozgtk.so
       
   586 %endif
       
   587 %{progdir}/gmp-clearkey/
       
   588 %attr(755,root,root) %{progdir}/%{progname}.sh
       
   589 %{progdir}/firefox
       
   590 %{progdir}/firefox-bin
       
   591 %{progdir}/application.ini
       
   592 %{progdir}/chrome.manifest
       
   593 %{progdir}/dependentlibs.list
       
   594 %{progdir}/icudt58l.dat
       
   595 %{progdir}/*.so
       
   596 %{progdir}/omni.ja
       
   597 %{progdir}/fonts/
       
   598 %{progdir}/platform.ini
       
   599 %{progdir}/plugin-container
       
   600 %if %crashreporter
       
   601 %{progdir}/crashreporter
       
   602 %{progdir}/crashreporter.ini
       
   603 %{progdir}/Throbber-small.gif
       
   604 %{progdir}/minidump-analyzer
       
   605 %{progdir}/browser/crashreporter-override.ini
       
   606 %endif
       
   607 %{_datadir}/applications/%{desktop_file_name}.desktop
       
   608 %{_datadir}/mime/packages/%{progname}.xml
       
   609 %{_datadir}/pixmaps/firefox*
       
   610 %dir %{_datadir}/mozilla
       
   611 %dir %{_datadir}/mozilla/extensions
       
   612 %dir %{_datadir}/mozilla/extensions/%{firefox_appid}
       
   613 %dir %{_libdir}/mozilla
       
   614 %dir %{_libdir}/mozilla/extensions
       
   615 %dir %{_libdir}/mozilla/extensions/%{firefox_appid}
       
   616 %{gnome_dir}/share/icons/hicolor/
       
   617 %{_bindir}/%{progname}
       
   618 %doc %{_mandir}/man1/%{progname}.1.gz
       
   619 %if "%{update_channel}" != "aurora"
       
   620 %{_datadir}/appdata/
       
   621 %endif
       
   622 
       
   623 %files devel
       
   624 %defattr(-,root,root)
       
   625 %{_bindir}/mozilla-get-app-id
       
   626 %config %{_sysconfdir}/rpm/macros.%{progname}
       
   627 
       
   628 %if %localize
       
   629 
       
   630 %files translations-common -f %{_tmppath}/translations.common
       
   631 %defattr(-,root,root)
       
   632 %dir %{progdir}
       
   633 %dir %{progdir}/browser/extensions/
       
   634 
       
   635 %files translations-other -f %{_tmppath}/translations.other
       
   636 %defattr(-,root,root)
       
   637 %dir %{progdir}
       
   638 %dir %{progdir}/browser/extensions/
       
   639 %endif
       
   640 
       
   641 # this package does not need to provide files but is needed to fulfill
       
   642 # requirements if no other branding package is to be installed
       
   643 %if %branding
       
   644 %files branding-upstream
       
   645 %defattr(-,root,root)
       
   646 %dir %{progdir}
       
   647 %endif
       
   648 
       
   649 %if %crashreporter
       
   650 %files buildsymbols
       
   651 %defattr(-,root,root)
       
   652 %{_datadir}/mozilla/*.zip
       
   653 %endif
       
   654 
       
   655 %changelog