View | Details | Raw Unified | Return to bug 142811
Collapse All | Expand All

(-)Makefile (-17 / +5 lines)
Lines 23-31 Link Here
23
MAN8=		cdcc.8 dbclean.8 dblist.8 dcc.8 dccd.8 dccifd.8 dccm.8 \
23
MAN8=		cdcc.8 dbclean.8 dblist.8 dcc.8 dccd.8 dccifd.8 dccm.8 \
24
		dccproc.8 dccsight.8
24
		dccproc.8 dccsight.8
25
25
26
PKGINSTALL=	${WRKDIR}/pkg-install
27
PKGDEINSTALL=	${WRKDIR}/pkg-deinstall
28
29
USE_RC_SUBR=
26
USE_RC_SUBR=
30
27
31
#
28
#
Lines 70-79 Link Here
70
#
67
#
71
CONFIGURE_ARGS=	--with-uid=${DCCUSER} --bindir=${PREFIX}/bin --mandir=${MANPREFIX}/man --with-configsuffix=.sample
68
CONFIGURE_ARGS=	--with-uid=${DCCUSER} --bindir=${PREFIX}/bin --mandir=${MANPREFIX}/man --with-configsuffix=.sample
72
69
73
.include <bsd.port.pre.mk>
70
.include <bsd.port.options.mk>
74
71
75
SUB_FILES=		pkg-message
72
SUB_FILES=		pkg-install pkg-deinstall pkg-message
76
SUB_LIST+=		WRKSRC=${WRKSRC}
73
SUB_LIST+=		WRKSRC=${WRKSRC} DCCUSER=${DCCUSER} DCCUID=${DCCUID} \
74
			DCCGROUP=${DCCGROUP} DCCGID=${DCCGID} DCCHOME=${DCCHOME}
77
75
78
## /var/dcc home support
76
## /var/dcc home support
79
#
77
#
Lines 86-92 Link Here
86
PLIST_SUB+=		WITH_ALT_HOME="@comment "
84
PLIST_SUB+=		WITH_ALT_HOME="@comment "
87
.endif
85
.endif
88
86
89
SUB_LIST+=		DCCHOME=${DCCHOME}
90
CONFIGURE_ARGS+=	--homedir=${DCCHOME}
87
CONFIGURE_ARGS+=	--homedir=${DCCHOME}
91
88
92
## dccm milter support
89
## dccm milter support
Lines 172-193 Link Here
172
PLIST_SUB+=	WITH_DCCGREY="@comment "
169
PLIST_SUB+=	WITH_DCCGREY="@comment "
173
.endif
170
.endif
174
171
175
## Substitutions in pkg-install and pkg-deinstall
172
.include <bsd.port.pre.mk>
176
#
177
SED_SCRIPT=	-e 's|%%PREFIX%%|${PREFIX}|g' \
178
		-e 's|%%DCCUSER%%|${DCCUSER}|g' -e 's|%%DCCUID%%|${DCCUID}|g' \
179
		-e 's|%%DCCGROUP%%|${DCCGROUP}|g' -e 's|%%DCCGID%%|${DCCGID}|g' \
180
		-e 's|%%DCCHOME%%|${DCCHOME}|g'
181
173
182
pre-everything::
174
pre-everything::
183
	@${ECHO_MSG} ' '
175
	@${ECHO_MSG} ' '
184
	@${ECHO_MSG} 'A description of ALT_HOME may be found in the port's Makefile.'
176
	@${ECHO_MSG} 'A description of ALT_HOME may be found in the port's Makefile.'
185
	@${ECHO_MSG} ' '
177
	@${ECHO_MSG} ' '
186
178
187
post-build:
188
	@${SED} ${SED_SCRIPT} ${PKGDIR}/pkg-install >${PKGINSTALL}
189
	@${SED} ${SED_SCRIPT} ${PKGDIR}/pkg-deinstall >${PKGDEINSTALL}
190
191
pre-install:
179
pre-install:
192
	@${SETENV} PKG_PREFIX=${PREFIX} \
180
	@${SETENV} PKG_PREFIX=${PREFIX} \
193
	${SH} ${PKGINSTALL} ${PREFIX} PRE-INSTALL
181
	${SH} ${PKGINSTALL} ${PREFIX} PRE-INSTALL
(-)pkg-deinstall (-13 lines)
Removed Link Here
1
#!/bin/sh
2
# $FreeBSD: ports/mail/dcc-dccd/pkg-deinstall,v 1.1 2004/11/21 02:35:45 pav Exp $
3
4
if [ "$2" != "POST-DEINSTALL" ]; then
5
	exit 0
6
fi
7
8
DCCUSER=%%DCCUSER%%
9
10
if pw usershow "${DCCUSER}" 2>/dev/null 1>&2; then
11
	echo "To delete ${DCCUSER} user permanently, use 'pw userdel \"${DCCUSER}\"'"
12
fi
13
exit 0
(-)pkg-install (-52 lines)
Removed Link Here
1
#!/bin/sh
2
# $FreeBSD: ports/mail/dcc-dccd/pkg-install,v 1.2 2009/06/15 19:10:40 dhn Exp $
3
4
PREFIX=${PKG_PREFIX:-%%PREFIX%%}
5
6
DCCUSER=%%DCCUSER%%
7
DCCUID=%%DCCUID%%
8
DCCGROUP=%%DCCGROUP%%
9
DCCGID=%%DCCGID%%
10
DCCHOME=%%DCCHOME%%
11
12
if [ "$2" = "PRE-INSTALL" ]; then
13
14
	if ! pw groupshow "$DCCGROUP" 2>/dev/null 1>&2; then
15
		if pw groupadd $DCCGROUP -g $DCCGID; then
