Home | History | Annotate | Download | only in docs
      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: 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.
     84 # Try to identify the dependencies of the package the best you can.
     85 # Missing dependencies may cause broken installs, but unnecessary deps
     86 # are a pain too.
     87 
     88 BuildRequires: SUNWsfwhea
     89 # These lines define what package need to be installed at build time.
     90 
     91 %package root
     92 Summary:                 %{summary} - / filesystem
     93 SUNW_BaseDir:            /
     94 %include default-depend.inc
     95 # This defines the "-root" subpackage, i.e. SUNWgnome-foo-bar-root.
     96 # Solaris packages must be split by usual filesystem boundaries, so
     97 # root filesystem (e.g. /etc) files must be separated from the rest of
     98 # the package.  According to Solaris packaging rules, development and
     99 # runtime files must also be separated..
    100 #
    101 # The naming convention used in GNOME is this:
    102 #
    103 ## runtime pkgs:
    104 #
    105 # SUNWgnome-package-name:             the main package, binaries, libs,
    106 #                                     files in %{_datadir} needed at runtime
    107 # SUNWgnome-package-name-root:        /etc, /var stuff
    108 #
    109 ## development pkgs:
    110 #
    111 # SUNWgnome-package-name-devel:       header files, pkgconfig files,
    112 #                                     binaries only needed for development,
    113 #                                     developer docs, man pages, aclocal
    114 #                                     macros, etc.
    115 # SUNWgnome-package-name-devel-root:  any root files that are only needed
    116 #                                     for development (rarely needed)
    117 #
    118 
    119 %if %build_l10n
    120 %package l10n
    121 Summary:                 foo - l10n files
    122 SUNW_BaseDir:            %{_basedir}
    123 %include default-depend.inc
    124 Requires:                %{name}
    125 %endif
    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"
    147 # Set any environment variables that may be needed.
    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
    160 # This section installs the files in what ON/SFW folks would call a
    161 # "proto area", which is a directory where files are staged for packaging
    162 # In the case of rpm/pkgbuild, we have a separate proto area for each
    163 # spec file, called $RPM_BUILD_ROOT.
    164 rm -rf $RPM_BUILD_ROOT
    165 # start with a clean proto dir
    166 %gfoo.install -d %name-%version
    167 %libgnomebar.install -d %name-%version
    168 
    169 #
    170 # when not building -l10n packages, remove anything l10n related from
    171 # $RPM_BUILD_ROOT
    172 #
    173 %if %build_l10n
    174 %else
    175 # REMOVE l10n FILES
    176 rm -rf $RPM_BUILD_ROOT%{_datadir}/locale
    177 rm -rf $RPM_BUILD_ROOT%{_datadir}/gnome/help/*/[a-z]*
    178 rm -rf $RPM_BUILD_ROOT%{_datadir}/omf/*/*-[a-z]*.omf
    179 %endif
    180 
    181 %clean
    182 rm -rf $RPM_BUILD_ROOT
    183 # remove the build root dir once packaging succeeds
    184 
    185 %iclass myclass [-f script]
    186 %rclass myclass [-f script]
    187 # use these to define a class and associate installation and removal class
    188 # action scripts.  The script can be inline or in an external file identified
    189 # by "script".  In an external script is used, put it in spec-files/ext-sources
    190 
    191 %files
    192 %defattr (-, root, bin)
    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
    201 # This make /usr/lib/foo/bar 'f myclass' type and adds myclass to CLASSES
    202 
    203 %files root
    204 %defattr (-, root, sys)
    205 %dir %attr(0755, root, sys) %{_sysconfdir}
    206 %{_sysconfig}/gconf/schemas/foo.schemas
    207 
    208 #
    209 # The files included here should match the ones removed in %install
    210 #
    211 %if %build_l10n
    212 %files l10n
    213 %defattr (-, root, other)
    214 %dir %attr (0755, root, sys) %{_datadir}
    215 %{_datadir}/locale
    216 %{_datadir}/gnome/help/*/[a-z]*
    217 %{_datadir}/omf/*/*-[a-z]*.omf
    218 %endif
    219 
    220 %changelog
    221 * Fri Jun  2 2006 - laca@sun.com
    222 - update to remove info about -share pkgs and add some more comments
    223 * Fri Feb 27 2004 - laszlo.peter@sun.com
    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>
    232 # Alternatively, run
    233 #       pkgtool build <spec-file>
    234 # in this directory.
    235