瀏覽代碼

add fsl support

Thomas Lotterer 22 年之前
父節點
當前提交
0ad9d008bb
共有 6 個文件被更改,包括 156 次插入11 次删除
  1. 15 0
      kermit/fsl.kermit
  2. 40 6
      kermit/kermit.spec
  3. 23 0
      kermit/rc.kermit
  4. 15 0
      nntpcache/fsl.nntpcache
  5. 40 5
      nntpcache/nntpcache.spec
  6. 23 0
      nntpcache/rc.nntpcache

+ 15 - 0
kermit/fsl.kermit

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

+ 40 - 6
kermit/kermit.spec

@@ -37,16 +37,25 @@ Distribution: OpenPKG [BASE]
 Group:        Communication
 License:      GPL
 Version:      %{V_major}.%{V_minor}
-Release:      20030331
+Release:      20030701
+
+#   package options
+%option       with_fsl  yes
 
 #   list of sources
 Source0:      ftp://kermit.columbia.edu/kermit/archives/cku%{V_minor}.tar.gz
+Source1:      rc.kermit
+Source2:      fsl.kermit
 
 #   build information
 Prefix:       %{l_prefix}
 BuildRoot:    %{l_buildroot}
-BuildPreReq:  OpenPKG, openpkg >= 20020206, gcc
-PreReq:       OpenPKG, openpkg >= 20020206
+BuildPreReq:  OpenPKG, openpkg >= 20030415, gcc
+PreReq:       OpenPKG, openpkg >= 20030415
+%if "%{with_fsl}" == "yes"
+BuildPreReq:  fsl
+PreReq:       fsl
+%endif
 AutoReq:      no
 AutoReqProv:  no
 
@@ -74,7 +83,9 @@ AutoReqProv:  no
     esac
     %{l_make} %{l_mflags} -f makefile \
         CC="%{l_cc}" \
-        CFLAGS="%{l_cflags -O}" \
+        KFLAGS="-DSYSLOGLEVEL=6" \
+        LDFLAGS="%{l_fsl_ldflags}" \
+        LIBS="%{l_fsl_libs}" \
         BINDIR=%{l_prefix}/bin \
         MANDIR=%{l_prefix}/man/man1 MANEXT=1 \
         INFODIR=%{l_prefix}/share/kermit \
@@ -85,7 +96,8 @@ AutoReqProv:  no
     %{l_shtool} mkdir -f -p -m 755 \
         $RPM_BUILD_ROOT%{l_prefix}/bin \
         $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
-        $RPM_BUILD_ROOT%{l_prefix}/share/kermit
+        $RPM_BUILD_ROOT%{l_prefix}/share/kermit \
+        $RPM_BUILD_ROOT%{l_prefix}/var/%{name}
     %{l_make} %{l_mflags} -f makefile \
         BINDIR=$RPM_BUILD_ROOT%{l_prefix}/bin \
         MANDIR=$RPM_BUILD_ROOT%{l_prefix}/man/man1 MANEXT=1 \
@@ -93,7 +105,29 @@ AutoReqProv:  no
         install
     rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/ckermit.ini
     strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
-    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
+
+    #   Creating 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.%{name}} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
+
+    #   OSSP fake syslog library
+    %{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.%{name}} \
+        $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.%{name}'
 
 %files -f files
 

+ 23 - 0
kermit/rc.kermit

@@ -0,0 +1,23 @@
+#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
+##
+##  rc.kermit -- Run-Commands
+##
+
+%config
+    kermit_enable="yes"
+    kermit_log_prolog="true"
+    kermit_log_epilog="true"
+    kermit_log_numfiles="10"
+    kermit_log_minsize="1M"
+    kermit_log_complevel="9"
+
+%daily -u @l_susr@
+    opServiceEnabled kermit || exit 0
+
+    #   rotate logfile
+    shtool rotate -f \
+        -n${kermit_log_numfiles} -s${kermit_log_minsize} -d \
+        -z${kermit_log_complevel} -o@l_rusr@ -g@l_rgrp@ -m644 \
+        -P "${kermit_log_prolog}" \
+        -E "${kermit_log_epilog}" \
+        @l_prefix@/var/kermit/kermit.log