16
			echo "=> Added group \"$DCCGROUP\"."
17
		else
18
			echo "=> Adding group \"$DCCGROUP\" failed..."
19
			exit 1
20
		fi
21
	fi
22
23
	if ! pw usershow "$DCCUSER" 2>/dev/null 1>&2; then
24
		if pw useradd $DCCUSER -u $DCCUID -g $DCCGROUP -h - \
25
			-s "/sbin/nologin" -d "$DCCHOME" \
26
			-c "Distributed Checksum Clearinghouse"; \
27
		then
28
			echo "=> Added user \"$DCCUSER\"."
29
		else
30
			echo "=> Adding user \"$DCCUSER\" failed..."
31
			exit 1
32
		fi
33
	fi
34
elif [ "$2" = "POST-INSTALL" ]; then
35
36
	echo "=> Generating unique passwords for your DCC install..."
37
	echo "=>"
38
	echo "=> Note this will make map.sample, map.txt.sample and"
39
	echo "=> ids.sample fail their MD5 checks on package removal."
40
41
	/bin/sh $PREFIX/dcc/libexec/fix-map \
42
	-n .sample \
43
	-I $DCCHOME/ids.sample -i $DCCHOME/ids \
44
	-T $DCCHOME/map.txt.sample -t $DCCHOME/map.txt \
45
	-m $DCCHOME/map
46
47
        for file in ids map map.txt ; do
48
                /bin/cp -p $DCCHOME/$file $DCCHOME/${file}.sample
49
        done
50
fi
51
52
exit 0
(-)pkg-plist (-2 / +2 lines)
Lines 54-63 Link Here
54
%%WITH_ALT_HOME%%@cwd /var
54
%%WITH_ALT_HOME%%@cwd /var
55
@comment -------------------------
55
@comment -------------------------
56
@comment The next group of three-line sets install/remove the config files
56
@comment The next group of three-line sets install/remove the config files
57
@comment 
57
@comment
58
@comment **** on uninstall, delete the config file if it matches the sample file
58
@comment **** on uninstall, delete the config file if it matches the sample file
59
@unexec if cmp -s %D/dcc/dcc_conf %D/dcc/dcc_conf.sample; then rm -f %D/dcc/dcc_conf; fi
59
@unexec if cmp -s %D/dcc/dcc_conf %D/dcc/dcc_conf.sample; then rm -f %D/dcc/dcc_conf; fi
60
@comment 
60
@comment
61
@comment **** the sample file is unilaterally installed/removed
61
@comment **** the sample file is unilaterally installed/removed
62
dcc/dcc_conf.sample
62
dcc/dcc_conf.sample
63
@comment
63
@comment
(-)files/pkg-deinstall.in (+13 lines)
Added Link Here
1
#!/bin/sh
2
# $FreeBSD: ports/mail/dcc-dccd/pkg-deinstall,v 1.1 2004/11/21 02:35:45 pav Exp $
3
4
if [ "$2" != "POST-DEINSTALL" ]; then
5
	exit 0
6
fi
7
8
DCCUSER=%%DCCUSER%%
9
10
if pw usershow "${DCCUSER}" 2>/dev/null 1>&2; then
11
	echo "To delete ${DCCUSER} user permanently, use 'pw userdel \"${DCCUSER}\"'"
12
fi
13
exit 0
(-)files/pkg-install.in (+52 lines)
Added Link Here
1
#!/bin/sh
2
# $FreeBSD: ports/mail/dcc-dccd/pkg-install,v 1.2 2009/06/15 19:10:40 dhn Exp $
3
4
PREFIX=${PKG_PREFIX:-%%PREFIX%%}
5
6
DCCUSER=%%DCCUSER%%
7
DCCUID=%%DCCUID%%
8
DCCGROUP=%%DCCGROUP%%
9
DCCGID=%%DCCGID%%
10
DCCHOME=%%DCCHOME%%
11
12
if [ "$2" = "PRE-INSTALL" ]; then
13
14
	if ! pw groupshow "$DCCGROUP" 2>/dev/null 1>&2; then
15
		if pw groupadd $DCCGROUP -g $DCCGID; then
16
			echo "=> Added group \"$DCCGROUP\"."
17
		else
18
			echo "=> Adding group \"$DCCGROUP\" failed..."
19
			exit 1
20
		fi
21
	fi
22
23
	if ! pw usershow "$DCCUSER" 2>/dev/null 1>&2; then
24
		if pw useradd $DCCUSER -u $DCCUID -g $DCCGROUP -h - \
25
			-s "/sbin/nologin" -d "$DCCHOME" \
26
			-c "Distributed Checksum Clearinghouse"; \
27
		then
28
			echo "=> Added user \"$DCCUSER\"."
29
		else
30
			echo "=> Adding user \"$DCCUSER\" failed..."
31
			exit 1
32
		fi
33
	fi
34
elif [ "$2" = "POST-INSTALL" ]; then
35
36
	echo "=> Generating unique passwords for your DCC install..."
37
	echo "=>"
38
	echo "=> Note this will make map.sample, map.txt.sample and"
39
	echo "=> ids.sample fail their MD5 checks on package removal."
40
41
	/bin/sh $PREFIX/dcc/libexec/fix-map \
42
	-n .sample \
43
	-I $DCCHOME/ids.sample -i $DCCHOME/ids \
44
	-T $DCCHOME/map.txt.sample -t $DCCHOME/map.txt \
45
	-m $DCCHOME/map
46
47
        for file in ids map map.txt ; do
48
                /bin/cp -p $DCCHOME/$file $DCCHOME/${file}.sample
49
        done
50
fi
51
52
exit 0

Return to bug 142811