Browse Source

use canonical filenames for patches; use better subshell handling; shorten names of options

Ralf S. Engelschall 22 years ago
parent
commit
6527c9d489
3 changed files with 27 additions and 19 deletions
  1. 0 0
      cvs/cvs.patch.rse
  2. 26 17
      cvs/cvs.spec
  3. 1 2
      cvs/rc.cvs

cvs/cvs.patches.rse → cvs/cvs.patch.rse


+ 26 - 17
cvs/cvs.spec

@@ -40,17 +40,17 @@ Version:      %{V_cvs}
 Release:      20030722
 
 #   package options
-%option       with_fsl                      yes
-%option       with_rse_patches              yes
-%option       with_rse_patch_cvsuser_caller cvs
+%option       with_fsl         yes
+%option       with_rse         yes
+%option       with_rse_cvsuser cvs
 
 #   list of sources
 Source0:      http://www.cvshome.org/files/19/10/cvs-%{V_cvs}.tar.bz2
 Source1:      ftp://riemann.iam.uni-bonn.de/pub/users/roessler/cvslock/cvslock-%{V_cvslock}.tar.gz
-Source2:      cvs.patches.rse
-Source3:      rc.cvs
-Source4:      fsl.cvs
+Source2:      rc.cvs
+Source3:      fsl.cvs
 Patch0:       cvs.patch
+Patch1:       cvs.patch.rse
 
 #   build information
 Prefix:       %{l_prefix}
@@ -82,7 +82,7 @@ AutoReqProv:  no
     and cvslock (an administration tool for manually locking a CVS
     repository area).
 
-%if "%{with_rse_patches}" == "yes"
+%if "%{with_rse}" == "yes"
     This version of CVS has the large set of patches applied from
     Ralf S. Engelschall <rse@engelschall.com> (-DRSE_PATCHES). This
     means that (still undocumented) extra functionality is available.
@@ -91,19 +91,22 @@ AutoReqProv:  no
 %prep
     %setup0 -q -c
     %setup1 -q -T -D -a 1
+
+    #   apply patches
     ( cd cvs-%{V_cvs}
-%if "%{with_rse_patches}" == "yes"
-      cat %{SOURCE cvs.patches.rse} |\
-      sed -e 's;\(#define RSE_PATCH_CVSUSER_CALLER "\)cvs\("\);\1%{with_rse_patch_cvsuser_caller}\2;' |\
+%if "%{with_rse}" == "yes"
+      cat %{PATCH cvs.patch.rse} |\
+      sed -e 's;\(#define RSE_PATCH_CVSUSER_CALLER "\)cvs\("\);\1%{with_rse_cvsuser}\2;' |\
       %{l_patch} -p0
 %endif
-    %patch -p0
-    )
+      %patch -p0
+    ) || exit $?
 
 %build
+    #   configure CVS package
     ( cd cvs-%{V_cvs}
       CC="%{l_cc}" \
-%if "%{with_rse_patches}" == "yes"
+%if "%{with_rse}" == "yes"
       CFLAGS="%{l_cflags -O} -DRSE_PATCHES" \
 %else
       CFLAGS="%{l_cflags -O}" \
@@ -119,17 +122,21 @@ AutoReqProv:  no
           --enable-encryption \
           --enable-server
       %{l_make} %{l_mflags -O}
-    )
+    ) || exit $?
+
+    #   configure CVSlock package
     ( cd cvslock-%{V_cvslock}
       CC="%{l_cc}" \
       CFLAGS="%{l_cflags -O}" \
       ./configure \
           --prefix=%{l_prefix}
       %{l_make} %{l_mflags -O}
-    )
+    ) || exit $?
 
 %install
     rm -rf $RPM_BUILD_ROOT
+
+    #   install CVS package
     ( cd cvs-%{V_cvs}
       %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
       rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/rcs2log
@@ -137,10 +144,12 @@ AutoReqProv:  no
       mv $RPM_BUILD_ROOT%{l_prefix}/share/cvs/contrib/* \
          $RPM_BUILD_ROOT%{l_prefix}/share/cvs/
       rmdir $RPM_BUILD_ROOT%{l_prefix}/share/cvs/contrib
-    )
+    ) || exit $?
+
+    #   install CVSlock package
     ( cd cvslock-%{V_cvslock}
       %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
-    )
+    ) || exit $?
     strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
     %{l_shtool} mkdir -f -p -m 755 \
         $RPM_BUILD_ROOT%{l_prefix}/var/cvs/tmp

+ 1 - 2
cvs/rc.cvs

@@ -40,6 +40,7 @@
 %stop -u @l_susr@
     rcService cvs enable yes || exit 0
     rcService cvs active no  && exit 0
+    @l_prefix@/bin/cvs --version | grep RSE >/dev/null || exit 0
     cvs_pserverd_signal TERM
     rm -f $cvs_pserverd_pidfile 2>/dev/null || true
 
@@ -50,8 +51,6 @@
 
 %daily -u @l_susr@
     rcService cvs enable yes || exit 0
-
-    #   rotate logfile
     shtool rotate -f \
         -n ${cvs_log_numfiles} -s ${cvs_log_minsize} -d \
         -z ${cvs_log_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \