SUNWtemplate.spec revision 6549
10139N/A#
10139N/A# spec file for package SUNWgnome-foo-bar
10139N/A#
12251N/A# includes module(s): gnome-foo, libgnomebar
10139N/A#
10139N/A# Copyright (c) 2004 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
11195N/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
13919N/A# SUNWgnome-foo-bar that is split by file system boundaries [Solaris rule],
10139N/A# so it has a "subpackage" called SUNWgnome-foo-bar-share.
10139N/A# gnome-foo.spec and libgnomebar.spec are the JDS linux spec files for
10139N/A# the corresponding RPMs.
10139N/A############################################################################
13276N/A
10142N/A%include Solaris.inc
12570N/A# The Solaris.inc file sets up some defaults: compiler options,
12773N/A# default locations and extra info needed for building Solaris pkgs.
12773N/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
10139N/A# macros in Solaris.inc are used by the %use'd spec files
11195N/A
10529N/A%use gfoo = gnome-foo.spec
12248N/A%use libgnomebar = libgnomebar.spec
10139N/A# Declare that this spec file will use information (tags, scriptlets, etc.)
12248N/A# from another spec file or files. Assign a name (gfoo/libgnomebar) to the
10139N/A# spec file for future reference.
12248N/A# In this case gnome-foo
12570N/A
13276N/AName: SUNWgnome-foo-bar
13551N/A# This is the name (PKG) of the Solaris package.
13551N/A
10139N/ASummary: GNOME foo bar libraries - platform dependent files, /usr filesystem
10139N/A# This will become the one-line description of the Solaris package
10139N/A
10139N/AVersion: 2.6.0
10139N/A# This is the version of the Solaris package that has nothing to do with
10139N/A# the version of the gnome components included, since several gnome
10139N/A# components may be packaged together.
10139N/A
10139N/ASUNW_BaseDir: %{_basedir}
10139N/A# The base directory of the Solaris package (normally /usr, / or
10139N/A# /opt/<product>)
10139N/A# You need to define the basedir for each package and subpackage.
10139N/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
10139N/A%include default-depend.inc
10139N/A# There's a list of packages that all GNOME packages depend on
10139N/A# These are really just the Solaris core, devices, system libs.
10139N/A# We could include them in all spec files but it's nicer and shorter
10139N/A# to %include them from a common file.
10139N/A
10139N/ARequires: SUNWgnome-base-libs-root
10139N/ARequires: SUNWgnome-base-libs-share
10139N/ARequires: SUNWxwrtl
10139N/ARequires: SUNWxwplt
10139N/ARequires: SUNWlibms
10139N/ARequires: SUNWlxml
10139N/ARequires: SUNWfreetype2
10139N/ARequires: SUNWlibpopt
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
10139N/A%package share
10139N/ASummary: GNOME foo bar - platform independent files, /usr/share
10139N/ASUNW_BaseDir: %{_basedir}
10139N/A%include default-depend.inc
10139N/A# This defines the "-share" subpackage, i.e. SUNWgnome-foo-bar-share.
10139N/A# Solaris packages must be split by usual filesystem boundaries, so
10139N/A# /usr/share and / (e.g. /etc) files must be separated from the rest of
10139N/A# the package. When it makes sense (e.g. the package is big), development
10139N/A# files are also separated.
10139N/A#
10139N/A# The naming convention used in GNOME is this:
10139N/A#
12728N/A## runtime pkgs:
12728N/A#
12728N/A# SUNWgnome-package-name: the main package, binaries, libs
10139N/A# SUNWgnome-package-name-root: /etc, /var stuff
10142N/A# SUNWgnome-package-name-share: man pages, help, docs, anything in
10139N/A# %{_datadir} needed at runtime
10139N/A## development pkgs:
11195N/A#
12248N/A# SUNWgnome-package-name-devel: include files, pkgconfig files,
10139N/A# binaries only needed for development
10139N/A# SUNWgnome-package-name-devel-root: any root files that are only needed
10139N/A# for development
13551N/A# SUNWgnome-package-name-devel-share: development docs (e.g. gtk-doc),
10139N/A# man pages for devel binaries,
10139N/A# files in %{_datadir} only needed for
10139N/A# development: e.g. aclocal macros.
10139N/A
10139N/A%prep
10139N/Arm -rf %name-%version
10139N/Amkdir %name-%version
10139N/A# start with a clean source directory.
10139N/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
10139N/A%libgnomebar.prep -d %name-%version
10139N/A# The same thing again with libgnomebar.
10139N/A
10139N/A%build
10139N/Aexport CFLAGS="%optflags -I/usr/sfw/include -DANSICPP"
10139N/Aexport RPM_OPT_FLAGS="$CFLAGS"
12773N/Aexport CPPFLAGS="-I/usr/sfw/include"
12773N/Aexport LDFLAGS="-L/usr/sfw/lib -R/usr/sfw/lib"
12773N/Aexport MSGFMT="/usr/bin/msgfmt"
12773N/A# Set any environement variables that may be needed.
12773N/A# Note that the linux spec files usually set CFLAGS to $RPM_OPT_FLAGS
10139N/A# before running configure, so if you want to add something to the
10139N/A# CFLAGS defined in the linux spec file, the above trick will do
10139N/A# (i.e. set RPM_OPT_FLAGS to be the same as the CFLAGS you want)
10139N/A# ((RPM_OPT_FLAGS is normally defined by rpm as %optflags))
10139N/A
10139N/A%gfoo.build -d %name-%version
10139N/A%libgnomebar.build -d %name-%version
10139N/A# run the %build section of the linux spec files after cd'ing into
10139N/A# %name-%version.
10139N/A
10139N/A%install
11271N/A%gfoo.install -d %name-%version
10139N/A%libgnomebar.install -d %name-%version
10139N/A# The same thing with the %install sections.
10139N/A
10139N/A# The rest of this spec file is just the same as the Linux spec files,
10139N/A# so I'm not going to comment on everything.
10139N/A
10139N/A%clean
10139N/Arm -rf $RPM_BUILD_ROOT
10139N/A
10139N/A%iclass myclass [-f script]
10139N/A
10139N/A%rclass myclass [-f script]
10139N/A
10139N/A%files
10139N/A%defattr (-, root, other)
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
10139N/A%files share
10139N/A%defattr (-, root, other)
10139N/A%dir %attr (0755, root, bin) %{_prefix}
10139N/A%dir %attr(0755, root, sys) %{_datadir}
10139N/A%{_datadir}/locale
10139N/A%{_datadir}/gfoo
10139N/A%dir %attr(0755, root, bin) %{_mandir}
10139N/A%dir %attr(0755, root, bin) %{_mandir}/*
10139N/A%{_mandir}/*/*
10139N/A
10139N/A%changelog
10139N/A* Fri Feb 27 2004 - laszlo.peter@sun.com
10139N/A- add info about %changelog to the template
10139N/A
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 ./build-gnome2 build <spec-file>
10139N/A# in this directory.
10139N/A