From: thib Date: Wed, 24 May 2000 17:51:17 +0000 (+0000) Subject: support for FreeBSD added X-Git-Tag: ver1564~642 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f463d54896d6efdc83fc14305611ef5abbf2a460;p=fcron support for FreeBSD added --- diff --git a/Makefile.in b/Makefile.in index e661e6c..2314269 100644 --- a/Makefile.in +++ b/Makefile.in @@ -2,7 +2,7 @@ # fcron's Makefile ######## ############################ -# $Id: Makefile.in,v 1.7 2000-05-17 19:20:46 thib Exp $ +# $Id: Makefile.in,v 1.8 2000-05-24 17:51:59 thib Exp $ # ********************************************************* # # *** Begin of configurable stuffs ************************ # @@ -11,7 +11,13 @@ # Where should we install it ? DESTSBIN= /usr/sbin/ DESTBIN= /usr/bin/ + +#DESTMAN= /usr/share/man/ DESTMAN= /usr/man/ + +#DESTDOC= /usr/share/ +DESTDOC= /usr/doc/ + FCRONTABS=/var/spool/fcron/ ETC=/etc/ @@ -57,7 +63,7 @@ INSTALL= install # Should not be changed under this # #################################### -export VERSION= 0.8.0 +VERSION= 0.8.1 CFLAGS= $(INCLUDE) $(OPTIM) $(OTHERFLAGS) $(OPTION) -DVERSION=\"$(VERSION)\" -DFCRONTABS=\"$(FCRONTABS)\" -DETC=\"$(ETC)\" OBJSD = fcron.o subs.o database.o job.o log.o conf.o OBJS= fcrontab.o fileconf.o subs.o log.o allow.c @@ -89,18 +95,18 @@ allow.o: allow.c $(HEADERS) install: all - $(INSTALL) -m 111 -o root -s fcron $(DESTSBIN)/ - $(INSTALL) -m 4111 -o root -s fcrontab $(DESTBIN)/ - $(INSTALL) -m 700 -o root files/fcron.allow $(ETC)/ - $(INSTALL) -m 700 -o root files/fcron.deny $(ETC)/ - $(INSTALL) -m 644 -o root doc/fcron.8 $(DESTMAN)/man8/ - $(INSTALL) -m 644 -o root doc/fcrontab.1 $(DESTMAN)/man1/ - $(INSTALL) -m 644 -o root doc/fcrontab.5 $(DESTMAN)/man5/ - $(INSTALL) -m 644 -o root doc/bitstring.3 $(DESTMAN)/man3/ + $(INSTALL) -c -m 111 -o root -s fcron $(DESTSBIN)/ + $(INSTALL) -c -m 4111 -o root -s fcrontab $(DESTBIN)/ + $(INSTALL) -c -m 700 -o root files/fcron.allow $(ETC)/ + $(INSTALL) -c -m 700 -o root files/fcron.deny $(ETC)/ + $(INSTALL) -c -m 644 -o root doc/fcron.8 $(DESTMAN)/man8/ + $(INSTALL) -c -m 644 -o root doc/fcrontab.1 $(DESTMAN)/man1/ + $(INSTALL) -c -m 644 -o root doc/fcrontab.5 $(DESTMAN)/man5/ + $(INSTALL) -c -m 644 -o root doc/bitstring.3 $(DESTMAN)/man3/ script/sysVinit-install "$(CFLAGS)" $(INSTALL) mkdir -p /usr/doc/fcron-$(VERSION) - cd doc; $(INSTALL) -m 644 -o root README LICENSE CHANGES *.html \ - /usr/doc/fcron-$(VERSION)/ + cd doc; $(INSTALL) -c -m 644 -o root README LICENSE CHANGES *.html \ + $(DESTDOC)/fcron-$(VERSION)/ mkdir -p $(FCRONTABS) chmod 700 $(FCRONTABS) @@ -145,3 +151,4 @@ tar: vclean updatedoc + diff --git a/fcron.c b/fcron.c index fdb0224..a73bb01 100644 --- a/fcron.c +++ b/fcron.c @@ -21,11 +21,11 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: fcron.c,v 1.6 2000-05-22 17:53:05 thib Exp $ */ + /* $Id: fcron.c,v 1.7 2000-05-24 17:51:37 thib Exp $ */ #include "fcron.h" -char rcs_info[] = "$Id: fcron.c,v 1.6 2000-05-22 17:53:05 thib Exp $"; +char rcs_info[] = "$Id: fcron.c,v 1.7 2000-05-24 17:51:37 thib Exp $"; void main_loop(void); void info(void); @@ -182,6 +182,8 @@ parseopt(int argc, char *argv[]) char c; int i; + +#ifdef __linux__ static struct option opt[] = { {"debug",0,NULL,'d'}, @@ -191,13 +193,19 @@ parseopt(int argc, char *argv[]) {"version",0,NULL,'V'}, {0,0,0,0} }; +#endif + extern char *optarg; extern int optind, opterr, optopt; /* constants and variables defined by command line */ while(1) { +#ifdef __linux c = getopt_long(argc, argv, "dfbhV", opt, NULL); +#else + c = getopt(argc, argv, "dfbhV"); +#endif if (c == -1) break; switch (c) { diff --git a/global.h b/global.h index de8c78a..e2e47f5 100644 --- a/global.h +++ b/global.h @@ -21,14 +21,16 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: global.h,v 1.2 2000-05-15 18:28:53 thib Exp $ */ + /* $Id: global.h,v 1.3 2000-05-24 17:51:55 thib Exp $ */ #ifndef __GLOBALH__ #define __GLOBALH__ #include #include +#ifdef __linux__ #include +#endif #include #include #include diff --git a/script/boot-install b/script/boot-install index f78b4f0..3bd2b55 100755 --- a/script/boot-install +++ b/script/boot-install @@ -2,7 +2,7 @@ # Install fcron under SysV system. # -# $Id: boot-install,v 1.4 2000-05-17 19:19:30 thib Exp $ +# $Id: boot-install,v 1.5 2000-05-24 17:51:17 thib Exp $ # take two arguments : first is the compilation line arguments, in order # to determine if fcron should be installed with debugs options, @@ -20,12 +20,16 @@ fi if test -f /etc/rc.d/rc.M; then # Slackware echo "fcron -b" >> /etc/rc.d/rc.local -else +else if test -f /etc/rc; then + # FreeBSD + echo "fcron -b" >> /etc/rc.d/rc.local + +else if echo $1 | grep -e '-DDEBUG'; then - $2 -m 755 -o root script/sysVinit-launcher-debug /etc/rc.d/init.d/fcron + $2 -c -m 755 -o root script/sysVinit-launcher-debug /etc/rc.d/init.d/fcron else - $2 -m 755 -o root script/sysVinit-launcher /etc/rc.d/init.d/fcron + $2 -c -m 755 -o root script/sysVinit-launcher /etc/rc.d/init.d/fcron fi cd /etc/rc.d/rc3.d/