OpenPKG CVS Repository http://cvs.openpkg.org/ ____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-src Date: 17-Feb-2005 18:00:07 Branch: HEAD Handle: 2005021717000700 Modified files: openpkg-src/boa boa.spec Log: add %post and %preun sections plus a few comments Summary: Revision Changes Path 1.9 +28 -2 openpkg-src/boa/boa.spec ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-src/boa/boa.spec ============================================================================ $ cvs diff -u -r1.8 -r1.9 boa.spec --- openpkg-src/boa/boa.spec 17 Feb 2005 16:46:58 -0000 1.8 +++ openpkg-src/boa/boa.spec 17 Feb 2005 17:00:07 -0000 1.9 @@ -70,13 +70,14 @@ %prep %setup -q %patch -p0 - -%build %{l_shtool} subst \ -e 's;/etc/boa;%{l_prefix}/etc/boa;' \ -e 's;/etc/mime.types;%{l_prefix}/etc/boa/mime.types;' \ -e 's;/bin:/usr/bin:/usr/local/bin;/bin:/usr/bin:%{l_prefix}/bin;' \ src/defines.h + +%build + # build program CC="%{l_cc}" \ CFLAGS="%{l_cflags -O}" \ CPPFLAGS="%{l_cppflags}" \ @@ -87,6 +88,7 @@ %{l_make} %{l_mflags -O} %install + # create installation hierarchy rm -rf $RPM_BUILD_ROOT %{l_shtool} mkdir -f -p -m 755 \ $RPM_BUILD_ROOT%{l_prefix}/sbin \ @@ -95,18 +97,28 @@ $RPM_BUILD_ROOT%{l_prefix}/etc/boa \ $RPM_BUILD_ROOT%{l_prefix}/libexec/boa \ $RPM_BUILD_ROOT%{l_prefix}/var/boa + + # install program %{l_shtool} install -c -s -m 755 \ src/boa $RPM_BUILD_ROOT%{l_prefix}/sbin/ %{l_shtool} install -c -s -m 755 \ src/boa_indexer $RPM_BUILD_ROOT%{l_prefix}/libexec/boa/ + + # install manual page %{l_shtool} install -c -m 644 \ docs/boa.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/ + + # install default configuration %{l_shtool} install -c -m 644 %{l_value -s -a} \ %{SOURCE boa.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/boa/ %{l_shtool} install -c -m 644 \ %{SOURCE boa.mime} $RPM_BUILD_ROOT%{l_prefix}/etc/boa/mime.types + + # install run-command script %{l_shtool} install -c -m 755 %{l_value -s -a} \ %{SOURCE rc.boa} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ + + # determine installation files %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ %{l_files_std} \ '%config %{l_prefix}/etc/boa/*' \ @@ -117,3 +129,17 @@ %clean rm -rf $RPM_BUILD_ROOT +%post + # after upgrade, restart service + [ $1 -eq 2 ] || exit 0 + eval `%{l_rc} boa status 2>/dev/null` + [ ".$boa_active" = .yes ] && %{l_rc} boa restart + exit 0 + +%preun + # before erase, stop service and remove log files + [ $1 -eq 0 ] || exit 0 + %{l_rc} boa stop 2>/dev/null + rm -rf $RPM_INSTALL_PREFIX/var/boa/* >/dev/null 2>&1 || true + exit 0 + @@ . ______________________________________________________________________ The OpenPKG Project www.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org