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