I suppose we should publish a few templates e.g. a basic one, a meta one (with 
multiple sub modules e.g. SUNWgnome-base-libs.spec) and one with pre/post 
install or class action scripts.

Here's a stab at a basic one, based on one that I happened to be using for 
testing the other day.

#
# A possible template spec file.
#
%include Solaris.inc

Name:         SUNWname
Summary:     A summary
Version:      1.0
Source:       http://www.somewhere.com/download/name-%{version}.tar.bz2
SUNW_BaseDir: %{_basedir}
BuildRoot:    %{_tmppath}/%{name}-%{version}-build
%include default-depend.inc


%prep
%setup -q -n %name-%version

%build
# Determine how many CPUs on the system.
CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
if test "x$CPUS" = "x" -o $CPUS = 0; then
    CPUS=1
fi
./configure --prefix=%{_prefix} --libdir=%{_libdir} --mandir=%{_mandir}
make -j$CPUS  # Tell make to use $CPUS threads.

%install
make install DESTDIR=$RPM_BUILD_ROOT

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr (-, root, other)
# This is the hard part...
%dir %attr (0755, root, bin) %{_bindir}
%{_bindir}/*

%changelog
 
 
This message posted from opensolaris.org

Reply via email to