Pārlūkot izejas kodu

add fsl support

Thomas Lotterer 22 gadi atpakaļ
vecāks
revīzija
2302cf7a19
3 mainītis faili ar 64 papildinājumiem un 8 dzēšanām
  1. 15 0
      ircd/fsl.ircd
  2. 34 8
      ircd/ircd.spec
  3. 15 0
      ircd/rc.ircd

+ 15 - 0
ircd/fsl.ircd

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

+ 34 - 8
ircd/ircd.spec

@@ -33,20 +33,28 @@ Distribution: OpenPKG [BASE]
 Group:        Network
 License:      BSD
 Version:      2.10.3p3
-Release:      20030409
+Release:      20030701
+
+#   package options
+%option       with_fsl  yes
 
 #   list of sources
 Source0:      ftp://ftp.irc.org/irc/server/irc%{version}.tgz
 Source1:      rc.ircd
 Source2:      ircd.conf
+Source3:      fsl.ircd
 Patch0:       irc%{version}.patch
 Patch1:       ircd.freebsd.patch
 
 #   build information
 Prefix:       %{l_prefix}
 BuildRoot:    %{l_buildroot}
-BuildPreReq:  OpenPKG, openpkg >= 20020206, zlib
-PreReq:       OpenPKG, openpkg >= 20020206
+BuildPreReq:  OpenPKG, openpkg >= 20030415, zlib
+PreReq:       OpenPKG, openpkg >= 20030415
+%if "%{with_fsl}" == "yes"
+BuildPreReq:  fsl
+PreReq:       fsl
+%endif
 AutoReq:      no
 AutoReqProv:  no
 
@@ -70,7 +78,8 @@ AutoReqProv:  no
     CC="%{l_cc}" \
     CFLAGS="%{l_cflags -O} -I%{l_prefix}/include" \
     CPPFLAGS="-I%{l_prefix}/include" \
-    LDFLAGS="-L%{l_prefix}/lib" \
+    LDFLAGS="-L%{l_prefix}/lib %{l_fsl_ldflags}" \
+    LIBS="%{l_fsl_libs}" \
     ./configure \
         --prefix=%{l_prefix} \
         --sysconfdir=%{l_prefix}/etc/ircd \
@@ -92,6 +101,8 @@ AutoReqProv:  no
 
 %install
     rm -rf $RPM_BUILD_ROOT
+    %{l_shtool} mkdir -f -p -m 755 \
+        $RPM_BUILD_ROOT%{l_prefix}/var
     ( cd *-*-*
       %{l_make} %{l_mflags} install-server \
           prefix=$RPM_BUILD_ROOT%{l_prefix} \
@@ -106,10 +117,6 @@ AutoReqProv:  no
        $RPM_BUILD_ROOT%{l_prefix}/etc/ircd/ircd.conf.sample
     %{l_shtool} install -c -m 644 %{SOURCE ircd.conf} \
        $RPM_BUILD_ROOT%{l_prefix}/etc/ircd/ircd.conf
-    %{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' \
-        %{SOURCE rc.ircd} \
-        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
     %{l_shtool} install -c -m 644 /dev/null \
         $RPM_BUILD_ROOT%{l_prefix}/etc/ircd/ircd.motd
     %{l_shtool} install -c -m 644 /dev/null \
@@ -119,8 +126,27 @@ AutoReqProv:  no
     rm -rf $RPM_BUILD_ROOT%{l_prefix}/bin
     rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/irc.1
     strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* 2>/dev/null || true
+
+    #   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' \
+        %{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}' \
         '%config %{l_prefix}/etc/ircd/*'
 
 %files -f files

+ 15 - 0
ircd/rc.ircd

@@ -5,6 +5,11 @@
 
 %config
     ircd_enable="yes"
+    ircd_log_prolog="true"
+    ircd_log_epilog="true"
+    ircd_log_numfiles="10"
+    ircd_log_minsize="1M"
+    ircd_log_complevel="9"
 
 %start -p 200 -u @l_susr@
     opServiceEnabled ircd || exit 0
@@ -24,3 +29,13 @@
     opServiceEnabled ircd || exit 0
     kill -HUP `cat @l_prefix@/var/ircd/ircd.pid`
 
+%daily -u @l_susr@
+    opServiceEnabled ircd || exit 0
+
+    #   rotate logfile
+    shtool rotate -f \
+        -n${ircd_log_numfiles} -s${ircd_log_minsize} -d \
+        -z${ircd_log_complevel} -o@l_rusr@ -g@l_rgrp@ -m644 \
+        -P "${ircd_log_prolog}" \
+        -E "${ircd_log_epilog}" \
+        @l_prefix@/var/ircd/ircd.log