View | Details | Raw Unified | Return to bug 253567 | Differences between
and this patch

Collapse All | Expand All

(-)b/Makefile (-9 / +11 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	anacron
4
PORTNAME=	anacron
5
PORTVERSION=	2.3
5
PORTVERSION=	2.3
6
PORTREVISION=	6
6
PORTREVISION=	7
7
CATEGORIES=	sysutils
7
CATEGORIES=	sysutils
8
MASTER_SITES=	SF
8
MASTER_SITES=	SF
9
9
Lines 14-33 LICENSE= GPLv2+ Link Here
14
LICENSE_FILE=	${WRKSRC}/COPYING
14
LICENSE_FILE=	${WRKSRC}/COPYING
15
15
16
USES=		gmake
16
USES=		gmake
17
USE_RC_SUBR=	anacron
17
USE_RC_SUBR=	${PORTNAME}
18
SUB_FILES=	pkg-message
18
SUB_FILES=	pkg-message
19
PLIST_SUB=	PORTNAME=${PORTNAME}
20
SUB_LIST+=	PORTNAME=${PORTNAME} COMMENT="${COMMENT}"
19
21
20
post-patch:
22
post-patch:
21
.for f in Makefile anacron.8 anacrontab.5
23
.for f in Makefile ${PORTNAME}.8 ${PORTNAME}tab.5
22
	@${REINPLACE_CMD} -e 's|\(/etc/anacrontab\)|${PREFIX}\1|' ${WRKSRC}/${f}
24
	@${REINPLACE_CMD} -e 's|\(/etc/${PORTNAME}tab\)|${PREFIX}\1|' ${WRKSRC}/${f}
23
.endfor
25
.endfor
24
	@${REINPLACE_CMD} -e 's|^CFLAGS = .*||' ${WRKSRC}/Makefile
26
	@${REINPLACE_CMD} -e 's|^CFLAGS = .*||' ${WRKSRC}/Makefile
25
27
26
do-install:
28
do-install:
27
	${INSTALL_PROGRAM} ${WRKSRC}/anacron ${STAGEDIR}${PREFIX}/sbin
29
	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/sbin
28
	${INSTALL_MAN} ${WRKSRC}/anacron.8 ${STAGEDIR}${MAN8PREFIX}/man/man8
30
	${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.8 ${STAGEDIR}${MAN8PREFIX}/man/man8
29
	${INSTALL_MAN} ${WRKSRC}/anacrontab.5 ${STAGEDIR}${MAN5PREFIX}/man/man5
31
	${INSTALL_MAN} ${WRKSRC}/${PORTNAME}tab.5 ${STAGEDIR}${MAN5PREFIX}/man/man5
30
	${INSTALL_DATA} ${FILESDIR}/anacrontab.sample ${STAGEDIR}${PREFIX}/etc
32
	${INSTALL_DATA} ${FILESDIR}/${PORTNAME}tab.sample ${STAGEDIR}${PREFIX}/etc
31
	@${MKDIR} ${STAGEDIR}/var/spool/anacron
33
	@${MKDIR} ${STAGEDIR}/var/spool/${PORTNAME}
32
34
33
.include <bsd.port.mk>
35
.include <bsd.port.mk>
(-)b/files/anacron.in (-9 / +24 lines)
Lines 1-24 Link Here
1
#!/bin/sh
1
#!/bin/sh
2
#
2
#
3
# $FreeBSD: head/sysutils/anacron/files/anacron.in 361519 2014-07-11 09:52:59Z madpilot $
3
# $FreeBSD$
4
#
4
#
5
5
6
# PROVIDE: anacron
6
# PROVIDE: %%PORTNAME%%
7
# REQUIRE: LOGIN
7
# REQUIRE: LOGIN
8
# KEYWORD: resume
8
9
9
#
10
#
10
# Add the following line to /etc/rc.conf to enable anacron:
11
# Execute one of the following commands as root to enable %%PORTNAME%%:
11
#
12
#
12
# anacron_enable="YES"
13
#    service %%PORTNAME%% enable
14
#    sysrc %%PORTNAME%%_enable=YES
13
#
15
#
14
16
15
. /etc/rc.subr
17
. /etc/rc.subr
16
18
17
name=anacron
19
name=%%PORTNAME%%
18
rcvar=anacron_enable
20
command="%%PREFIX%%/sbin/%%PORTNAME%%"
21
desc="%%COMMENT%%"
22
extra_commands=resume
23
rcvar=%%PORTNAME%%_enable
24
required_vars=syslogd_enable
19
25
20
load_rc_config $name
26
load_rc_config $name
21
: ${anacron_enable:=NO}
27
: ${%%PORTNAME%%_enable:=NO}
22
command="%%PREFIX%%/sbin/anacron"
23
28
24
run_rc_command "$1"
29
if [ $# -gt 0 -a $1 = "resume" ]; then
30
   arg=start
31
   if checkyesno $rcvar; then
32
       info "starting ${name} after resume"
33
   fi
34
else
35
   arg=$1
36
fi
37
debug "$name: \$1 = $1, arg = $arg"
38
39
run_rc_command "$arg"
(-)b/files/patch-log.c (+10 lines)
Added Link Here
1
--- log.c.orig	2000-06-22 22:55:13 UTC
2
+++ log.c
3
@@ -37,6 +37,7 @@
4
 #include <unistd.h>
5
 #include <syslog.h>
6
 #include <stdio.h>
7
+#include <stdlib.h>
8
 #include <stdarg.h>
9
 #include <errno.h>
10
 #include <signal.h>
(-)b/files/patch-main.c (+10 lines)
Added Link Here
1
--- main.c.orig	2000-06-22 22:58:07 UTC
2
+++ main.c
3
@@ -24,6 +24,7 @@
4
 
5
 #include <time.h>
6
 #include <stdio.h>
7
+#include <stdlib.h>
8
 #include <unistd.h>
9
 #include <signal.h>
10
 #include <fcntl.h>
(-)b/files/patch-matchrx.c (-1 / +5 lines)
Lines 1-6 Link Here
1
--- matchrx.c.orig	2000-06-20 23:12:18 UTC
1
--- matchrx.c.orig	2000-06-20 23:12:18 UTC
2
+++ matchrx.c
2
+++ matchrx.c
3
@@ -23,6 +23,7 @@
3
@@ -23,9 +23,11 @@
4
 
4
 
5
 
5
 
6
 #include <stdio.h>
6
 #include <stdio.h>
Lines 8-10 Link Here
8
 #include <regex.h>
8
 #include <regex.h>
9
 #include <stdarg.h>
9
 #include <stdarg.h>
10
 #include <stdlib.h>
10
 #include <stdlib.h>
11
+#include <string.h>
12
 #include "matchrx.h"
13
 
14
 int
(-)b/files/patch-runjob.c (-2 / +11 lines)
Lines 9-16 Link Here
9
-    int fd, i;
9
-    int fd, i;
10
+    int fd;
10
+    int fd;
11
+    char name[] = "/tmp/anacron.XXXXXX";
11
+    char name[] = "/tmp/anacron.XXXXXX";
12
+
13
+    fd = mkstemp(name);
14
 
12
 
15
-    i = 0;
13
-    i = 0;
16
-    name = NULL;
14
-    name = NULL;
Lines 25-30 Link Here
25
-	/* I'm not sure we actually need to be so persistent here */
23
-	/* I'm not sure we actually need to be so persistent here */
26
-    } while (fd == -1 && errno == EEXIST && i < max_retries);
24
-    } while (fd == -1 && errno == EEXIST && i < max_retries);
27
-    
25
-    
26
+    fd = mkstemp(name);
27
+
28
     if (fd == -1) die_e("Can't open temporary file");
28
     if (fd == -1) die_e("Can't open temporary file");
29
     if (unlink(name)) die_e("Can't unlink temporary file");
29
     if (unlink(name)) die_e("Can't unlink temporary file");
30
-    free(name);
30
-    free(name);
Lines 32-34 Link Here
32
     fcntl(fd, F_SETFD, 1);    /* set close-on-exec flag */
32
     fcntl(fd, F_SETFD, 1);    /* set close-on-exec flag */
33
     return fd;
33
     return fd;
34
 }
