Parcourir la source

add fsl support; at least, apply the template

Thomas Lotterer il y a 22 ans
Parent
commit
1e1dcfa877
3 fichiers modifiés avec 83 ajouts et 12 suppressions
  1. 16 0
      tripwire/fsl.tripwire
  2. 24 0
      tripwire/rc.tripwire
  3. 43 12
      tripwire/tripwire.spec

+ 16 - 0
tripwire/fsl.tripwire

@@ -0,0 +1,16 @@
+##
+##  fsl.tripwire -- OSSP fsl configuration
+##
+
+ident (tripwire)/.+ q{
+    prefix(
+        prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
+    )
+    -> {
+        debug: file(
+            path="@l_prefix@/var/tripwire/tripwire.log",
+            append=1, perm=0644
+        )
+    }
+};
+

+ 24 - 0
tripwire/rc.tripwire

@@ -0,0 +1,24 @@
+#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
+##
+##  rc.tripwire -- Run-Commands
+##
+
+%config
+    tripwire_enable="yes"
+    tripwire_log_prolog="true"
+    tripwire_log_epilog="true"
+    tripwire_log_numfiles="10"
+    tripwire_log_minsize="1M"
+    tripwire_log_complevel="9"
+
+%daily -u @l_susr@
+    opServiceEnabled tripwire || exit 0
+
+    #   rotate logfile
+    shtool rotate -f \
+        -n${tripwire_log_numfiles} -s${tripwire_log_minsize} -d \
+        -z${tripwire_log_complevel} -o@l_rusr@ -g@l_rgrp@ -m644 \
+        -P "${tripwire_log_prolog}" \
+        -E "${tripwire_log_epilog}" \
+        @l_prefix@/var/tripwire/tripwire.log
+

+ 43 - 12
tripwire/tripwire.spec

@@ -23,6 +23,8 @@
 ##  SUCH DAMAGE.
 ##
 
+#   FIXME: thl fsl does not make it into the binary
+
 #   package versions
 %define       V_tripwire 2.3.1
 %define       V_lvl      2
@@ -39,20 +41,29 @@ Distribution: OpenPKG [EVAL]
 Group:        Security
 License:      GPL
 Version:      %{V_openpkg}
-Release:      20030707
+Release:      20030708
+
+#   package options
+%option       with_fsl  yes
 
 #   list of sources
 Source0:      http://osdn.dl.sourceforge.net/sourceforge/tripwire/tripwire-%{V_vendor}.tar.gz
 Source1:      tw.cfg
 Source2:      sparc-solaris.inc
 Source3:      sparc-solaris.mak
+Source4:      rc.tripwire
+Source5:      fsl.tripwire
 Patch0:       tripwire.patch
 
 #   build information
 Prefix:       %{l_prefix}
 BuildRoot:    %{l_buildroot}
-BuildPreReq:  OpenPKG, openpkg >= 20030114, make, gcc, perl
-PreReq:       OpenPKG, openpkg >= 20030114
+BuildPreReq:  OpenPKG, openpkg >= 20030415, make, gcc, perl
+PreReq:       OpenPKG, openpkg >= 20030415
+%if "%{with_fsl}" == "yes"
+BuildPreReq:  fsl
+PreReq:       fsl
+%endif
 AutoReq:      no
 AutoReqProv:  no
 
@@ -102,25 +113,23 @@ AutoReqProv:  no
     %{l_make} %{l_mflags -O} release \
         CC="%{l_cc}" \
         CFLAGS="%{l_cflags -O}" \
+        LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
+        LIBS="%{l_fsl_libs}" \
         CXX="%{l_cxx}" \
         CXXFLAGS="%{l_cxxflags -O} -fpermissive" \
         CPPFLAGS="%{l_cppflags}" \
-        LDFLAGS="%{l_ldflags}" \
         GMAKE="%{l_make}" \
         SYSPRE="$syspre" \
         STLPORT="No-STLPort"
 
 %install
     rm -rf $RPM_BUILD_ROOT
-    %{l_shtool} mkdir -p -m 755 \
-        $RPM_BUILD_ROOT%{l_prefix}/bin
-    %{l_shtool} mkdir -p -m 755 \
-        $RPM_BUILD_ROOT%{l_prefix}/etc/tripwire
-    %{l_shtool} mkdir -p -m 755 \
+    %{l_shtool} mkdir -f -p -m 755 \
+        $RPM_BUILD_ROOT%{l_prefix}/bin \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/tripwire \
         $RPM_BUILD_ROOT%{l_prefix}/man/man4 \
         $RPM_BUILD_ROOT%{l_prefix}/man/man5 \
-        $RPM_BUILD_ROOT%{l_prefix}/man/man8
-    %{l_shtool} mkdir -p -m 755 \
+        $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
         $RPM_BUILD_ROOT%{l_prefix}/var/tripwire
 
     for f in bin/*_r/*; do
@@ -141,7 +150,29 @@ AutoReqProv:  no
         %{l_shtool} install -c -m 644 \
             $f $RPM_BUILD_ROOT%{l_prefix}/$f
     done
-    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
+
+    #   install run-command script
+    %{l_shtool} mkdir -f -p -m 755 \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
+    %{l_shtool} install -c -m 755 \
+        -e 's;@l_prefix@;%{l_prefix};g' \
+        -e 's;@l_susr@;%{l_susr};g' \
+        -e 's;@l_rusr@;%{l_rusr};g' \
+        -e 's;@l_rgrp@;%{l_rgrp};g' \
+        %{SOURCE rc.tripwire} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
+
+    #   install OSSP fsl configuration
+    %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
+    %{l_shtool} install -c -m 644 \
+        -e 's;@l_prefix@;%{l_prefix};g' \
+        %{SOURCE fsl.tripwire} \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
+
+    #   determine installation files
+    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
+        %{l_files_std} \
+        '%not %dir %{l_prefix}/etc/fsl' \
+        '%config %{l_prefix}/etc/fsl/fsl.tripwire'
 
 %files -f files