+ 15 - 0
nntpcache/fsl.nntpcache

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

+ 40 - 5
nntpcache/nntpcache.spec

@@ -33,16 +33,25 @@ Distribution: OpenPKG [BASE]
 Group:        News
 License:      BSD
 Version:      3.0.1
-Release:      20020405
+Release:      20030701
+
+#   package options
+%option       with_fsl  yes
 
 #   list of sources
 Source0:      ftp://ftp.nntpcache.org/pub/nntpcache/nntpcache-%{version}.tar.gz
+Source1:      rc.nntpcache
+Source2:      fsl.nntpcache
 
 #   build information
 Prefix:       %{l_prefix}
 BuildRoot:    %{l_buildroot}
-BuildPreReq:  OpenPKG, openpkg >= 20020206, make
-PreReq:       OpenPKG, openpkg >= 20020206
+BuildPreReq:  OpenPKG, openpkg >= 20030415, make
+PreReq:       OpenPKG, openpkg >= 20030415
+%if "%{with_fsl}" == "yes"
+BuildPreReq:  fsl
+PreReq:       fsl
+%endif
 AutoReq:      no
 AutoReqProv:  no
 
@@ -64,6 +73,8 @@ AutoReqProv:  no
 %build
     CC="%{l_cc}" \
     CFLAGS="%{l_cflags -O}" \
+    LDFLAGS="%{l_fsl_ldflags}" \
+    LIBS="%{l_fsl_libs}" \
     ./configure \
         --prefix=%{l_prefix} \
         --sysconfdir=%{l_prefix}/etc/nntpcache \
@@ -72,6 +83,8 @@ AutoReqProv:  no
 
 %install
     rm -rf $RPM_BUILD_ROOT
+    %{l_shtool} mkdir -f -p -m 755 \
+        $RPM_BUILD_ROOT%{l_prefix}/var
     %{l_shtool} subst \
         -e "s;chown;true;g" -e "s;chgrp;true;g" \
         `find . -type f -name Makefile -print`
@@ -95,8 +108,30 @@ AutoReqProv:  no
       done
     )
     find $RPM_BUILD_ROOT%{l_prefix} -type d -print | xargs chmod 755
-    find $RPM_BUILD_ROOT%{l_prefix} -type f -print | xargs chmod 644
-    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
+    find $RPM_BUILD_ROOT%{l_prefix} -type f -print | grep -v /sbin | xargs chmod 644
+
+    #   Creating 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.%{name}} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
+
+    #   OSSP fake syslog library
+    %{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.%{name}} \
+        $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.%{name}'
 
 %files -f files
 

+ 23 - 0
nntpcache/rc.nntpcache

@@ -0,0 +1,23 @@
+#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
+##
+##  rc.nntpcache -- Run-Commands
+##
+
+%config
+    nntpcache_enable="yes"
+    nntpcache_log_prolog="true"
+    nntpcache_log_epilog="true"
+    nntpcache_log_numfiles="10"
+    nntpcache_log_minsize="1M"
+    nntpcache_log_complevel="9"
+
+%daily -u @l_susr@
+    opServiceEnabled nntpcache || exit 0
+
+    #   rotate logfile
+    shtool rotate -f \
+        -n${nntpcache_log_numfiles} -s${nntpcache_log_minsize} -d \
+        -z${nntpcache_log_complevel} -o@l_rusr@ -g@l_rgrp@ -m644 \
+        -P "${nntpcache_log_prolog}" \
+        -E "${nntpcache_log_epilog}" \
+        @l_prefix@/var/nntpcache/nntpcache.log