diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-02-19 20:45:40 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-02-19 20:45:40 +0000 |
commit | 8186268c393dda64a3169bca1635b1b14502068f (patch) | |
tree | 80e410e8cc68c9cc32ac293c5ff071307d3e3d2b /sys-apps | |
parent | old (diff) | |
download | historical-8186268c393dda64a3169bca1635b1b14502068f.tar.gz historical-8186268c393dda64a3169bca1635b1b14502068f.tar.bz2 historical-8186268c393dda64a3169bca1635b1b14502068f.zip |
Clean up the init.d script and add support for writing of the pid file in dcron itself.
Package-Manager: portage-2.0.51-r15
Diffstat (limited to 'sys-apps')
-rw-r--r-- | sys-apps/dcron/ChangeLog | 10 | ||||
-rw-r--r-- | sys-apps/dcron/Manifest | 11 | ||||
-rw-r--r-- | sys-apps/dcron/dcron-2.9-r4.ebuild | 68 | ||||
-rw-r--r-- | sys-apps/dcron/files/dcron-2.9-Makefile.patch | 27 | ||||
-rw-r--r-- | sys-apps/dcron/files/dcron-2.9-pidfile.patch | 20 | ||||
-rwxr-xr-x | sys-apps/dcron/files/dcron-r4 | 24 | ||||
-rw-r--r-- | sys-apps/dcron/files/digest-dcron-2.9-r4 | 1 |
7 files changed, 156 insertions, 5 deletions
diff --git a/sys-apps/dcron/ChangeLog b/sys-apps/dcron/ChangeLog index 334df64e809a..d574dff4464d 100644 --- a/sys-apps/dcron/ChangeLog +++ b/sys-apps/dcron/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for sys-apps/dcron # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/dcron/ChangeLog,v 1.40 2005/02/10 04:19:21 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/dcron/ChangeLog,v 1.41 2005/02/19 20:45:40 vapier Exp $ + +*dcron-2.9-r4 (19 Feb 2005) + + 19 Feb 2005; Mike Frysinger <vapier@gentoo.org> + +files/dcron-2.9-Makefile.patch, +files/dcron-2.9-pidfile.patch, + +files/dcron-r4, +dcron-2.9-r4.ebuild: + Clean up the init.d script and add support for writing of the pid file in + dcron itself. *dcron-2.9-r3 (09 Feb 2005) diff --git a/sys-apps/dcron/Manifest b/sys-apps/dcron/Manifest index a3a616b224c6..b69eea1965d0 100644 --- a/sys-apps/dcron/Manifest +++ b/sys-apps/dcron/Manifest @@ -1,11 +1,14 @@ -MD5 76afb6da7fba6b30c43034565df0ad9e ChangeLog 5096 -MD5 8a124876b50d6123af820bd2c03cfb60 dcron-2.9-r3.ebuild 1642 +MD5 5eaa97e69685ed742e39148896db5cc3 ChangeLog 5376 MD5 d0dad7daa0e6d356fc35f778fed36006 metadata.xml 225 +MD5 24fe0dd2110878b2afcd38e8c99d6b92 dcron-2.9-r4.ebuild 1663 MD5 1dba78d52fd982608cea9ab6e1d1db66 dcron-2.9-r2.ebuild 2067 +MD5 d519d4b16f6ee59279bc96409ae9d492 files/dcron-r4 531 MD5 562feacfdde7b16558e57b142a98326f files/crontab 824 MD5 bedf02492e4cc8875b735c6a4bcdd272 files/dcron 614 -MD5 932978359b7a3b3a2d29a96827ceca83 files/dcron-2.7-Makefile-gentoo.diff 534 +MD5 cd9a521d56c9c4df0fd79e9dd71bd32b files/dcron-2.9-pidfile.patch 493 MD5 a82da32a58b097ea2ccd1b7a4aed72f3 files/dcron-2.9-ldflags.patch 590 MD5 2db10e843ecdf10a2b3aa5f70322310b files/digest-dcron-2.9-r2 55 MD5 577b9903a5bc13b51ed4e9a7e5d8b17e files/dcron.logrotate 36 -MD5 2db10e843ecdf10a2b3aa5f70322310b files/digest-dcron-2.9-r3 55 +MD5 1de333010665696629a381be64dad25a files/dcron-2.9-Makefile.patch 629 +MD5 932978359b7a3b3a2d29a96827ceca83 files/dcron-2.7-Makefile-gentoo.diff 534 +MD5 2db10e843ecdf10a2b3aa5f70322310b files/digest-dcron-2.9-r4 55 diff --git a/sys-apps/dcron/dcron-2.9-r4.ebuild b/sys-apps/dcron/dcron-2.9-r4.ebuild new file mode 100644 index 000000000000..63695e502583 --- /dev/null +++ b/sys-apps/dcron/dcron-2.9-r4.ebuild @@ -0,0 +1,68 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/dcron/dcron-2.9-r4.ebuild,v 1.1 2005/02/19 20:45:40 vapier Exp $ + +inherit cron toolchain-funcs + +MY_PV=29 +DESCRIPTION="A cute little cron from Matt Dillon" +HOMEPAGE="http://apollo.backplane.com/" +SRC_URI="http://apollo.backplane.com/FreeSrc/${PN}${MY_PV}.tgz" + +LICENSE="GPL-2" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" +IUSE="" + +DEPEND=">=sys-apps/portage-2.0.51" +RDEPEND="" + +S=${WORKDIR}/${PN} + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/dcron-2.9-Makefile.patch + epatch "${FILESDIR}"/dcron-2.9-pidfile.patch + + # fix 'crontab -e' to look at $EDITOR and not $VISUAL + sed -i 's:VISUAL:EDITOR:g' crontab.{c,1} + + # remove gcc hardcode + sed -i "s:\(CC = \)gcc:\1$(tc-getCC):" Makefile +} + +src_compile() { + make || die +} + +src_install() { + #this does not work if the directory already exists + docrondir + docron crond -m0700 -o root -g wheel + docrontab + + dodoc CHANGELOG README ${FILESDIR}/crontab + doman crontab.1 crond.8 + + newinitd ${FILESDIR}/dcron-r4 dcron + + insinto /etc/logrotate.d + newins ${FILESDIR}/dcron.logrotate dcron + + insopts -o root -g root -m 0644 + insinto /etc + doins ${FILESDIR}/crontab +} + +pkg_postinst() { + echo + einfo "To activate /etc/cron.{hourly|daily|weekly|montly} please run: " + einfo "crontab /etc/crontab" + echo + einfo "!!! That will replace root's current crontab !!!" + echo + einfo "You may wish to read the Gentoo Linux Cron Guide, which can be" + einfo "found online at:" + einfo " http://www.gentoo.org/doc/en/cron-guide.xml" + echo +} diff --git a/sys-apps/dcron/files/dcron-2.9-Makefile.patch b/sys-apps/dcron/files/dcron-2.9-Makefile.patch new file mode 100644 index 000000000000..88b542042185 --- /dev/null +++ b/sys-apps/dcron/files/dcron-2.9-Makefile.patch @@ -0,0 +1,27 @@ +--- Makefile ++++ Makefile +@@ -2,7 +2,8 @@ + # + + CC = gcc +-CFLAGS = -O2 -Wall -Wstrict-prototypes ++CFLAGS += -Wall -Wstrict-prototypes ++LDFLAGS += -Wl,-z,now + LIB = + SRCS = main.c subs.c database.c job.c + OBJS = main.o subs.o database.o job.o +@@ -14,12 +15,10 @@ + all: ${PROTOS} crond crontab + + crond: ${OBJS} +- ${CC} ${CFLAGS} -o crond ${OBJS} ${LIB} +- strip crond ++ ${CC} ${CFLAGS} -o crond ${OBJS} ${LIB} ${LDFLAGS} + + crontab: ${D_OBJS} +- ${CC} ${CFLAGS} -o crontab ${D_OBJS} +- strip crontab ++ ${CC} ${CFLAGS} -o crontab ${D_OBJS} ${LDFLAGS} + + protos.h: ${SRCS} ${D_SRCS} + fgrep -h Prototype ${SRCS} ${D_SRCS} >protos.h diff --git a/sys-apps/dcron/files/dcron-2.9-pidfile.patch b/sys-apps/dcron/files/dcron-2.9-pidfile.patch new file mode 100644 index 000000000000..61b009f399ae --- /dev/null +++ b/sys-apps/dcron/files/dcron-2.9-pidfile.patch @@ -0,0 +1,20 @@ +--- dcron/main.c.orig 2005-02-19 15:19:13.000000000 -0500 ++++ dcron/main.c 2005-02-19 15:27:28.000000000 -0500 +@@ -122,8 +122,15 @@ + perror("fork"); + exit(1); + } +- if (pid > 0) +- exit(0); ++ if (pid > 0) { ++ int fdpid; ++ char pidstr[24]; ++ fdpid = open("/var/run/cron.pid", O_WRONLY|O_CREAT|O_TRUNC, 0664); ++ sprintf(pidstr, "%d\n", pid); ++ write(fdpid, pidstr, strlen(pidstr)); ++ close(fdpid); ++ exit(0); ++ } + } + + /* diff --git a/sys-apps/dcron/files/dcron-r4 b/sys-apps/dcron/files/dcron-r4 new file mode 100755 index 000000000000..06e42e659d86 --- /dev/null +++ b/sys-apps/dcron/files/dcron-r4 @@ -0,0 +1,24 @@ +#!/sbin/runscript +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/dcron/files/dcron-r4,v 1.1 2005/02/19 20:45:40 vapier Exp $ + +depend() { + use logger + need clock hostname + provide cron +} + +start() { + ebegin "Starting dcron" + /usr/sbin/crond >> /var/log/cron.log 2>&1 + eend $? +} + +stop() { + ebegin "Stopping dcron" + start-stop-daemon --stop --quiet --pidfile /var/run/cron.pid + local ret=$? + rm -f /var/run/cron.pid + eend ${ret} +} diff --git a/sys-apps/dcron/files/digest-dcron-2.9-r4 b/sys-apps/dcron/files/digest-dcron-2.9-r4 new file mode 100644 index 000000000000..bf4decff8ad3 --- /dev/null +++ b/sys-apps/dcron/files/digest-dcron-2.9-r4 @@ -0,0 +1 @@ +MD5 120fb2ca3d91496b32df0ab01dcaec5e dcron29.tgz 15608 |