summaryrefslogtreecommitdiff
path: root/net/uucp/Makefile
blob: 9f4ffd082ca1be9fe24117a46801a6cbc4f1a7f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# $NetBSD: Makefile,v 1.14 2012/03/02 16:47:10 hans Exp $

DISTNAME=	uucp-1.07
PKGREVISION=	6
CATEGORIES=	net
MASTER_SITES=	${MASTER_SITE_GNU:=uucp/}

MAINTAINER=	pkgsrc-users@NetBSD.org
COMMENT=	Taylor UUCP
HOMEPAGE=	http://www.airs.com/ian/uucp.html

PKG_DESTDIR_SUPPORT=	user-destdir

USE_TOOLS+=	mkdir:run pwd:run rmdir:run
USE_FEATURES+=	cdefs

.include "../../mk/bsd.prefs.mk"

PKG_SYSCONFSUBDIR=	uucp
GNU_CONFIGURE=		yes
CONFIGURE_ARGS+=	--with-user=${UUCP_USER}
CONFIGURE_ARGS+=	--with-newconfigdir=${PKG_SYSCONFDIR:Q}
CONFIGURE_ARGS+=	--with-oldconfigdir=${PKG_SYSCONFDIR:Q}
CONFIGURE_ENV+=		MKDIR_PROGRAM=${TOOLS_MKDIR:Q}
CONFIGURE_ENV+=		PWD_PROGRAM=${TOOLS_PWD_CMD:Q}
CONFIGURE_ENV+=		RMDIR_PROGRAM=${TOOLS_RMDIR:Q}

PKG_GROUPS=	${UUCP_GROUP}
PKG_USERS=	${UUCP_USER}:${UUCP_GROUP}

PKG_GROUPS_VARS+=	UUCP_GROUP
PKG_USERS_VARS+=	UUCP_USER

PKG_GECOS.${UUCP_USER}=	UNIX-to-UNIX Copy
PKG_HOMES.${UUCP_USER}=	${UUCP_PUBDIR}
PKG_SHELL.${UUCP_USER}=	${PREFIX}/sbin/uucico

INFO_FILES=	# PLIST

# UUCP installs many set-uid "uucp" binaries.
SPECIAL_PERMS+=	bin/cu ${UUCP_USER} ${BINGRP} 4555
SPECIAL_PERMS+=	bin/uucp ${UUCP_USER} ${BINGRP} 4555
SPECIAL_PERMS+=	bin/uuname ${UUCP_USER} ${BINGRP} 4555
SPECIAL_PERMS+=	bin/uustat ${UUCP_USER} ${BINGRP} 4555
SPECIAL_PERMS+=	bin/uux ${UUCP_USER} ${BINGRP} 4555
SPECIAL_PERMS+=	sbin/uucico ${UUCP_USER} ${BINGRP} 4555
SPECIAL_PERMS+=	sbin/uuxqt ${UUCP_USER} ${BINGRP} 4555

SENDMAIL?=	/usr/sbin/sendmail

UUCP_MAIL_PROGRAM?=	${SENDMAIL} -t
UUCP_CMDPATH?=		/bin /usr/bin ${PREFIX}/bin
UUCP_LOCKDIR?=		${VARBASE}/spool/lock
UUCP_SPOOLDIR?=		${VARBASE}/spool/uucp
UUCP_PUBDIR?=		${UUCP_SPOOLDIR}public
UUCP_LOGFILE?=		${UUCP_SPOOLDIR}/Log
UUCP_STATFILE?=		${UUCP_SPOOLDIR}/Stats
UUCP_DEBUGFILE?=	${UUCP_SPOOLDIR}/Debug

OWN_DIRS_PERMS=		${UUCP_LOCKDIR} ${UUCP_USER} ${UUCP_GROUP} 0755
OWN_DIRS_PERMS+=	${UUCP_SPOOLDIR} ${UUCP_USER} ${UUCP_GROUP} 0755
OWN_DIRS_PERMS+=	${UUCP_PUBDIR} ${UUCP_USER} ${UUCP_GROUP} 1777

SUBST_CLASSES+=		nbsd
SUBST_STAGE.nbsd=	post-configure
SUBST_MESSAGE.nbsd=	Fixing Makefiles for rmail and uucpd.
SUBST_FILES.nbsd=	rmail/Makefile uucpd/Makefile
SUBST_FILES.nbsd+=	uucpd/pathnames.h uucpd/uucpd.8
SUBST_VARS.nbsd=	PREFIX PKGMANDIR UUCPD_CPPFLAGS UUCPD_LIBS	\
			INSTALL_PROGRAM INSTALL_MAN

# The necessary libraries and compiler flags for building uucpd are
# platform-specific.
#
UUCPD_CPPFLAGS.${OPSYS}=	# empty
.if exists(/usr/include/utmp.h)
UUCPD_CPPFLAGS.${OPSYS}+=	-DSUPPORT_UTMP
.endif
.if exists(/usr/include/utmpx.h)
UUCPD_CPPFLAGS.${OPSYS}+=	-DSUPPORT_UTMPX
.endif
UUCPD_CPPFLAGS.Darwin=	-DSUPPORT_UTMP
UUCPD_CPPFLAGS.*=	# empty
UUCPD_LIBS.Darwin=	# empty
UUCPD_LIBS.*=		-lcrypt -lutil
OPSYSVARS+=		UUCPD_CPPFLAGS UUCPD_LIBS

INSTALLATION_DIRS=	bin libexec ${PKGMANDIR}/man8 share/examples/uucp

post-extract:
	${CP} -R ${FILESDIR}/rmail ${WRKSRC}
	${CP} -R ${FILESDIR}/uucpd ${WRKSRC}

# Generate a policy_local.h header file that holds the paths used by UUCP.
post-configure:
	@${RM} -f ${WRKSRC}/policy_local.h
.for _var_ in	MAIL_PROGRAM	CMDPATH		LOCKDIR			\
		SPOOLDIR	PUBDIR		LOGFILE			\
		STATFILE	DEBUGFILE
	@${ECHO} "#define ${_var_}	\""${UUCP_${_var_}:Q}"\""	\
		>> ${WRKSRC}/policy_local.h
.endfor

post-install:
	cd ${FILESDIR}/etc; for f in [a-z]*; do				\
		${TEST} -f $$f || continue;				\
		${INSTALL_DATA} $$f ${DESTDIR}${PREFIX}/share/examples/uucp;	\
	done

.include "../../mk/bsd.pkg.mk"