OpenPKG CVS Repository
http://cvs.openpkg.org/
Server: cvs.openpkg.org Name: Christoph Schug
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 11-Dec-2002 19:08:12
Branch: HEAD Handle: 2002121118081200
Added files:
openpkg-src/heise rc.heise
Modified files:
openpkg-src/heise heise.spec
Log:
Polished the package and made it fun again. Index data is now to be fetched on
a weekly basis.
BTW I don't see a reason for %update_config_scripts in this package hence I
removed it.
Summary:
RevisionChanges Path
1.23+28 -11 openpkg-src/heise/heise.spec
1.1 +24 -0 openpkg-src/heise/rc.heise
Index: openpkg-src/heise/heise.spec
$ cvs diff -u -r1.22 -r1.23 heise.spec
--- openpkg-src/heise/heise.spec 26 Aug 2002 13:28:08 - 1.22
+++ openpkg-src/heise/heise.spec 11 Dec 2002 18:08:12 - 1.23
@@ -37,18 +37,18 @@
Group:Misc
License: GPL
Version: %{V_vl}
-Release: 20020826
+Release: 20021211
# list of sources
Source0: ftp://ftp.heise.de/pub/ct/register/regpl%{V_vs}.zip
-Source1: ftp://ftp.heise.de/pub/ct/register/register.zip
+Source1: rc.heise
Source2: heise.conf
# build information
Prefix: %{l_prefix}
BuildRoot:%{l_buildroot}
BuildPreReq: OpenPKG, openpkg = 20020206, infozip
-PreReq: OpenPKG, openpkg = 20020206, perl
+PreReq: OpenPKG, openpkg = 20020206, infozip, perl, curl, shtool
AutoReq: no
AutoReqProv: no
@@ -57,32 +57,49 @@
%prep
%setup -T -c
-%update_config_scripts
%{l_prefix}/bin/unzip -x %{SOURCE regpl%{V_vs}.zip}
-%{l_prefix}/bin/unzip -x %{SOURCE register.zip}
%build
( echo #!%{l_prefix}/bin/perl
sed \
-e '1,15d' \
- -e s;~/heise/inhalt.frm;%{l_prefix}/share/heise/inhalt.frm; \
+ -e s;~/heise/inhalt.frm;%{l_prefix}/var/heise/inhalt.frm; \
-e s;^\(\$frmfilefmt = \).*$;\1\%{l_prefix}/etc/heise/heise.conf\\;; \
reg.pl
-# -e s;^\(\$frmfilefmt = \).*$;\1%{l_prefix}/etc/heise/heise.conf; \
) heise
%install
rm -rf $RPM_BUILD_ROOT
%{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/bin
%{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/heise
-%{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/share/heise
-%{l_shtool} install -c -m 755 heise $RPM_BUILD_ROOT%{l_prefix}/bin/
-%{l_shtool} install -c -m 644 INHALT.FRM
$RPM_BUILD_ROOT%{l_prefix}/share/heise/inhalt.frm
-%{l_shtool} install -c -m 644 %{SOURCE heise.conf}
$RPM_BUILD_ROOT%{l_prefix}/etc/heise/
+%{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
+%{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/heise
+%{l_shtool} install -c -m 755 \
+heise \
+$RPM_BUILD_ROOT%{l_prefix}/bin/
+%{l_shtool} install -c -m 644 \
+%{SOURCE heise.conf} \
+$RPM_BUILD_ROOT%{l_prefix}/etc/heise/
+%{l_shtool} install -c -m 755 \
+-e 's;@l_prefix@;%{l_prefix};g' \
+-e 's;@l_musr@;%{l_musr};g' \
+-e 's;@l_mgrp@;%{l_mgrp};g' \
+%{SOURCE rc.heise} \
+$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
%files -f files
%clean
rm -rf $RPM_BUILD_ROOT
+
+%post
+if [ $1 -eq 1 ]; then
+$RPM_INSTALL_PREFIX/etc/rc.d/rc.heise weekly || true
+fi
+
+%preun
+if [ $1 -eq 0 ]; then
+rm -rf $RPM_INSTALL_PREFIX/var/heise/* 2/dev/null || true
+fi
Index: openpkg-src/heise/rc.heise
$ cvs update -p -r1.1 rc.heise
#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
##
## rc.heise -- Run-Commands for heise
##
%config
heise_enable=yes
heise_idx_numfiles=10
heise_idx_complevel=9
heise_url=ftp://ftp.heise.de/pub/ct/register/register.zip;
%weekly -u @l_musr@
opServiceEnabled heise || exit 0
# fetch new index data
( cd @l_prefix@/var/heise \
@l_prefix@/bin/curl -s -o register.zip ${heise_url} \
@l_prefix@/bin/shtool rotate -f \
-n${heise_idx_numfiles} -s0 \
-z${heise_idx_complevel} -o@l_musr@ -g@l_mgrp@ -m644 \
inhalt.frm \
@l_prefix@/bin/unzip -jop register.zip INHALT.FRM inhalt.frm
)