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