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