9112N/A#
9112N/A# spec file for package SUNWfoo
9112N/A#
9112N/A# Copyright 2006 Sun Microsystems, Inc.
9112N/A# This file and all modifications and additions to the pristine
9112N/A# package are under the same license as the package itself.
9112N/A
9112N/A####################################################################
9112N/A# This is a simple example where we don't use Linux spec files
9112N/A# For a template of a typical JDS package, where we can build
9112N/A# the same stuff on Linux and Solaris, see SUNWtemplate.spec
9112N/A####################################################################
9112N/A
9112N/A%include Solaris.inc
9112N/A
9112N/AName: SUNWfoo
9112N/ASummary: foo libraries - This program does foo
9112N/A# use the version number of the community package if possible, but
9112N/A# don't include non-numerics, like 6.2b or 1.5.1alpha
9112N/AVersion: 0.0.0
9112N/A# make sure the Source is a url that actually works
9112N/ASource:
9112N/A# Use -p1 unified diffs (see man patch)
9112N/APatch1:
9112N/ASUNW_BaseDir: %{_basedir}
13472N/ASUNW_Copyright: %{name}.copyright
13472N/A# Use the copyright-extractor script to create a copyright file.
9112N/ABuildRoot: %{_tmppath}/%{name}-%{version}-build
9112N/A%include default-depend.inc
9112N/A# add build and runtime dependencies here:
9112N/ABuildRequires: SUNWbar-devel
9112N/ARequires: SUNWbar
9112N/A# the base pkg should depend on the -root subpkg, if there is one:
9112N/ARequires: %{name}-root
9112N/A
9112N/A%package root
9112N/ASummary: %{summary} - / filesystem
9112N/ASUNW_BaseDir: /
9112N/A%include default-depend.inc
9112N/A
9112N/A#Please DON'T create share pkgs, we stopped using them in JDS4
9112N/A#%package share (delete me)
9112N/A
9112N/A%package devel
9112N/ASummary: %{summary} - development files
9112N/ASUNW_BaseDir: %{_basedir}
9112N/ARequires: %{name} = %{version}
9112N/A%include default-depend.inc
9112N/A
9112N/A%if %build_l10n
9112N/A%package l10n
9112N/ASummary: foo - l10n files
9112N/ASUNW_BaseDir: %{_basedir}
9112N/A%include default-depend.inc
9112N/ARequires: %{name}
9112N/A%endif
9112N/A
9112N/A#
9112N/A## runtime pkgs:
9112N/A#
9112N/A# SUNWpackage-name: the main package, binaries, libs,
9112N/A# file in %{_datadir} needed at runtime
9112N/A# SUNWpackage-name-root: /etc, /var stuff
9112N/A#
9112N/A## development pkgs:
9112N/A#
9112N/A# SUNWpackage-name-devel: include files, pkgconfig files,
9112N/A# files in %{_datadir}, like aclocal
9112N/A# macros and gtk-docs and
9112N/A# binaries only needed for development
9112N/A# SUNWpackage-name-devel-root: any root files that are only needed
9112N/A# for development
9112N/A
9112N/A
9112N/A%prep
9112N/A%setup -q -n foo-%version
9112N/A%patch1 -p1
9112N/A
9112N/A%build
9112N/ACPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
9112N/Aif test "x$CPUS" = "x" -o $CPUS = 0; then
9112N/A CPUS=1
9112N/Afi
9112N/A
9112N/Aexport CFLAGS="%optflags"
9112N/Aexport RPM_OPT_FLAGS="$CFLAGS"
9112N/Aexport LDFLAGS="%{_ldflags}"
9112N/Aexport MSGFMT="/usr/bin/msgfmt"
9112N/A
9112N/A./configure --prefix=%{_prefix} \
9112N/A --bindir=%{_bindir} \
9112N/A --sysconfdir=%{_sysconfdir} \
9112N/A --includedir=%{_includedir} \
9112N/A --mandir=%{_mandir} \
9112N/A --libdir=%{_libdir}
9112N/A
9112N/Amake -j$CPUS
9112N/A
9112N/A%install
9112N/Amake install DESTDIR=$RPM_BUILD_ROOT
9112N/Arm $RPM_BUILD_ROOT%{_libdir}/*.la
9112N/A
9112N/A#
9112N/A# when not building -l10n packages, remove anything l10n related from
9112N/A# $RPM_BUILD_ROOT
9112N/A#
9112N/A%if %build_l10n
9112N/A%else
9112N/A# REMOVE l10n FILES
9112N/Arm -rf $RPM_BUILD_ROOT%{_datadir}/locale
9112N/Arm -rf $RPM_BUILD_ROOT%{_datadir}/gnome/help/*/[a-z]*
9112N/Arm -rf $RPM_BUILD_ROOT%{_datadir}/omf/*/*-[a-z]*.omf
9112N/A%endif
9112N/A
9112N/A%clean
9112N/Arm -rf $RPM_BUILD_ROOT
9112N/A
9112N/A%files
9112N/A%defattr (-, root, bin)
9112N/A%dir %attr (0755, root, bin) %{_bindir}
9112N/A%{_bindir}/*
9112N/A%dir %attr (0755, root, bin) %{_libdir}
9112N/A%{_libdir}/*
9112N/A%dir %attr(0755, root, sys) %{_datadir}
9112N/A%dir %attr (0755, root, other) %{_datadir}/pixmaps
9112N/A%{_datadir}/pixmaps/*
9112N/A%{_datadir}/foo
9112N/A%dir %attr(0755, root, bin) %{_mandir}
9112N/A%dir %attr(0755, root, bin) %{_mandir}/*
9112N/A%{_mandir}/*/*
9112N/A
9112N/A%files root
9112N/A%defattr (0755, root, sys)
9112N/A%attr (0755, root, sys) %dir %{_sysconfdir}
9112N/A%{_sysconfdir}/*
9112N/A
9112N/A%files devel
9112N/A%defattr (-, root, bin)
9112N/A%dir %attr (0755, root, bin) %{_includedir}
9112N/A%{_includedir}/*
9112N/A%dir %attr (0755, root, other) %{_libdir}/pkgconfig
9112N/A%{_libdir}/pkgconfig/*
9112N/A
9112N/A#
9112N/A# The files included here should match the ones removed in %install
9112N/A#
9112N/A%if %build_l10n
9112N/A%files l10n
9112N/A%defattr (-, root, other)
9112N/A%dir %attr (0755, root, sys) %{_datadir}
9112N/A%{_datadir}/locale
9112N/A%{_datadir}/gnome/help/*/[a-z]*
9112N/A%{_datadir}/omf/*/*-[a-z]*.omf
9112N/A%endif
9112N/A
9112N/A%changelog
9112N/A* Fri Jun 2 2006 - laca@sun.com
9112N/A- Initial spec