author | yippi |
Fri, 08 Oct 2010 20:33:54 +0000 | |
changeset 20147 | 9bd581afe2ae |
parent 15650 | dbcf7e3715dd |
permissions | -rw-r--r-- |
5807 | 1 |
# |
2 |
# spec file for package SUNWgnome-foo-bar |
|
3 |
# |
|
4 |
# includes module(s): gnome-foo, libgnomebar |
|
5 |
# |
|
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
6 |
# Copyright 2006 Sun Microsystems, Inc. |
5807 | 7 |
# This file and all modifications and additions to the pristine |
8 |
# package are under the same license as the package itself. |
|
9 |
# |
|
10 |
||
11 |
############################################################################ |
|
12 |
# The example in this template builds 2 GNOME components, gnome-foo and |
|
13 |
# libgnomebar and packages them together into a Solaris package called |
|
14 |
# SUNWgnome-foo-bar that is split by file system boundaries [Solaris rule], |
|
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
15 |
# so it has a "subpackage" called SUNWgnome-foo-bar-root. |
5807 | 16 |
# gnome-foo.spec and libgnomebar.spec are the JDS linux spec files for |
17 |
# the corresponding RPMs. |
|
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
18 |
# |
8370 | 19 |
# See SUNWtemplate-standalone.spec for an example where Linux spec files |
20 |
# are not used |
|
5807 | 21 |
############################################################################ |
22 |
||
23 |
%include Solaris.inc |
|
24 |
# The Solaris.inc file sets up some defaults: compiler options, |
|
25 |
# default locations and extra info needed for building Solaris pkgs. |
|
26 |
# See the file itself for more details, it's located in this directory. |
|
27 |
# Note that this line should appear before any %use lines so that |
|
28 |
# macros in Solaris.inc are used by the %use'd spec files |
|
29 |
||
30 |
%use gfoo = gnome-foo.spec |
|
31 |
%use libgnomebar = libgnomebar.spec |
|
32 |
# Declare that this spec file will use information (tags, scriptlets, etc.) |
|
33 |
# from another spec file or files. Assign a name (gfoo/libgnomebar) to the |
|
34 |
# spec file for future reference. |
|
35 |
# In this case gnome-foo |
|
36 |
||
37 |
Name: SUNWgnome-foo-bar |
|
38 |
# This is the name (PKG) of the Solaris package. |
|
39 |
||
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
40 |
Summary: GNOME foo bar libraries |
5807 | 41 |
# This will become the one-line description of the Solaris package |
42 |
||
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
43 |
Version: %{default_pkg_version} |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
44 |
# This is the version of the Solaris package that has little to do with |
5807 | 45 |
# the version of the gnome components included, since several gnome |
46 |
# components may be packaged together. |
|
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
47 |
# In case of non-GNOME components, however, we prefer to use the |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
48 |
# tarball version number of the component. |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
49 |
# Note: package version numbers must be numeric. Things like 1.0.5beta |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
50 |
# and v6b are not allowed |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
51 |
# %{default_pkg_version} is defined in Solaris.inc. |
5807 | 52 |
|
53 |
SUNW_BaseDir: %{_basedir} |
|
54 |
# The base directory of the Solaris package (normally /usr, / or |
|
55 |
# /opt/<product>) |
|
56 |
# You need to define the basedir for each package and subpackage. |
|
57 |
# For now, the basedir of "-root" packages should be /, everything |
|
58 |
# else it should be %{_basedir} (defined in Solaris.inc) |
|
59 |
||
12730 | 60 |
SUNW_Copyright: %{name}.copyright |
61 |
# Use the copyright-extractor script to create a copyright file. |
|
62 |
||
5807 | 63 |
BuildRoot: %{_tmppath}/%{name}-%{version}-build |
64 |
# Same as with linux specs. Note that in this case this will be |
|
65 |
# /var/tmp/SUNWgnome-foo-bar-2.6.0-build |
|
66 |
||
67 |
%include default-depend.inc |
|
68 |
# There's a list of packages that all GNOME packages depend on |
|
69 |
# These are really just the Solaris core, devices, system libs. |
|
70 |
# We could include them in all spec files but it's nicer and shorter |
|
71 |
# to %include them from a common file. |
|
72 |
||
73 |
Requires: SUNWxwrtl |
|
74 |
Requires: SUNWxwplt |
|
75 |
Requires: SUNWlibms |
|
76 |
Requires: SUNWlxml |
|
77 |
Requires: SUNWpng |
|
78 |
Requires: SUNWTiff |
|
79 |
Requires: SUNWjpg |
|
80 |
# These are the additional [to the default ones %include'd above] |
|
81 |
# dependencies of this package. Please don't use version checks in |
|
82 |
# Solaris dependencies. They are not usually used and not properly |
|
83 |
# implemented in the build scripts either. |
|
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
84 |
# Try to identify the dependencies of the package the best you can. |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
85 |
# Missing dependencies may cause broken installs, but unnecessary deps |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
86 |
# are a pain too. |
5807 | 87 |
|
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
88 |
BuildRequires: SUNWsfwhea |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
89 |
# These lines define what package need to be installed at build time. |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
90 |
|
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
91 |
%package root |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
92 |
Summary: %{summary} - / filesystem |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
93 |
SUNW_BaseDir: / |
5807 | 94 |
%include default-depend.inc |
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
95 |
# This defines the "-root" subpackage, i.e. SUNWgnome-foo-bar-root. |
5807 | 96 |
# Solaris packages must be split by usual filesystem boundaries, so |
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
97 |
# root filesystem (e.g. /etc) files must be separated from the rest of |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
98 |
# the package. According to Solaris packaging rules, development and |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
99 |
# runtime files must also be separated.. |
5807 | 100 |
# |
101 |
# The naming convention used in GNOME is this: |
|
102 |
# |
|
103 |
## runtime pkgs: |
|
104 |
# |
|
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
105 |
# SUNWgnome-package-name: the main package, binaries, libs, |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
106 |
# files in %{_datadir} needed at runtime |
5807 | 107 |
# SUNWgnome-package-name-root: /etc, /var stuff |
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
108 |
# |
5807 | 109 |
## development pkgs: |
110 |
# |
|
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
111 |
# SUNWgnome-package-name-devel: header files, pkgconfig files, |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
112 |
# binaries only needed for development, |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
113 |
# developer docs, man pages, aclocal |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
114 |
# macros, etc. |
5807 | 115 |
# SUNWgnome-package-name-devel-root: any root files that are only needed |
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
116 |
# for development (rarely needed) |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
117 |
# |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
118 |
|
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
119 |
%if %build_l10n |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
120 |
%package l10n |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
121 |
Summary: foo - l10n files |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
122 |
SUNW_BaseDir: %{_basedir} |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
123 |
%include default-depend.inc |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
124 |
Requires: %{name} |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
125 |
%endif |
5807 | 126 |
|
127 |
%prep |
|
128 |
rm -rf %name-%version |
|
129 |
mkdir %name-%version |
|
130 |
# start with a clean source directory. |
|
131 |
||
132 |
%gfoo.prep -d %name-%version |
|
133 |
# prepare the sources of gnome-foo in the %name-%version subdir. |
|
134 |
# This will run the %prep section in the gfoo (gnome-foo.spec) spec file |
|
135 |
# (see %use above). |
|
136 |
# It will result in something like SUNWgnome-foo-bar-2.6.0/gnome-foo-x.y/ |
|
137 |
||
138 |
%libgnomebar.prep -d %name-%version |
|
139 |
# The same thing again with libgnomebar. |
|
140 |
||
141 |
%build |
|
142 |
export CFLAGS="%optflags -I/usr/sfw/include -DANSICPP" |
|
143 |
export RPM_OPT_FLAGS="$CFLAGS" |
|
144 |
export CPPFLAGS="-I/usr/sfw/include" |
|
145 |
export LDFLAGS="-L/usr/sfw/lib -R/usr/sfw/lib" |
|
146 |
export MSGFMT="/usr/bin/msgfmt" |
|
12730 | 147 |
# Set any environment variables that may be needed. |
5807 | 148 |
# Note that the linux spec files usually set CFLAGS to $RPM_OPT_FLAGS |
149 |
# before running configure, so if you want to add something to the |
|
150 |
# CFLAGS defined in the linux spec file, the above trick will do |
|
151 |
# (i.e. set RPM_OPT_FLAGS to be the same as the CFLAGS you want) |
|
152 |
# ((RPM_OPT_FLAGS is normally defined by rpm as %optflags)) |
|
153 |
||
154 |
%gfoo.build -d %name-%version |
|
155 |
%libgnomebar.build -d %name-%version |
|
156 |
# run the %build section of the linux spec files after cd'ing into |
|
157 |
# %name-%version. |
|
158 |
||
159 |
%install |
|
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
160 |
# This section installs the files in what ON/SFW folks would call a |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
161 |
# "proto area", which is a directory where files are staged for packaging |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
162 |
# In the case of rpm/pkgbuild, we have a separate proto area for each |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
163 |
# spec file, called $RPM_BUILD_ROOT. |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
164 |
rm -rf $RPM_BUILD_ROOT |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
165 |
# start with a clean proto dir |
5807 | 166 |
%gfoo.install -d %name-%version |
167 |
%libgnomebar.install -d %name-%version |
|
168 |
||
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
169 |
# |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
170 |
# when not building -l10n packages, remove anything l10n related from |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
171 |
# $RPM_BUILD_ROOT |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
172 |
# |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
173 |
%if %build_l10n |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
174 |
%else |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
175 |
# REMOVE l10n FILES |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
176 |
rm -rf $RPM_BUILD_ROOT%{_datadir}/locale |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
177 |
rm -rf $RPM_BUILD_ROOT%{_datadir}/gnome/help/*/[a-z]* |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
178 |
rm -rf $RPM_BUILD_ROOT%{_datadir}/omf/*/*-[a-z]*.omf |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
179 |
%endif |
5807 | 180 |
|
181 |
%clean |
|
182 |
rm -rf $RPM_BUILD_ROOT |
|
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
183 |
# remove the build root dir once packaging succeeds |
5807 | 184 |
|
185 |
%iclass myclass [-f script] |
|
186 |
%rclass myclass [-f script] |
|
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
187 |
# use these to define a class and associate installation and removal class |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
188 |
# action scripts. The script can be inline or in an external file identified |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
189 |
# by "script". In an external script is used, put it in spec-files/ext-sources |
5807 | 190 |
|
191 |
%files |
|
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
192 |
%defattr (-, root, bin) |
5807 | 193 |
%dir %attr (0755, root, bin) %{_prefix} |
194 |
%dir %attr (0755, root, bin) %{_bindir} |
|
195 |
# Make sure you define the Solaris default file attributes for system |
|
196 |
# directories. |
|
197 |
%{_bindir}/* |
|
198 |
%dir %attr (0755, root, bin) %{_libdir} |
|
199 |
%{_libdir}/lib*.so* |
|
200 |
%class(myclass) %{_libdir}/foo/bar |
|
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
201 |
# This make /usr/lib/foo/bar 'f myclass' type and adds myclass to CLASSES |
5807 | 202 |
|
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
203 |
%files root |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
204 |
%defattr (-, root, sys) |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
205 |
%dir %attr(0755, root, sys) %{_sysconfdir} |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
206 |
%{_sysconfig}/gconf/schemas/foo.schemas |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
207 |
|
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
208 |
# |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
209 |
# The files included here should match the ones removed in %install |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
210 |
# |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
211 |
%if %build_l10n |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
212 |
%files l10n |
5807 | 213 |
%defattr (-, root, other) |
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
214 |
%dir %attr (0755, root, sys) %{_datadir} |
5807 | 215 |
%{_datadir}/locale |
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
216 |
%{_datadir}/gnome/help/*/[a-z]* |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
217 |
%{_datadir}/omf/*/*-[a-z]*.omf |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
218 |
%endif |
5807 | 219 |
|
220 |
%changelog |
|
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
221 |
* Fri Jun 2 2006 - [email protected] |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
222 |
- update to remove info about -share pkgs and add some more comments |
5807 | 223 |
* Fri Feb 27 2004 - [email protected] |
224 |
- add info about %changelog to the template |
|
225 |
# Although pkgbuild doesn't currently do anything with %changelog, it's |
|
226 |
# still a good idea to use changelog entries. |
|
227 |
||
228 |
# To build a Solaris package from this spec file, copy all referenced |
|
229 |
# spec files and include files to %topdir/SPECS, copy all sources & patches |
|
230 |
# referenced in this or any of the %use'd spec files to %topdir/SOURCES |
|
231 |
# and run pkgbuild -ba <this spec file> |
|
7366
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
232 |
# Alternatively, run |
105ebbc873b4
2006-06-03 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
5807
diff
changeset
|
233 |
# pkgtool build <spec-file> |
5807 | 234 |
# in this directory. |