[desktop-discuss] irssi.spec
Laszlo (Laca) Peter
Laszlo.Peter at Sun.COM
Fri Jul 14 09:18:38 PDT 2006
Yay!
Some comments inline.
On Fri, 2006-07-14 at 10:29 -0500, Eric Boutilier wrote:
> For review/comment, here's a spec file for the irssi IRC client.
>
> Q: What's the recommended way to include irssi's one sysconfdir
> file: /etc/irssi.conf? (For now, I just omitted it.)
>
> --Eric
>
> #
> # spec file for package SFEirssi
> #
> # Copyright (c) 2006 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: SFEirssi
> Summary: irssi - a terminal based IRC client
> Version: 0.8.10a
Please don't use numbers only in package version numbers.
In this case you could use 0.8.10 or if you think the 'a' is
important, use 0.8.10.1 instead.
What we usually do is:
%define tarball_version 0.8.10a
and then:
> Source: http://www.irssi.org/files/irssi-0.8.10a.tar.gz
Source: http://www.irssi.org/files/irssi-%{tarball_version}.tar.gz
> # Use -p1 unified diffs (see man patch)
> # Patch1:
>
> SUNW_BaseDir: %{_basedir}
> BuildRoot: %{_tmppath}/%{name}-%{version}-build
>
> %include default-depend.inc
>
> %define perl_archlib /usr/perl5/vendor_perl/5.8.4/i86pc-solaris-64int
If it uses perl, you will probably need to add SUNWperl584usr as a
dependency
> %prep
> %setup -q -n irssi-0.8.10
> # Normally would be:
> # %setup -q -n foo-%version
> # but had to over-ride to accommodate missing "a" from version number
Right. If you use Version: 0.8.10, you can use %version here.
If it had 0.8.10a in the directory name, you would use %tarball_version
here.
> # %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"
> export RPM_OPT_FLAGS="$CFLAGS"
^^^ this one is not used later in the spec file, so probably not needed.
> export LDFLAGS="%{_ldflags}"
> export MSGFMT="/usr/bin/msgfmt"
Neither is this. It's kind of a historic c&p that people put in each
spec file because they saw it somewhere and didn't know if it was needed
(;
> ./configure --prefix=%{_prefix} \
> --bindir=%{_bindir} \
> --sysconfdir=%{_sysconfdir} \
> --includedir=%{_includedir} \
> --mandir=%{_mandir} \
> --libdir=%{_libdir} \
> --with-perl=module \
> --with-perl-lib=/usr/perl5/vendor_perl/5.8.4/
>
> make -j$CPUS
>
> %install
add
rm -rf $RPM_BUILD_ROOT
here, so that you always start with a clean proto area
> make install DESTDIR=$RPM_BUILD_ROOT
> rm -f ${RPM_BUILD_ROOT}%{_libdir}/irssi/modules/*.la \
> ${RPM_BUILD_ROOT}%{perl_archlib}/auto/Irssi/.packlist \
> ${RPM_BUILD_ROOT}%{perl_archlib}/auto/Irssi/*/.packlist \
> ${RPM_BUILD_ROOT}%{perl_archlib}/perllocal.pod \
> ${RPM_BUILD_ROOT}/etc/irssi.conf
> rm -rf ${RPM_BUILD_ROOT}%{_docdir} \
> ${RPM_BUILD_ROOT}%{_includedir}
> rmdir $RPM_BUILD_ROOT/etc
>
> %clean
> rm -rf $RPM_BUILD_ROOT
>
> # The following shorthand seems to work, so it's tempting to
> # use, but is it too scanty?
>
> # %files
> # %defattr (-, root, bin)
> # %{_bindir}/*
> # %{_libdir}/irssi/
> # %{perl_archlib}
> # %{_datadir}/irssi/
> # %{_mandir}
>
> # Here's the "longhand" version:
I would probably go for something in between (;
> %files
> %defattr (-, root, bin)
> %dir %attr (0755, root, bin) %{_bindir}
> %{_bindir}/*
> %dir %attr (0755, root, bin) %{_libdir}/irssi
> %dir %attr (0755, root, bin) %{_libdir}/irssi/modules
> %{_libdir}/irssi/modules/*
> %{perl_archlib}/Irssi.pm
> %dir %attr (0755, root, bin) %{perl_archlib}/Irssi
> %{perl_archlib}/Irssi/*
> %dir %attr (0755, root, bin) %{perl_archlib}/auto/Irssi
> %{perl_archlib}/auto/Irssi/Irssi.bs
> %{perl_archlib}/auto/Irssi/Irssi.so
> %dir %attr (0755, root, bin) %{perl_archlib}/auto/Irssi/Irc
> %{perl_archlib}/auto/Irssi/Irc/*
> %dir %attr (0755, root, bin) %{perl_archlib}/auto/Irssi/TextUI
> %{perl_archlib}/auto/Irssi/TextUI/*
> %dir %attr (0755, root, bin) %{perl_archlib}/auto/Irssi/UI
> %{perl_archlib}/auto/Irssi/UI/*
> %dir %attr (0755, root, other) %{_datadir}/irssi
> %dir %attr(0755, root, bin) %{_datadir}/irssi/*
> %{_datadir}/irssi/*/*
> %dir %attr(0755, root, bin) %{_mandir}
> %dir %attr(0755, root, bin) %{_mandir}/*
> %{_mandir}/*/*
> #%{_sysconfdir}/irssi.conf
> # In order to include /etc/irssi.conf, is a root
> # package required (which in this case would contain one file)?
Like others already said, yes, / files must be packaged separately
according to Solaris pkging rules.
> %changelog
> *
* Fri Jul 14 2006 - <your_name_or_email_here>
> - Initial spec
Thanks,
Laca
More information about the desktop-discuss
mailing list