6549N/A#
6549N/A# spec file for package SUNWgnome-foo-bar
6549N/A#
6549N/A# includes module(s): gnome-foo, libgnomebar
6549N/A#
8108N/A# Copyright 2006 Sun Microsystems, Inc.
6549N/A# This file and all modifications and additions to the pristine
6549N/A# package are under the same license as the package itself.
6549N/A#
6549N/A
6549N/A############################################################################
6549N/A# The example in this template builds 2 GNOME components, gnome-foo and
6549N/A# libgnomebar and packages them together into a Solaris package called
6549N/A# SUNWgnome-foo-bar that is split by file system boundaries [Solaris rule],
8108N/A# so it has a "subpackage" called SUNWgnome-foo-bar-root.
6549N/A# gnome-foo.spec and libgnomebar.spec are the JDS linux spec files for
6549N/A# the corresponding RPMs.
8108N/A#
9112N/A# See SUNWtemplate-standalone.spec for an example where Linux spec files
9112N/A# are not used
6549N/A############################################################################
6549N/A
6549N/A%include Solaris.inc
6549N/A# The Solaris.inc file sets up some defaults: compiler options,
6549N/A# default locations and extra info needed for building Solaris pkgs.
6549N/A# See the file itself for more details, it's located in this directory.
6549N/A# Note that this line should appear before any %use lines so that
6549N/A# macros in Solaris.inc are used by the %use'd spec files
6549N/A
6549N/A%use gfoo = gnome-foo.spec
6549N/A%use libgnomebar = libgnomebar.spec
6549N/A# Declare that this spec file will use information (tags, scriptlets, etc.)
6549N/A# from another spec file or files. Assign a name (gfoo/libgnomebar) to the
6549N/A# spec file for future reference.
6549N/A# In this case gnome-foo
6549N/A
6549N/AName: SUNWgnome-foo-bar
6549N/A# This is the name (PKG) of the Solaris package.
6549N/A
8108N/ASummary: GNOME foo bar libraries
6549N/A# This will become the one-line description of the Solaris package
6549N/A
8108N/AVersion: %{default_pkg_version}
8108N/A# This is the version of the Solaris package that has little to do with
6549N/A# the version of the gnome components included, since several gnome
6549N/A# components may be packaged together.
8108N/A# In case of non-GNOME components, however, we prefer to use the
8108N/A# tarball version number of the component.
8108N/A# Note: package version numbers must be numeric. Things like 1.0.5beta
8108N/A# and v6b are not allowed
8108N/A# %{default_pkg_version} is defined in Solaris.inc.
6549N/A
6549N/ASUNW_BaseDir: %{_basedir}
6549N/A# The base directory of the Solaris package (normally /usr, / or
6549N/A# /opt/<product>)
6549N/A# You need to define the basedir for each package and subpackage.
6549N/A# For now, the basedir of "-root" packages should be /, everything
6549N/A# else it should be %{_basedir} (defined in Solaris.inc)
6549N/A
13472N/ASUNW_Copyright: %{name}.copyright
13472N/A# Use the copyright-extractor script to create a copyright file.
13472N/A
6549N/ABuildRoot: %{_tmppath}/%{name}-%{version}-build
6549N/A# Same as with linux specs. Note that in this case this will be
6549N/A# /var/tmp/SUNWgnome-foo-bar-2.6.0-build
6549N/A
6549N/A%include default-depend.inc
6549N/A# There's a list of packages that all GNOME packages depend on
6549N/A# These are really just the Solaris core, devices, system libs.
6549N/A# We could include them in all spec files but it's nicer and shorter
6549N/A# to %include them from a common file.
6549N/A
6549N/ARequires: SUNWxwrtl
6549N/ARequires: SUNWxwplt
6549N/ARequires: SUNWlibms
6549N/ARequires: SUNWlxml
6549N/ARequires: SUNWpng
6549N/ARequires: SUNWTiff
6549N/ARequires: SUNWjpg
6549N/A# These are the additional [to the default ones %include'd above]
6549N/A# dependencies of this package. Please don't use version checks in
6549N/A# Solaris dependencies. They are not usually used and not properly
6549N/A# implemented in the build scripts either.
8108N/A# Try to identify the dependencies of the package the best you can.
8108N/A# Missing dependencies may cause broken installs, but unnecessary deps
8108N/A# are a pain too.
6549N/A
8108N/ABuildRequires: SUNWsfwhea
8108N/A# These lines define what package need to be installed at build time.
8108N/A
8108N/A%package root
8108N/ASummary: %{summary} - / filesystem
8108N/ASUNW_BaseDir: /
6549N/A%include default-depend.inc
8108N/A# This defines the "-root" subpackage, i.e. SUNWgnome-foo-bar-root.
6549N/A# Solaris packages must be split by usual filesystem boundaries, so
8108N/A# root filesystem (e.g. /etc) files must be separated from the rest of
8108N/A# the package. According to Solaris packaging rules, development and
8108N/A# runtime files must also be separated..
6549N/A#
6549N/A# The naming convention used in GNOME is this:
6549N/A#
6549N/A## runtime pkgs:
6549N/A#
8108N/A# SUNWgnome-package-name: the main package, binaries, libs,
8108N/A# files in %{_datadir} needed at runtime
6549N/A# SUNWgnome-package-name-root: /etc, /var stuff
8108N/A#
6549N/A## development pkgs:
6549N/A#
8108N/A# SUNWgnome-package-name-devel: header files, pkgconfig files,
8108N/A# binaries only needed for development,
8108N/A# developer docs, man pages, aclocal
8108N/A# macros, etc.
6549N/A# SUNWgnome-package-name-devel-root: any root files that are only needed
8108N/A# for development (rarely needed)
8108N/A#
8108N/A
8108N/A%if %build_l10n
8108N/A%package l10n
8108N/ASummary: foo - l10n files
8108N/ASUNW_BaseDir: %{_basedir}
8108N/A%include default-depend.inc
8108N/ARequires: %{name}
8108N/A%endif
6549N/A
6549N/A%prep
6549N/Arm -rf %name-%version
6549N/Amkdir %name-%version
6549N/A# start with a clean source directory.
6549N/A
6549N/A%gfoo.prep -d %name-%version
6549N/A# prepare the sources of gnome-foo in the %name-%version subdir.
6549N/A# This will run the %prep section in the gfoo (gnome-foo.spec) spec file
6549N/A# (see %use above).
6549N/A# It will result in something like SUNWgnome-foo-bar-2.6.0/gnome-foo-x.y/
6549N/A
6549N/A%libgnomebar.prep -d %name-%version
6549N/A# The same thing again with libgnomebar.
6549N/A
6549N/A%build
6549N/Aexport CFLAGS="%optflags -I/usr/sfw/include -DANSICPP"
6549N/Aexport RPM_OPT_FLAGS="$CFLAGS"
6549N/Aexport CPPFLAGS="-I/usr/sfw/include"
6549N/Aexport LDFLAGS="-L/usr/sfw/lib -R/usr/sfw/lib"
6549N/Aexport MSGFMT="/usr/bin/msgfmt"
13472N/A# Set any environment variables that may be needed.
6549N/A# Note that the linux spec files usually set CFLAGS to $RPM_OPT_FLAGS
6549N/A# before running configure, so if you want to add something to the
6549N/A# CFLAGS defined in the linux spec file, the above trick will do
6549N/A# (i.e. set RPM_OPT_FLAGS to be the same as the CFLAGS you want)
6549N/A# ((RPM_OPT_FLAGS is normally defined by rpm as %optflags))
6549N/A
6549N/A%gfoo.build -d %name-%version
6549N/A%libgnomebar.build -d %name-%version
6549N/A# run the %build section of the linux spec files after cd'ing into
6549N/A# %name-%version.
6549N/A
6549N/A%install
8108N/A# This section installs the files in what ON/SFW folks would call a
8108N/A# "proto area", which is a directory where files are staged for packaging
8108N/A# In the case of rpm/pkgbuild, we have a separate proto area for each
8108N/A# spec file, called $RPM_BUILD_ROOT.
8108N/Arm -rf $RPM_BUILD_ROOT
8108N/A# start with a clean proto dir
6549N/A%gfoo.install -d %name-%version
6549N/A%libgnomebar.install -d %name-%version
6549N/A
8108N/A#
8108N/A# when not building -l10n packages, remove anything l10n related from
8108N/A# $RPM_BUILD_ROOT
8108N/A#
8108N/A%if %build_l10n
8108N/A%else
8108N/A# REMOVE l10n FILES
8108N/Arm -rf $RPM_BUILD_ROOT%{_datadir}/locale
8108N/Arm -rf $RPM_BUILD_ROOT%{_datadir}/gnome/help/*/[a-z]*
8108N/Arm -rf $RPM_BUILD_ROOT%{_datadir}/omf/*/*-[a-z]*.omf
8108N/A%endif
6549N/A
6549N/A%clean
6549N/Arm -rf $RPM_BUILD_ROOT
8108N/A# remove the build root dir once packaging succeeds
6549N/A
6549N/A%iclass myclass [-f script]
6549N/A%rclass myclass [-f script]
8108N/A# use these to define a class and associate installation and removal class
8108N/A# action scripts. The script can be inline or in an external file identified
8108N/A# by "script". In an external script is used, put it in spec-files/ext-sources
6549N/A
6549N/A%files
8108N/A%defattr (-, root, bin)
6549N/A%dir %attr (0755, root, bin) %{_prefix}
6549N/A%dir %attr (0755, root, bin) %{_bindir}
6549N/A# Make sure you define the Solaris default file attributes for system
6549N/A# directories.
6549N/A%{_bindir}/*
6549N/A%dir %attr (0755, root, bin) %{_libdir}
6549N/A%{_libdir}/lib*.so*
6549N/A%class(myclass) %{_libdir}/foo/bar
8108N/A# This make /usr/lib/foo/bar 'f myclass' type and adds myclass to CLASSES
6549N/A
8108N/A%files root
8108N/A%defattr (-, root, sys)
8108N/A%dir %attr(0755, root, sys) %{_sysconfdir}
8108N/A%{_sysconfig}/gconf/schemas/foo.schemas
8108N/A
8108N/A#
8108N/A# The files included here should match the ones removed in %install
8108N/A#
8108N/A%if %build_l10n
8108N/A%files l10n
6549N/A%defattr (-, root, other)
8108N/A%dir %attr (0755, root, sys) %{_datadir}
6549N/A%{_datadir}/locale
8108N/A%{_datadir}/gnome/help/*/[a-z]*
8108N/A%{_datadir}/omf/*/*-[a-z]*.omf
8108N/A%endif
6549N/A
6549N/A%changelog
8108N/A* Fri Jun 2 2006 - laca@sun.com
8108N/A- update to remove info about -share pkgs and add some more comments
6549N/A* Fri Feb 27 2004 - laszlo.peter@sun.com
6549N/A- add info about %changelog to the template
6549N/A# Although pkgbuild doesn't currently do anything with %changelog, it's
6549N/A# still a good idea to use changelog entries.
6549N/A
6549N/A# To build a Solaris package from this spec file, copy all referenced
6549N/A# spec files and include files to %topdir/SPECS, copy all sources & patches
6549N/A# referenced in this or any of the %use'd spec files to %topdir/SOURCES
6549N/A# and run pkgbuild -ba <this spec file>
8108N/A# Alternatively, run
8108N/A# pkgtool build <spec-file>
6549N/A# in this directory.