34
 }
35
@@ -84,7 +72,7 @@ username()
36
 }
37
 
38
 static void
39
-xputenv(const char *s)
40
+xputenv(char *s)
41
 {
42
     if (putenv(s)) die_e("Can't set the environment");
43
 }
(-)b/files/pkg-message.in (-5 / +10 lines)
Lines 2-13 Link Here
2
{ type: install
2
{ type: install
3
  message: <<EOM
3
  message: <<EOM
4
Configuration hints:
4
Configuration hints:
5
- Edit %%PREFIX%%/etc/anacrontab
5
- Edit %%PREFIX%%/etc/%%PORTNAME%%tab
6
- Deactivate the 'periodic' commands in /etc/crontab
6
- Deactivate the 'periodic' commands in /etc/crontab
7
- Add a call to anacron to /etc/crontab, like
7
- Add a call to %%PORTNAME%% to /etc/crontab, like
8
  0  0  *  *  *    root    %%PREFIX%%/sbin/anacron
8
  0  0  *  *  *    root    %%PREFIX%%/sbin/%%PORTNAME%%
9
- Add anacron_enable="YES" to /etc/rc.conf
9
- Add %%PORTNAME%%_enable="YES" to /etc/rc.conf
10
- Read anacron(8) and anacrontab(5)
10
  or execute one of the following commands as root:
11
    service %%PORTNAME%% enable
12
    sysrc %%PORTNAME%%_enable=YES
13
- Read %%PORTNAME%%(8) and %%PORTNAME%%tab(5)
14
- To avoid overlapping periodic(8) jobs, you may want to serialize jobs:
15
    sysrc %%PORTNAME%%_flags+=" -s"
11
EOM
16
EOM
12
}
17
}
13
]
18
]
(-)b/pkg-plist (-5 / +6 lines)
Lines 1-5 Link Here
1
sbin/anacron
1
sbin/%%PORTNAME%%
2
@sample etc/anacrontab.sample
2
@sample etc/%%PORTNAME%%tab.sample
3
@unexec rmdir /var/spool/anacron 2>/dev/null || echo "If you are permanently removing this port, you should do a 'rm -rf /var/spool/anacron'."
3
@postexec mkdir -p /var/spool/%%PORTNAME%% 2>/dev/null
4
man/man8/anacron.8.gz
4
@postunexec rmdir /var/spool/%%PORTNAME%% 2>/dev/null || echo "If you are permanently removing this port, you should do a 'rm -rf /var/spool/%%PORTNAME%%'."
5
man/man5/anacrontab.5.gz
5
man/man8/%%PORTNAME%%.8.gz
6
man/man5/%%PORTNAME%%tab.5.gz

Return to bug 253567