~extension-hackers/globalmenu-extension/3.5

« back to all changes in this revision

Viewing changes to toolkit/mozapps/installer/linux/rpm/mozilla.spec

  • Committer: Chris Coulson
  • Date: 2011-08-05 17:37:02 UTC
  • Revision ID: chrisccoulson@ubuntu.com-20110805173702-n11ykbt0tdp5u07q
Refresh build system from FIREFOX_6_0b5_BUILD1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# ***** BEGIN LICENSE BLOCK *****
 
2
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
3
#
 
4
# The contents of this file are subject to the Mozilla Public License Version
 
5
# 1.1 (the "License"); you may not use this file except in compliance with
 
6
# the License. You may obtain a copy of the License at
 
7
# http://www.mozilla.org/MPL/
 
8
#
 
9
# Software distributed under the License is distributed on an "AS IS" basis,
 
10
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 
11
# for the specific language governing rights and limitations under the
 
12
# License.
 
13
#
 
14
# The Original Code is Mozilla Application packaging specific RPM Spec file.
 
15
#
 
16
# The Initial Developer of the Original Code is
 
17
# Mozilla Corporation.
 
18
# Portions created by the Initial Developer are Copyright (C) 2011
 
19
# the Initial Developer. All Rights Reserved.
 
20
#
 
21
# Contributor(s):
 
22
#   John Ford <jhford@mozilla.com>
 
23
#
 
24
# Alternatively, the contents of this file may be used under the terms of
 
25
# either the GNU General Public License Version 2 or later (the "GPL"), or
 
26
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 
27
# in which case the provisions of the GPL or the LGPL are applicable instead
 
28
# of those above. If you wish to allow use of your version of this file only
 
29
# under the terms of either the GPL or the LGPL, and not to allow others to
 
30
# use your version of this file under the terms of the MPL, indicate your
 
31
# decision by deleting the provisions above and replace them with the notice
 
32
# and other provisions required by the GPL or the LGPL. If you do not delete
 
33
# the provisions above, a recipient may use your version of this file under
 
34
# the terms of any one of the MPL, the GPL or the LGPL.
 
35
#
 
36
# ***** END LICENSE BLOCK *****
 
37
 
 
38
%global __jar_repack %{nil}
 
39
 
 
40
#Use a consistent string to refer to the package by
 
41
%define pr_name "%{moz_app_displayname} %{moz_app_version}"
 
42
 
 
43
Name:           %{moz_app_name}
 
44
Version:        %{moz_numeric_app_version}
 
45
Release:        %{?moz_rpm_release:%{moz_rpm_release}}%{?buildid:.%{buildid}}
 
46
Summary:        %{pr_name}
 
47
Group:          Applications/Internet
 
48
License:        MPLv1.1 or GPLv2+ or LGPLv2+
 
49
Vendor:         Mozilla
 
50
URL:            http://www.mozilla.org/projects/firefox/
 
51
Source0:        %{name}.desktop
 
52
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
53
 
 
54
#AutoProv:       no
 
55
 
 
56
BuildRequires:  desktop-file-utils
 
57
 
 
58
 
 
59
%description
 
60
%{pr_name}.  This package was built from 
 
61
%{moz_source_repo}/rev/%{moz_source_stamp}
 
62
 
 
63
#We only want a subpackage for the SDK if the required
 
64
#files were generated.  Like the tests subpackage, we
 
65
#probably only need to conditionaly define the %files
 
66
#section.
 
67
%if %{?createdevel:1}
 
68
%package devel
 
69
Summary:    %{pr_name} SDK
 
70
Group:      Development/Libraries
 
71
requires:   %{name} = %{version}-%{release}
 
72
%description devel
 
73
%{pr_name} SDK libraries, headers and interface descriptions
 
74
%endif
 
75
 
 
76
%if %{?createtests:1}
 
77
%package tests
 
78
Summary:    %{pr_name} tests
 
79
Group:      Developement/Libraries
 
80
requires:   %{name} = %{version}-%{release}
 
81
%description tests
 
82
%{pr_name} test harness files and test cases
 
83
%endif
 
84
 
 
85
%prep
 
86
echo No-op prep
 
87
 
 
88
 
 
89
%build
 
90
echo No-op build
 
91
 
 
92
 
 
93
%install
 
94
rm -rf $RPM_BUILD_ROOT
 
95
make install DESTDIR=$RPM_BUILD_ROOT
 
96
desktop-file-validate %{SOURCE0}
 
97
desktop-file-install --vendor mozilla \
 
98
    --dir $RPM_BUILD_ROOT%{_datadir}/applications \
 
99
    %{SOURCE0}
 
100
#In order to make branding work in a generic way, We find
 
101
#all the icons that are likely to be used for desktop files
 
102
#and install them appropriately
 
103
find %{moz_branding_directory} -name "default*.png" | tee icons.list
 
104
for i in $(cat icons.list) ; do
 
105
    size=$(echo $i | sed "s/.*default\([0-9]*\).png$/\1/")
 
106
    icondir=$RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/${size}x${size}/apps/
 
107
    mkdir -p $icondir
 
108
    cp -a $i ${icondir}%{name}.png
 
109
done
 
110
rm icons.list #cleanup
 
111
 
 
112
%if %{?createtests:1}
 
113
#wastefully creates a zip file, but ensures that we stage all test suites
 
114
make package-tests
 
115
testdir=$RPM_BUILD_ROOT/%{_datadir}/%{_testsinstalldir}/tests
 
116
mkdir -p $testdir
 
117
cp -a dist/test-package-stage/* $testdir/
 
118
%endif
 
119
 
 
120
%clean
 
121
rm -rf $RPM_BUILD_ROOT
 
122
 
 
123
 
 
124
%post
 
125
#this is needed to get gnome-panel to update the icons
 
126
update-desktop-database &> /dev/null || :
 
127
touch --no-create %{_datadir}/icons/hicolor || :
 
128
if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
 
129
    %{_bindir}/gtk-update-icon-cache --quiet ${_datadir}/icons/hicolor &> /dev/null || :
 
130
fi
 
131
 
 
132
 
 
133
%postun
 
134
#this is needed to get gnome-panel to update the icons
 
135
update-desktop-database &> /dev/null || :
 
136
touch --no-create %{_datadir}/icons/hicolor || :
 
137
if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
 
138
    %{_bindir}/gtk-update-icon-cache --quiet ${_datadir}/icons/hicolor &> /dev/null || :
 
139
fi
 
140
 
 
141
 
 
142
%files
 
143
%defattr(-,root,root,-)
 
144
%{_installdir}
 
145
%{_bindir}
 
146
%{_datadir}/applications/
 
147
%{_datadir}/icons/
 
148
%doc
 
149
 
 
150
 
 
151
%if %{?createdevel:1}
 
152
%files devel
 
153
%defattr(-,root,root,-)
 
154
%{_includedir}
 
155
%{_sdkdir}
 
156
%{_idldir}
 
157
%endif
 
158
 
 
159
 
 
160
%if %{?createtests:1}
 
161
%files tests
 
162
%{_datadir}/%{_testsinstalldir}/tests/
 
163
%endif
 
164
 
 
165
#%changelog
 
166
#* %{name} %{version} %{moz_rpm_release}
 
167
#- Please see %{moz_source_repo}/shortlog/%{moz_source_stamp}