[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[leafnode-list] Specfile changes



Package version is set to 2.0 and the snapshot string is appended to the
release string, instead. This is because rpm-4.0.4-7x (Red Hat 7.2)
complains that "-" is illegal in a version string. The release is set to
0 to clarify that it's a beta/pre-release, so the full release string is
"0.20020910a". I'm not sure how to retrofit this back into
leafnode.spec.in.

The rest of these should be easy to put in leafnode.spec.in:

A lockdir is created by the package, owned by news.news, so that
fetchnews can create its lockfile there.

The RPM_BUILD_ROOT is cleaned in the %install step in case a previous
package build attempt failed after this point. (Useful for spec
debugging.)

The suid bits are not needed for fetchnews and texpire.

The %clean phase checks for RPM_BUILD_ROOT to not be "/".

Content-Disposition: inline; filename=leafnode.spec.diff
Content-Type: text/plain; name=leafnode.spec.diff; charset=ISO-8859-1
X-MIME-Autoconverted: from 8bit to quoted-printable by wrzx35.rz.uni-wuerzburg.de id GAA27038

--- ../BUILD/leafnode-2.0-snapshot-20020910a/leafnode.spec	Mon Sep  9 20:25:45 2002
+++ leafnode.spec	Mon Sep  9 20:23:10 2002
@@ -1,24 +1,26 @@
 # DO NOT EDIT!
 # leafnode.spec.  Generated from leafnode.spec.in by configure.
 
-Version: 2.0-snapshot-20020910a
-Summary: Leafnode - a leafsite NNTP server (Version %version)
-Summary(de): Leafnode - ein offline-Newsserver (Version %version)
+%define snapshot 20020910a
+Version: 2.0
+Summary: Leafnode - a leafsite NNTP server (Version %version-snapshot-%snapshot)
+Summary(de): Leafnode - ein offline-Newsserver (Version %version-snapshot-%snapshot)
 Name: leafnode
-Release: 1
+Release: 0.1.%snapshot
 Copyright: see COPYING
 Group: Applications/News
-Source: http://mandree.home.pages.de/leafnode/beta/leafnode-%version.tarbz2
+Source: http://mandree.home.pages.de/leafnode/beta/leafnode-%version-snapshot-%snapshot.tar.bz2
 
 %define prefix      /usr
 %define spooldir    /var/spool/news
 %define confdir     /etc/leafnode
-%define lockfile    /var/lock/fetchnews.lck
+%define lockdir     /var/lock/news
+%define lockfile    %{lockdir}/fetchnews.lck
 %define runas_user  news
 %define runas_group news
 
 # Distribution: ${DISTRIBUTION}
-Buildroot: /var/tmp/leafnode-%version-buildroot/
+Buildroot: /var/tmp/leafnode-%version-%snapshot-buildroot/
 Packager: Matthias Andree <matthias.andree@xxxxxx>
 %description
 Leafnode is a small NNTP server for leaf sites without permanent
@@ -33,7 +35,7 @@
 regelmäßig lesen, vom Newsserver des Providers.
 
 %prep
-%setup
+%setup -n leafnode-%version-snapshot-%snapshot
 CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%prefix --mandir=%_mandir \
  --with-spooldir=%spooldir\
  --sysconfdir=%confdir --with-lockfile=%lockfile \
@@ -43,18 +45,22 @@
 make
 
 %install
+# first clean out any prior aborted runs
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
 make  DESTDIR=$RPM_BUILD_ROOT install-strip
 
 %files
-%defattr(644,root,root)
+%defattr(-,root,root)
 %attr(640,root,root) %confdir/config.example
 %attr(755,root,root) %{prefix}/bin/newsq
 %attr(750,root,root) %{prefix}/sbin/applyfilter
 %attr(750,root,root) %{prefix}/sbin/checkgroups
 %attr(750,root,root) %{prefix}/sbin/leafnode
 %attr(750,root,root) %{prefix}/sbin/rnews
-%attr(4750,%{runas_user},%{runas_group}) %{prefix}/sbin/fetchnews
-%attr(4750,%{runas_user},%{runas_group}) %{prefix}/sbin/texpire
+# create lockdir that fetchnews can write to
+%attr(775,%{runas_user},%{runas_group}) %{lockdir}
+%attr(755,%{runas_user},%{runas_group}) %{prefix}/sbin/fetchnews
+%attr(755,%{runas_user},%{runas_group}) %{prefix}/sbin/texpire
 %doc %_mandir/man1/*
 %doc %_mandir/man5/*
 %doc %_mandir/man8/*
@@ -64,4 +70,5 @@
 %attr(2755,%{runas_user},%{runas_group}) %spooldir
 
 %clean
-rm -rf $RPM_BUILD_ROOT
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+