On Wed, 31 May 2006, Mike Kiedrowski wrote:
> Hi,
> Attached is a spec-file template I've been using. Hope it helps.
>
> ~Mike
Definitely. Being fairly unexperienced with RPM spec files, I find it
useful to start with a minimal template and an "easy" package (like the
lynx example I just posted), and then "graduate" to an all-inclusive
template like yours and the kinds of builds that would require it.
Thanks,
Eric
>
>
> -------------- next part --------------
> #
> # spec file for package SUNWfoo
> #
> # Copyright (c) 2004 Sun Microsystems, Inc.
> # This file and all modifications and additions to the pristine
> # package are under the same license as the package itself.
>
> %include Solaris.inc
>
> Name: SUNWfoo
> Summary: foo libraries - This program does foo
> Version: 0.0.0
> Source:
> Patch1:
> SUNW_BaseDir: %{_basedir}
> BuildRoot: %{_tmppath}/%{name}-%{version}-build
> %include default-depend.inc
>
> %package root
> Summary: foo - platform dependent files, / filesystem
> SUNW_BaseDir: /
> %include default-depend.inc
>
> %package share
> Summary: foo - platform independent files
> SUNW_BaseDir: %{_basedir}
> %include default-depend.inc
>
> %package devel
> Summary: foo - developer files
> SUNW_BaseDir: %{_basedir}
> %include default-depend.inc
>
> %package l10n
> Summary: foo - l10n files
> SUNW_BaseDir: %{_basedir}
> %include default-depend.inc
> #
> # SUNWpackage-name: the main package, binaries, libs
> # SUNWpackage-name-root: /etc, /var stuff
> # SUNWpackage-name-share: man pages, help, docs, anything in
> # %{_datadir} needed at runtime
> ## development pkgs:
> #
> # SUNWpackage-name-devel: include files, pkgconfig files,
> # binaries only needed for development
> # SUNWpackage-name-devel-root: any root files that are only needed
> # for development
> # SUNWpackage-name-devel-share: development docs (e.g. gtk-doc),
> # man pages for devel binaries,
> # files in %{_datadir} only needed for
> # development: e.g. aclocal macros.
>
> %prep
> %setup -q -n foo-%version
> %patch1 -p1
>
> %build
> CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
> if test "x$CPUS" = "x" -o $CPUS = 0; then
> CPUS=1
> fi
>
> export CFLAGS="%optflags -I/usr/sfw/include -DANSICPP"
> export RPM_OPT_FLAGS="$CFLAGS"
> export CPPFLAGS="-I/usr/sfw/include"
> export LDFLAGS="-L/usr/sfw/lib -R/usr/sfw/lib"
> export MSGFMT="/usr/bin/msgfmt"
>
> ./configure --prefix=%{_prefix} \
> --bindir=%{_bindir} \
> --sysconfdir=%{_sysconfdir} \
> --includedir=%{_includedir} \
> --mandir=%{_mandir} \
> --libdir=%{_libdir}
>
> make -j$CPUS
>
> %install
> make install DESTDIR=$RPM_BUILD_ROOT
> rm $RPM_BUILD_ROOT%{_libdir}/*.la
>
> %clean
> rm -rf $RPM_BUILD_ROOT
>
> %files
> %defattr (-, root, other)
> %dir %attr (0755, root, bin) %{_bindir}
> %{_bindir}/*
> %dir %attr (0755, root, bin) %{_libdir}
> %{_libdir}/*
>
> %files root
> %attr (0755, root, sys) %dir %{_sysconfdir}
> %defattr (-, root, other)
> %{_sysconfdir}/*
> %defattr (0755, root, sys)
>
> %files share
> %defattr (-, root, other)
> %dir %attr(0755, root, sys) %{_datadir}
> %{_datadir}/*
> %dir %attr(0755, root, bin) %{_mandir}
> %dir %attr(0755, root, bin) %{_mandir}/*
> %{_mandir}/*/*
>
> %files devel
> %defattr (-, root, other)
> %dir %attr (0755, root, bin) %{_includedir}
> %{_includedir}/*
>
> %files l10n
> %defattr (-, root, other)
> %dir %attr (0755, root, sys) %{_datadir}
> %{_datadir}/locale
>
> %changelog
> *
> - Initial spec
>