toolkit/mozapps/installer/linux/rpm/mozilla.spec

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 # This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 # License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 4
michael@0 5 %global __jar_repack %{nil}
michael@0 6
michael@0 7 #Use a consistent string to refer to the package by
michael@0 8 %define pr_name "%{moz_app_displayname} %{moz_app_version}"
michael@0 9
michael@0 10 Name: %{moz_app_name}
michael@0 11 Version: %{moz_numeric_app_version}
michael@0 12 Release: %{?moz_rpm_release:%{moz_rpm_release}}%{?buildid:.%{buildid}}
michael@0 13 Summary: %{pr_name}
michael@0 14 Group: Applications/Internet
michael@0 15 License: MPL 2
michael@0 16 Vendor: Mozilla
michael@0 17 URL: http://www.mozilla.org/projects/firefox/
michael@0 18 Source0: %{name}.desktop
michael@0 19 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
michael@0 20
michael@0 21 #AutoProv: no
michael@0 22
michael@0 23 BuildRequires: desktop-file-utils
michael@0 24
michael@0 25
michael@0 26 %description
michael@0 27 %{pr_name}. This package was built from
michael@0 28 %{moz_source_repo}/rev/%{moz_source_stamp}
michael@0 29
michael@0 30 #We only want a subpackage for the SDK if the required
michael@0 31 #files were generated. Like the tests subpackage, we
michael@0 32 #probably only need to conditionaly define the %files
michael@0 33 #section.
michael@0 34 %if %{?createdevel:1}
michael@0 35 %package devel
michael@0 36 Summary: %{pr_name} SDK
michael@0 37 Group: Development/Libraries
michael@0 38 requires: %{name} = %{version}-%{release}
michael@0 39 %description devel
michael@0 40 %{pr_name} SDK libraries, headers and interface descriptions
michael@0 41 %endif
michael@0 42
michael@0 43 %if %{?createtests:1}
michael@0 44 %package tests
michael@0 45 Summary: %{pr_name} tests
michael@0 46 Group: Developement/Libraries
michael@0 47 requires: %{name} = %{version}-%{release}
michael@0 48 %description tests
michael@0 49 %{pr_name} test harness files and test cases
michael@0 50 %endif
michael@0 51
michael@0 52 %prep
michael@0 53 echo No-op prep
michael@0 54
michael@0 55
michael@0 56 %build
michael@0 57 echo No-op build
michael@0 58
michael@0 59
michael@0 60 %install
michael@0 61 rm -rf $RPM_BUILD_ROOT
michael@0 62 make install DESTDIR=$RPM_BUILD_ROOT
michael@0 63 desktop-file-validate %{SOURCE0}
michael@0 64 desktop-file-install --vendor mozilla \
michael@0 65 --dir $RPM_BUILD_ROOT%{_datadir}/applications \
michael@0 66 %{SOURCE0}
michael@0 67 #In order to make branding work in a generic way, We find
michael@0 68 #all the icons that are likely to be used for desktop files
michael@0 69 #and install them appropriately
michael@0 70 find %{moz_branding_directory} -name "default*.png" | tee icons.list
michael@0 71 for i in $(cat icons.list) ; do
michael@0 72 size=$(echo $i | sed "s/.*default\([0-9]*\).png$/\1/")
michael@0 73 icondir=$RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/${size}x${size}/apps/
michael@0 74 mkdir -p $icondir
michael@0 75 cp -a $i ${icondir}%{name}.png
michael@0 76 done
michael@0 77 rm icons.list #cleanup
michael@0 78
michael@0 79 %if %{?createtests:1}
michael@0 80 #wastefully creates a zip file, but ensures that we stage all test suites
michael@0 81 make package-tests
michael@0 82 testdir=$RPM_BUILD_ROOT/%{_datadir}/%{_testsinstalldir}/tests
michael@0 83 mkdir -p $testdir
michael@0 84 cp -a dist/test-package-stage/* $testdir/
michael@0 85 %endif
michael@0 86
michael@0 87 %clean
michael@0 88 rm -rf $RPM_BUILD_ROOT
michael@0 89
michael@0 90
michael@0 91 %post
michael@0 92 #this is needed to get gnome-panel to update the icons
michael@0 93 update-desktop-database &> /dev/null || :
michael@0 94 touch --no-create %{_datadir}/icons/hicolor || :
michael@0 95 if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
michael@0 96 %{_bindir}/gtk-update-icon-cache --quiet ${_datadir}/icons/hicolor &> /dev/null || :
michael@0 97 fi
michael@0 98
michael@0 99
michael@0 100 %postun
michael@0 101 #this is needed to get gnome-panel to update the icons
michael@0 102 update-desktop-database &> /dev/null || :
michael@0 103 touch --no-create %{_datadir}/icons/hicolor || :
michael@0 104 if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
michael@0 105 %{_bindir}/gtk-update-icon-cache --quiet ${_datadir}/icons/hicolor &> /dev/null || :
michael@0 106 fi
michael@0 107
michael@0 108
michael@0 109 %files
michael@0 110 %defattr(-,root,root,-)
michael@0 111 %{_installdir}
michael@0 112 %{_bindir}
michael@0 113 %{_datadir}/applications/
michael@0 114 %{_datadir}/icons/
michael@0 115 %doc
michael@0 116
michael@0 117
michael@0 118 %if %{?createdevel:1}
michael@0 119 %files devel
michael@0 120 %defattr(-,root,root,-)
michael@0 121 %{_includedir}
michael@0 122 %{_sdkdir}
michael@0 123 %{_idldir}
michael@0 124 %endif
michael@0 125
michael@0 126
michael@0 127 %if %{?createtests:1}
michael@0 128 %files tests
michael@0 129 %{_datadir}/%{_testsinstalldir}/tests/
michael@0 130 %endif
michael@0 131
michael@0 132 #%changelog
michael@0 133 #* %{name} %{version} %{moz_rpm_release}
michael@0 134 #- Please see %{moz_source_repo}/shortlog/%{moz_source_stamp}

mercurial