2013-01-16 16:42:06 +01:00
|
|
|
# Created by: erich@rrnet.com
|
1999-08-31 03:53:22 +02:00
|
|
|
# $FreeBSD$
|
1995-09-22 15:52:51 +02:00
|
|
|
|
2000-04-09 20:34:06 +02:00
|
|
|
PORTNAME= sudo
|
2013-06-28 02:58:49 +02:00
|
|
|
DISTVERSION= 1.8.7
|
2013-07-05 20:46:33 +02:00
|
|
|
PORTREVISION= 1
|
1996-11-12 01:05:35 +01:00
|
|
|
CATEGORIES= security
|
2011-11-09 18:18:43 +01:00
|
|
|
MASTER_SITES= ${MASTER_SITE_SUDO}
|
1995-09-22 15:52:51 +02:00
|
|
|
|
2009-10-12 19:55:26 +02:00
|
|
|
MAINTAINER= wxs@FreeBSD.org
|
2003-03-07 07:14:21 +01:00
|
|
|
COMMENT= Allow others to run commands as root
|
1996-02-16 11:38:03 +01:00
|
|
|
|
2012-03-01 03:06:48 +01:00
|
|
|
LICENSE= sudo
|
|
|
|
LICENSE_NAME= Sudo license
|
|
|
|
LICENSE_FILE= ${WRKSRC}/doc/LICENSE
|
|
|
|
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
|
|
|
|
|
2010-01-04 22:28:22 +01:00
|
|
|
MAKE_JOBS_SAFE= yes
|
1997-10-22 10:46:03 +02:00
|
|
|
GNU_CONFIGURE= yes
|
2012-09-27 04:57:50 +02:00
|
|
|
LDFLAGS+= -lgcc
|
2012-09-27 15:44:01 +02:00
|
|
|
LDFLAGS+= -lssp_nonshared
|
1999-03-08 17:27:29 +01:00
|
|
|
|
2004-01-30 04:33:21 +01:00
|
|
|
CONFIGURE_ARGS= --sysconfdir=${PREFIX}/etc \
|
1999-03-08 17:27:29 +01:00
|
|
|
--with-ignore-dot \
|
|
|
|
--with-tty-tickets \
|
|
|
|
--with-env-editor \
|
2000-04-18 01:08:30 +02:00
|
|
|
--with-logincap \
|
2012-10-11 15:36:47 +02:00
|
|
|
--with-long-otp-prompt
|
1999-03-08 17:27:29 +01:00
|
|
|
|
2012-06-19 03:38:09 +02:00
|
|
|
OPTIONS_DEFINE= LDAP INSULTS DISABLE_ROOT_SUDO DISABLE_AUTH NOARGS_SHELL \
|
|
|
|
AUDIT OPIE NLS
|
|
|
|
OPTIONS_DEFAULT= AUDIT NLS
|
|
|
|
|
2012-06-21 15:01:13 +02:00
|
|
|
INSULTS_DESC= Enable insults on failures
|
2012-06-19 03:38:09 +02:00
|
|
|
DISABLE_ROOT_SUDO_DESC= Do not allow root to run sudo
|
|
|
|
DISABLE_AUTH_DESC= Do not require authentication by default
|
|
|
|
NOARGS_SHELL_DESC= Run a shell if no arguments are given
|
|
|
|
AUDIT_DESC= Enable BSM audit support
|
2012-10-11 15:36:47 +02:00
|
|
|
OPIE_DESC= Enable one-time passwords (no PAM support)
|
2006-04-28 21:34:09 +02:00
|
|
|
|
2010-01-04 22:28:22 +01:00
|
|
|
LOGFAC?= local2
|
2011-04-10 03:39:49 +02:00
|
|
|
CONFIGURE_ARGS+= --with-logfac=${LOGFAC}
|
2010-01-04 22:28:22 +01:00
|
|
|
|
2012-06-19 03:38:09 +02:00
|
|
|
# This is intentionally not an option.
|
|
|
|
# SUDO_SECURE_PATH is a PATH string that will override the user's PATH.
|
|
|
|
# ex: make SUDO_SECURE_PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"
|
|
|
|
.if defined(SUDO_SECURE_PATH)
|
|
|
|
CONFIGURE_ARGS+= --with-secure-path="${SUDO_SECURE_PATH}"
|
|
|
|
.endif
|
|
|
|
|
2011-09-07 03:30:26 +02:00
|
|
|
.include <bsd.port.options.mk>
|
2001-09-29 03:15:23 +02:00
|
|
|
|
2013-05-05 00:30:31 +02:00
|
|
|
.if ${ARCH} == "arm"
|
|
|
|
CONFIGURE_ARGS+= --disable-pie
|
|
|
|
.endif
|
|
|
|
|
2012-06-19 03:38:09 +02:00
|
|
|
.if ${PORT_OPTIONS:MNLS}
|
2013-04-24 20:10:30 +02:00
|
|
|
USES+= gettext
|
2011-09-24 00:26:39 +02:00
|
|
|
LDFLAGS+= -L${LOCALBASE}/lib -lintl
|
|
|
|
CFLAGS+= -I${LOCALBASE}/include
|
2011-09-06 20:07:33 +02:00
|
|
|
PLIST_SUB+= NLS=""
|
|
|
|
.else
|
|
|
|
CONFIGURE_ARGS+= --disable-nls
|
|
|
|
PLIST_SUB+= NLS="@comment "
|
|
|
|
.endif
|
|
|
|
|
2012-06-19 03:38:09 +02:00
|
|
|
.if ${PORT_OPTIONS:MINSULTS}
|
2011-04-10 03:39:49 +02:00
|
|
|
CONFIGURE_ARGS+= --with-insults
|
|
|
|
CONFIGURE_ARGS+= --with-all-insults
|
2007-05-02 20:47:16 +02:00
|
|
|
.endif
|
|
|
|
|
2012-06-19 03:38:09 +02:00
|
|
|
.if ${PORT_OPTIONS:MLDAP}
|
2011-04-10 03:39:49 +02:00
|
|
|
USE_OPENLDAP= yes
|
|
|
|
CONFIGURE_ARGS+= --with-ldap=${PREFIX}
|
|
|
|
SUDO_LDAP_CONF?= ldap.conf
|
|
|
|
CONFIGURE_ARGS+= --with-ldap-conf-file=${PREFIX}/etc/${SUDO_LDAP_CONF}
|
2007-07-21 05:15:13 +02:00
|
|
|
PLIST_SUB+= LDAP=""
|
2010-01-04 22:28:22 +01:00
|
|
|
MAN5+= sudoers.ldap.5
|
2001-06-22 10:48:47 +02:00
|
|
|
.else
|
2011-09-06 20:07:33 +02:00
|
|
|
PLIST_SUB+= LDAP="@comment "
|
2001-06-22 10:48:47 +02:00
|
|
|
.endif
|
|
|
|
|
2012-06-19 03:38:09 +02:00
|
|
|
.if ${PORT_OPTIONS:MDISABLE_ROOT_SUDO}
|
2009-06-12 02:46:49 +02:00
|
|
|
CONFIGURE_ARGS+=--disable-root-sudo
|
|
|
|
.endif
|
|
|
|
|
2012-06-19 03:38:09 +02:00
|
|
|
.if ${PORT_OPTIONS:MDISABLE_AUTH}
|
2012-10-11 15:36:47 +02:00
|
|
|
CONFIGURE_ARGS+= --disable-authentication
|
2009-06-12 02:46:49 +02:00
|
|
|
.endif
|
|
|
|
|
2012-06-19 03:38:09 +02:00
|
|
|
.if ${PORT_OPTIONS:MNOARGS_SHELL}
|
2012-10-11 15:36:47 +02:00
|
|
|
CONFIGURE_ARGS+= --enable-noargs-shell
|
2009-06-12 02:46:49 +02:00
|
|
|
.endif
|
|
|
|
|
2012-06-19 03:38:09 +02:00
|
|
|
.if ${PORT_OPTIONS:MAUDIT}
|
2012-10-11 15:36:47 +02:00
|
|
|
CONFIGURE_ARGS+= --with-bsm-audit
|
2011-05-13 16:30:35 +02:00
|
|
|
.endif
|
|
|
|
|
2012-06-19 03:38:09 +02:00
|
|
|
.if ${PORT_OPTIONS:MOPIE}
|
2012-10-11 15:36:47 +02:00
|
|
|
CONFIGURE_ARGS+= --with-opie
|
|
|
|
.else
|
|
|
|
CONFIGURE_ARGS+= --with-pam
|
2012-06-19 03:38:09 +02:00
|
|
|
.endif
|
|
|
|
|
2013-06-28 02:58:49 +02:00
|
|
|
MAN5+= sudoers.5 sudo.conf.5
|
2011-04-10 03:39:49 +02:00
|
|
|
MAN8= sudo.8 visudo.8 sudoreplay.8 sudo_plugin.8
|
2004-08-20 08:49:35 +02:00
|
|
|
MLINKS= sudo.8 sudoedit.8
|
1995-09-22 15:52:51 +02:00
|
|
|
|
2010-08-16 04:16:26 +02:00
|
|
|
post-patch:
|
2010-10-25 01:34:11 +02:00
|
|
|
@${REINPLACE_CMD} -E '/install-(binaries|noexec):/,/^$$/ \
|
|
|
|
s/\$$\(INSTALL\)/& ${STRIP}/;s/-b\~/-b ~/' \
|
2011-04-10 03:39:49 +02:00
|
|
|
${WRKSRC}/src/Makefile.in
|
2012-02-06 03:47:25 +01:00
|
|
|
@${REINPLACE_CMD} -e 's,$$(srcdir)/sudoers2ldif $$(DESTDIR)$$(docdir),$$(srcdir)/sudoers2ldif $$(DESTDIR)$$(bindir),' ${WRKSRC}/plugins/sudoers/Makefile.in
|
2013-01-16 16:42:06 +01:00
|
|
|
.if ! ${PORT_OPTIONS:MDOCS}
|
2011-04-10 03:39:49 +02:00
|
|
|
@${REINPLACE_CMD} -e 's/mkinstalldirs $$(DESTDIR)$$(docdir)/mkinstalldirs/' \
|
|
|
|
${WRKSRC}/doc/Makefile.in
|
|
|
|
@${REINPLACE_CMD} -e '/for f in $$(OTHER_DOCS); do/d;/@LDAP@for f in $$(OTHER_DOCS_LDAP); do/d' ${WRKSRC}/doc/Makefile.in
|
|
|
|
@${REINPLACE_CMD} -e 's/$$(DESTDIR)$$(sudoersdir) $$(DESTDIR)$$(docdir)/$$(DESTDIR)$$(sudoersdir)/' ${WRKSRC}/plugins/sudoers/Makefile.in
|
2007-07-21 05:15:13 +02:00
|
|
|
.endif
|
1999-12-10 20:51:09 +01:00
|
|
|
|
2010-08-16 04:16:26 +02:00
|
|
|
post-install:
|
2010-08-22 03:58:33 +02:00
|
|
|
${INSTALL_DATA} ${FILESDIR}/pam.conf ${PREFIX}/etc/pam.d/sudo.default
|
|
|
|
if [ ! -f ${PREFIX}/etc/pam.d/sudo ]; then \
|
|
|
|
${CP} -p ${PREFIX}/etc/pam.d/sudo.default \
|
|
|
|
${PREFIX}/etc/pam.d/sudo ; \
|
|
|
|
fi
|
2010-08-16 04:16:26 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/sudoers ]; then \
|
|
|
|
${CP} -p ${PREFIX}/etc/sudoers.sample ${PREFIX}/etc/sudoers; \
|
|
|
|
fi
|
2011-04-11 18:50:19 +02:00
|
|
|
${TOUCH} ${PREFIX}/etc/sudoers.d/.keep-me
|
2010-08-16 04:16:26 +02:00
|
|
|
|
2012-09-27 15:44:01 +02:00
|
|
|
.include <bsd.port.mk>
|