Browse Source

upgrading package: ngircd 0.8.3 -> 0.9.0

master
parent
commit
a0e2896d73
  1. 79
      ngircd/ngircd.patch
  2. 7
      ngircd/ngircd.spec

79
ngircd/ngircd.patch

@ -1,79 +0,0 @@
Index: src/ngircd/ngircd.c
--- src/ngircd/ngircd.c.orig 2005-01-26 23:09:33 +0100
+++ src/ngircd/ngircd.c 2005-03-16 13:15:05 +0100
@@ -77,6 +77,9 @@
#ifdef SNIFFER
NGIRCd_Sniffer = FALSE;
#endif
+#ifdef PID_FILE
+ strlcpy( NGIRCd_PidFile, "/dev/null", sizeof( NGIRCd_PidFile ));
+#endif
strlcpy( NGIRCd_ConfFile, SYSCONFDIR, sizeof( NGIRCd_ConfFile ));
strlcat( NGIRCd_ConfFile, CONFIG_FILE, sizeof( NGIRCd_ConfFile ));
@@ -139,6 +142,19 @@
Show_Version( );
exit( 1 );
}
+#ifdef PID_FILE
+ if( strcmp( argv[i], "--pidfile" ) == 0 )
+ {
+ if( i + 1 < argc )
+ {
+ /* Ok, there's an parameter left */
+ strlcpy( NGIRCd_PidFile, argv[i + 1], sizeof( NGIRCd_PidFile ));
+
+ /* next parameter */
+ i++; ok = TRUE;
+ }
+ }
+#endif
}
else if(( argv[i][0] == '-' ) && ( argv[i][1] != '-' ))
{
@@ -282,6 +298,21 @@
/* Child-Prozess initialisieren */
(VOID)setsid( );
+#ifdef PID_FILE
+ {
+ mode_t old_umask;
+ pid_t pid;
+ FILE *fp;
+
+ old_umask = umask((mode_t) 0022);
+ pid = getpid();
+ if ((fp = fopen(NGIRCd_PidFile, "w")) == NULL)
+ syslog(LOG_ERR, "cannot write PID file '%s'", NGIRCd_PidFile);
+ fprintf(fp, "%ld\n", (long)pid);
+ fclose(fp);
+ umask(old_umask);
+ }
+#endif
chdir( "/" );
}
@@ -565,6 +596,9 @@
puts( " -s, --sniffer enable network sniffer and display all IRC traffic" );
#endif
puts( " -t, --configtest read, validate and display configuration; then exit" );
+#ifdef PID_FILE
+ puts( " --pidfile <f> write PID into file" );
+#endif
puts( " --version output version information and exit" );
puts( " --help display this help and exit" );
} /* Show_Help */
Index: src/ngircd/ngircd.h
--- src/ngircd/ngircd.h.orig 2002-12-26 17:48:14 +0100
+++ src/ngircd/ngircd.h 2005-03-16 13:15:05 +0100
@@ -45,6 +45,10 @@
GLOBAL CHAR NGIRCd_ConfFile[FNAME_LEN]; /* Konfigurationsdatei */
+#ifdef PID_FILE
+GLOBAL CHAR NGIRCd_PidFile[FNAME_LEN]; /* PID file */
+#endif
+
GLOBAL CHAR NGIRCd_ProtoID[COMMAND_LEN];/* Protokoll- und Server-Identifikation */

7
ngircd/ngircd.spec

@ -32,8 +32,8 @@ Distribution: OpenPKG
Class: EVAL
Group: Network
License: GNU
Version: 0.8.3
Release: 20050411
Version: 0.9.0
Release: 20050725
# package options
%option with_fsl yes
@ -42,7 +42,6 @@ Release: 20050411
Source0: ftp://ftp.berlios.de/pub/ngircd/ngircd-%{version}.tar.gz
Source1: rc.ngircd
Source2: fsl.ngircd
Patch0: ngircd.patch
# build information
Prefix: %{l_prefix}
@ -70,7 +69,6 @@ AutoReqProv: no
%prep
%setup -q
%patch -p0
%{l_shtool} subst \
-e 's;^\(docdir = $(datadir)/\)doc/\($(PACKAGE)\);\1\2;' \
doc/Makefile.in
@ -108,6 +106,7 @@ AutoReqProv: no
-e 's|;\(ServerUID = \).*$|\1 %{l_ruid}|' \
-e 's|;\(ServerGID = \).*$|\1 %{l_rgid}|' \
-e 's|;\(MotdFile = \).*$|\1 %{l_prefix}/etc/ngircd/ngircd.motd|' \
-e 's|;\(PidFile = \).*$|\1 %{l_prefix}/var/ngircd/run/ngircd.pid|' \
ngircd.conf \
$RPM_BUILD_ROOT%{l_prefix}/etc/ngircd/

Loading…
Cancel
Save