On Fri, Jun 19, 2020 at 07:40:56PM -0600, Todd C. Miller wrote:
> I think this addresses all of your comments.  I removed the sudo-logsrv
> sub-package.  Since sudo-python depends on libpython and not the
> rest of the python runtime I switched to using MODPY_LIB_DEPENDS
> instead of MODPY_RUN_DEPENDS.
> 
> BTW, https://www.openbsd.org/faq/ports/guide.html#Ideal may need
> to be updated wrt pseudo-flavors as it doesn't mention BUILD_PACKAGES.
> It mostly treats pseudo-flavors like regular ones.
> 
>  - todd

I think this needs more work with the FLAVORs (see the extra WANTLIB).
$ env FLAVOR="gettext ldap" make port-lib-depends-check
sudo-python-1.9.1-gettext-ldap(security/sudo,-python,gettext,ldap):
Bogus WANTLIB: sudo_util.0 (/usr/local/libexec/sudo/python_plugin.so) (NOT 
REACHABLE)
Extra:  c.96 ssl.48 z.5



> 
> Index: security/sudo/Makefile
> ===================================================================
> RCS file: /cvs/ports/security/sudo/Makefile,v
> retrieving revision 1.38
> diff -u -p -u -r1.38 Makefile
> --- security/sudo/Makefile    30 Jan 2020 18:47:11 -0000      1.38
> +++ security/sudo/Makefile    20 Jun 2020 01:29:59 -0000
> @@ -1,18 +1,20 @@
>  # $OpenBSD: Makefile,v 1.38 2020/01/30 18:47:11 millert Exp $
>  
> -COMMENT=     execute a command as another user
> +COMMENT-main=        execute a command as another user
> +COMMENT-python=      sudo Python plugin
>  
> -DISTNAME=    sudo-1.8.31
> +V=           1.9.1
> +DISTNAME=    sudo-${V}
>  CATEGORIES=  security
>  
> +PKGNAME-main=        sudo-${V}
> +PKGNAME-python=      sudo-python-${V}
> +
>  MAINTAINER=  Todd C. Miller <[email protected]>
>  
>  # ISC-style license
>  PERMIT_PACKAGE=      Yes
>  
> -WANTLIB+=    c util z
> -
> -
>  HOMEPAGE=    https://www.sudo.ws/
>  
>  MASTER_SITES=        https://www.sudo.ws/dist/ \
> @@ -27,24 +29,51 @@ CONFIGURE_ARGS+=  --with-insults \
>                       --with-logfac=authpriv \
>                       --with-libtool=system \
>                       --disable-path-info \
> +                     --enable-openssl \
>                       --enable-zlib=system
>  
>  SHARED_LIBS= sudo_util       0.0
>  
> +PSEUDO_FLAVORS=      no_python
>  FLAVORS=     gettext ldap
>  FLAVOR?=
>  
> +MULTI_PACKAGES=              -main -python
> +MODPY_VERSION=               ${MODPY_DEFAULT_VERSION_3}
> +MODPY_RUNDEP=                No
> +
> +# All sub-packages depend on these libraries
> +WANTLIB=             c util z crypto ssl
> +
> +# The gettext flavor influences LIB_DEPENDS and WANTLIB for all sub-packages
> +.if ${FLAVOR:Mgettext}
> +CONFIGURE_ARGS +=    --enable-nls=${LOCALBASE}
> +LIB_DEPENDS+=                devel/gettext,-runtime
> +WANTLIB+=            iconv intl
> +.else
> +CONFIGURE_ARGS+=     --disable-nls
> +.endif
> +
> +# It is now safe to set sub-package WANTLIB and LIB_DEPENDS
> +WANTLIB-main=                ${WANTLIB}
> +WANTLIB-python=              ${WANTLIB} libexec/sudo/sudo_util \
> +                     ${MODPY_WANTLIB} iconv intl m pthread
> +
> +LIB_DEPENDS-main=    ${LIB_DEPENDS}
> +LIB_DEPENDS-python=  ${LIB_DEPENDS} security/sudo,-main ${MODPY_LIB_DEPENDS}
> +
>  .if ${FLAVOR:Mldap}
>  CONFIGURE_ARGS+=     --with-ldap=${LOCALBASE}
> -LIB_DEPENDS+=                databases/openldap
> -WANTLIB+=            crypto lber-2.4 ldap-2.4 sasl2 ssl
> +LIB_DEPENDS-main+=   databases/openldap
> +WANTLIB-main+=               lber ldap sasl2
>  .endif
> -.if ${FLAVOR:Mgettext}
> -CONFIGURE_ARGS += --enable-nls=${LOCALBASE}
> -LIB_DEPENDS+=        devel/gettext,-runtime
> -WANTLIB+=    iconv intl
> +
> +.include <bsd.port.arch.mk>
> +.if !${BUILD_PACKAGES:M-python}
> +CONFIGURE_ARGS+=     --disable-python
>  .else
> -CONFIGURE_ARGS += --disable-nls
> +CONFIGURE_ARGS+=     --enable-python
> +MODULES=             lang/python
>  .endif
>  
>  # Don't set owner on install in fake mode
> Index: security/sudo/distinfo
> ===================================================================
> RCS file: /cvs/ports/security/sudo/distinfo,v
> retrieving revision 1.29
> diff -u -p -u -r1.29 distinfo
> --- security/sudo/distinfo    30 Jan 2020 18:47:11 -0000      1.29
> +++ security/sudo/distinfo    19 Jun 2020 18:41:00 -0000
> @@ -1,2 +1,2 @@
> -SHA256 (sudo-1.8.31.tar.gz) = fqjZejzuTIROCIfqehvYDrVMyY/XeWZ3bLGoBlOtRU8=
> -SIZE (sudo-1.8.31.tar.gz) = 3350674
> +SHA256 (sudo-1.9.1.tar.gz) = KUEWzv4QoCdzkX/HRA2DhLkllVvJam4Oqhl3yDs0rf8=
> +SIZE (sudo-1.9.1.tar.gz) = 3834744
> Index: security/sudo/pkg/DESCR
> ===================================================================
> RCS file: security/sudo/pkg/DESCR
> diff -N security/sudo/pkg/DESCR
> --- security/sudo/pkg/DESCR   22 Jun 2015 15:52:16 -0000      1.1.1.1
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -1,6 +0,0 @@
> -Sudo (su "do") allows a system administrator to delegate authority
> -to give certain users (or groups of users) the ability to run some
> -(or all) commands as root or another user while providing an audit
> -trail of the commands and their arguments.
> -
> -Sudo is free software, distributed under an ISC-style license.
> Index: security/sudo/pkg/DESCR-main
> ===================================================================
> RCS file: security/sudo/pkg/DESCR-main
> diff -N security/sudo/pkg/DESCR-main
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ security/sudo/pkg/DESCR-main      19 Jun 2020 20:32:16 -0000
> @@ -0,0 +1,4 @@
> +Sudo (su "do") allows a system administrator to delegate authority
> +to give certain users (or groups of users) the ability to run some
> +(or all) commands as root or another user while providing an audit
> +trail of the commands and their arguments.
> Index: security/sudo/pkg/DESCR-python
> ===================================================================
> RCS file: security/sudo/pkg/DESCR-python
> diff -N security/sudo/pkg/DESCR-python
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ security/sudo/pkg/DESCR-python    19 Jun 2020 19:11:01 -0000
> @@ -0,0 +1,3 @@
> +The sudo Python plugin can be used to write sudo 1.9 plugins in
> +Python instead of C.  The API closely follows the C sudo plugin API
> +described by sudo_plugin(5).
> Index: security/sudo/pkg/MESSAGE
> ===================================================================
> RCS file: security/sudo/pkg/MESSAGE
> diff -N security/sudo/pkg/MESSAGE
> --- security/sudo/pkg/MESSAGE 26 May 2018 09:54:51 -0000      1.2
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -1,20 +0,0 @@
> -Please see the ${PREFIX}/share/doc/sudo/UPGRADE file for important
> -information about upgrading from a previous version of sudo.
> -
> -Important user-visible changes compared to the version of sudo that
> -used to be in OpenBSD base (1.7.2p8) include:
> -
> - o The tty_tickets sudoers option is now enabled by default.
> -   To restore the old behavior (single time stamp per user),
> -   add a line like:
> -     Defaults !tty_tickets
> -   to sudoers.
> -
> - o  The HOME and MAIL environment variables are now reset based on the
> -    target user's password database entry when the env_reset sudoers option
> -    is enabled (which is the case in the default configuration).  Users
> -    wishing to preserve the original values should use a sudoers line like:
> -     Defaults env_keep += HOME
> -    to preserve the old value of HOME and
> -     Defaults env_keep += MAIL
> -    to preserve the old value of MAIL.
> Index: security/sudo/pkg/PFRAG.gettext
> ===================================================================
> RCS file: security/sudo/pkg/PFRAG.gettext
> diff -N security/sudo/pkg/PFRAG.gettext
> --- security/sudo/pkg/PFRAG.gettext   10 Jul 2015 15:16:03 -0000      1.1
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -1,53 +0,0 @@
> -@comment $OpenBSD: PFRAG.gettext,v 1.1 2015/07/10 15:16:03 espie Exp $
> -share/locale/ca/LC_MESSAGES/sudo.mo
> -share/locale/ca/LC_MESSAGES/sudoers.mo
> -share/locale/cs/LC_MESSAGES/sudo.mo
> -share/locale/cs/LC_MESSAGES/sudoers.mo
> -share/locale/da/LC_MESSAGES/sudo.mo
> -share/locale/da/LC_MESSAGES/sudoers.mo
> -share/locale/de/LC_MESSAGES/sudo.mo
> -share/locale/de/LC_MESSAGES/sudoers.mo
> -share/locale/el/LC_MESSAGES/sudoers.mo
> -share/locale/eo/LC_MESSAGES/sudo.mo
> -share/locale/eo/LC_MESSAGES/sudoers.mo
> -share/locale/es/LC_MESSAGES/sudo.mo
> -share/locale/eu/LC_MESSAGES/sudo.mo
> -share/locale/eu/LC_MESSAGES/sudoers.mo
> -share/locale/fi/LC_MESSAGES/sudo.mo
> -share/locale/fi/LC_MESSAGES/sudoers.mo
> -share/locale/fr/LC_MESSAGES/sudo.mo
> -share/locale/fr/LC_MESSAGES/sudoers.mo
> -share/locale/gl/LC_MESSAGES/sudo.mo
> -share/locale/hr/LC_MESSAGES/sudo.mo
> -share/locale/hr/LC_MESSAGES/sudoers.mo
> -share/locale/it/LC_MESSAGES/sudo.mo
> -share/locale/it/LC_MESSAGES/sudoers.mo
> -share/locale/ja/LC_MESSAGES/sudo.mo
> -share/locale/ja/LC_MESSAGES/sudoers.mo
> -share/locale/lt/
> -share/locale/lt/LC_MESSAGES/
> -share/locale/lt/LC_MESSAGES/sudoers.mo
> -share/locale/nb/LC_MESSAGES/sudo.mo
> -share/locale/nb/LC_MESSAGES/sudoers.mo
> -share/locale/nl/LC_MESSAGES/sudo.mo
> -share/locale/nl/LC_MESSAGES/sudoers.mo
> -share/locale/pl/LC_MESSAGES/sudo.mo
> -share/locale/pl/LC_MESSAGES/sudoers.mo
> -share/locale/pt_BR/LC_MESSAGES/sudo.mo
> -share/locale/pt_BR/LC_MESSAGES/sudoers.mo
> -share/locale/ru/LC_MESSAGES/sudo.mo
> -share/locale/ru/LC_MESSAGES/sudoers.mo
> -share/locale/sl/LC_MESSAGES/sudo.mo
> -share/locale/sl/LC_MESSAGES/sudoers.mo
> -share/locale/sr/LC_MESSAGES/sudo.mo
> -share/locale/sr/LC_MESSAGES/sudoers.mo
> -share/locale/sv/LC_MESSAGES/sudo.mo
> -share/locale/sv/LC_MESSAGES/sudoers.mo
> -share/locale/tr/LC_MESSAGES/sudo.mo
> -share/locale/tr/LC_MESSAGES/sudoers.mo
> -share/locale/uk/LC_MESSAGES/sudo.mo
> -share/locale/uk/LC_MESSAGES/sudoers.mo
> -share/locale/vi/LC_MESSAGES/sudo.mo
> -share/locale/vi/LC_MESSAGES/sudoers.mo
> -share/locale/zh_CN/LC_MESSAGES/sudo.mo
> -share/locale/zh_CN/LC_MESSAGES/sudoers.mo
> Index: security/sudo/pkg/PFRAG.gettext-main
> ===================================================================
> RCS file: security/sudo/pkg/PFRAG.gettext-main
> diff -N security/sudo/pkg/PFRAG.gettext-main
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ security/sudo/pkg/PFRAG.gettext-main      10 Jul 2015 15:16:03 -0000
> @@ -0,0 +1,53 @@
> +@comment $OpenBSD: PFRAG.gettext,v 1.1 2015/07/10 15:16:03 espie Exp $
> +share/locale/ca/LC_MESSAGES/sudo.mo
> +share/locale/ca/LC_MESSAGES/sudoers.mo
> +share/locale/cs/LC_MESSAGES/sudo.mo
> +share/locale/cs/LC_MESSAGES/sudoers.mo
> +share/locale/da/LC_MESSAGES/sudo.mo
> +share/locale/da/LC_MESSAGES/sudoers.mo
> +share/locale/de/LC_MESSAGES/sudo.mo
> +share/locale/de/LC_MESSAGES/sudoers.mo
> +share/locale/el/LC_MESSAGES/sudoers.mo
> +share/locale/eo/LC_MESSAGES/sudo.mo
> +share/locale/eo/LC_MESSAGES/sudoers.mo
> +share/locale/es/LC_MESSAGES/sudo.mo
> +share/locale/eu/LC_MESSAGES/sudo.mo
> +share/locale/eu/LC_MESSAGES/sudoers.mo
> +share/locale/fi/LC_MESSAGES/sudo.mo
> +share/locale/fi/LC_MESSAGES/sudoers.mo
> +share/locale/fr/LC_MESSAGES/sudo.mo
> +share/locale/fr/LC_MESSAGES/sudoers.mo
> +share/locale/gl/LC_MESSAGES/sudo.mo
> +share/locale/hr/LC_MESSAGES/sudo.mo
> +share/locale/hr/LC_MESSAGES/sudoers.mo
> +share/locale/it/LC_MESSAGES/sudo.mo
> +share/locale/it/LC_MESSAGES/sudoers.mo
> +share/locale/ja/LC_MESSAGES/sudo.mo
> +share/locale/ja/LC_MESSAGES/sudoers.mo
> +share/locale/lt/
> +share/locale/lt/LC_MESSAGES/
> +share/locale/lt/LC_MESSAGES/sudoers.mo
> +share/locale/nb/LC_MESSAGES/sudo.mo
> +share/locale/nb/LC_MESSAGES/sudoers.mo
> +share/locale/nl/LC_MESSAGES/sudo.mo
> +share/locale/nl/LC_MESSAGES/sudoers.mo
> +share/locale/pl/LC_MESSAGES/sudo.mo
> +share/locale/pl/LC_MESSAGES/sudoers.mo
> +share/locale/pt_BR/LC_MESSAGES/sudo.mo
> +share/locale/pt_BR/LC_MESSAGES/sudoers.mo
> +share/locale/ru/LC_MESSAGES/sudo.mo
> +share/locale/ru/LC_MESSAGES/sudoers.mo
> +share/locale/sl/LC_MESSAGES/sudo.mo
> +share/locale/sl/LC_MESSAGES/sudoers.mo
> +share/locale/sr/LC_MESSAGES/sudo.mo
> +share/locale/sr/LC_MESSAGES/sudoers.mo
> +share/locale/sv/LC_MESSAGES/sudo.mo
> +share/locale/sv/LC_MESSAGES/sudoers.mo
> +share/locale/tr/LC_MESSAGES/sudo.mo
> +share/locale/tr/LC_MESSAGES/sudoers.mo
> +share/locale/uk/LC_MESSAGES/sudo.mo
> +share/locale/uk/LC_MESSAGES/sudoers.mo
> +share/locale/vi/LC_MESSAGES/sudo.mo
> +share/locale/vi/LC_MESSAGES/sudoers.mo
> +share/locale/zh_CN/LC_MESSAGES/sudo.mo
> +share/locale/zh_CN/LC_MESSAGES/sudoers.mo
> Index: security/sudo/pkg/PLIST
> ===================================================================
> RCS file: security/sudo/pkg/PLIST
> diff -N security/sudo/pkg/PLIST
> --- security/sudo/pkg/PLIST   31 Dec 2019 21:54:25 -0000      1.7
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -1,47 +0,0 @@
> -@comment $OpenBSD: PLIST,v 1.7 2019/12/31 21:54:25 millert Exp $
> -@bin bin/cvtsudoers
> -@mode 04555
> -@bin bin/sudo
> -@mode
> -bin/sudoedit
> -@bin bin/sudoreplay
> -include/sudo_plugin.h
> -libexec/sudo/
> -libexec/sudo/group_file.la
> -@so libexec/sudo/group_file.so
> -libexec/sudo/libsudo_util.la
> -@lib libexec/sudo/libsudo_util.so.${LIBsudo_util_VERSION}
> -libexec/sudo/sudo_noexec.la
> -@so libexec/sudo/sudo_noexec.so
> -libexec/sudo/sudoers.la
> -@so libexec/sudo/sudoers.so
> -libexec/sudo/system_group.la
> -@so libexec/sudo/system_group.so
> -@man man/man1/cvtsudoers.1
> -@man man/man5/sudo.conf.5
> -@man man/man5/sudoers.5
> -@man man/man5/sudoers_timestamp.5
> -@man man/man8/sudo.8
> -@man man/man8/sudo_plugin.8
> -@man man/man8/sudoedit.8
> -@man man/man8/sudoreplay.8
> -@man man/man8/visudo.8
> -@bin sbin/visudo
> -share/doc/sudo/
> -share/doc/sudo/CONTRIBUTORS
> -share/doc/sudo/ChangeLog
> -share/doc/sudo/HISTORY
> -share/doc/sudo/LICENSE
> -share/doc/sudo/NEWS
> -share/doc/sudo/README
> -share/doc/sudo/TROUBLESHOOTING
> -share/doc/sudo/UPGRADE
> -share/examples/sudo/
> -share/examples/sudo/sudo.conf
> -share/examples/sudo/sudoers
> -share/examples/sudo/sudoers.OpenBSD
> -@mode 0440
> -@sample ${SYSCONFDIR}/sudoers
> -@mode
> -share/examples/sudo/syslog.conf
> -%%gettext%%
> Index: security/sudo/pkg/PLIST-main
> ===================================================================
> RCS file: security/sudo/pkg/PLIST-main
> diff -N security/sudo/pkg/PLIST-main
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ security/sudo/pkg/PLIST-main      20 Jun 2020 00:59:14 -0000
> @@ -0,0 +1,61 @@
> +@comment $OpenBSD: PLIST,v 1.7 2019/12/31 21:54:25 millert Exp $
> +@rcscript ${RCDIR}/sudo_logsrvd
> +@bin bin/cvtsudoers
> +@mode 04555
> +@bin bin/sudo
> +@mode
> +bin/sudoedit
> +@bin bin/sudoreplay
> +include/sudo_plugin.h
> +libexec/sudo/
> +libexec/sudo/audit_json.la
> +@so libexec/sudo/audit_json.so
> +libexec/sudo/group_file.la
> +@so libexec/sudo/group_file.so
> +libexec/sudo/libsudo_util.la
> +@lib libexec/sudo/libsudo_util.so.${LIBsudo_util_VERSION}
> +libexec/sudo/sample_approval.la
> +@so libexec/sudo/sample_approval.so
> +libexec/sudo/sudo_noexec.la
> +@so libexec/sudo/sudo_noexec.so
> +libexec/sudo/sudoers.la
> +@so libexec/sudo/sudoers.so
> +libexec/sudo/system_group.la
> +@so libexec/sudo/system_group.so
> +@man man/man1/cvtsudoers.1
> +@man man/man5/sudo.conf.5
> +@man man/man5/sudo_logsrv.proto.5
> +@man man/man5/sudo_logsrvd.conf.5
> +@man man/man5/sudoers.5
> +@man man/man5/sudoers_timestamp.5
> +@man man/man8/sudo.8
> +@man man/man8/sudo_logsrvd.8
> +@man man/man8/sudo_plugin.8
> +@man man/man8/sudo_sendlog.8
> +@man man/man8/sudoedit.8
> +@man man/man8/sudoreplay.8
> +@man man/man8/visudo.8
> +@bin sbin/sudo_logsrvd
> +@bin sbin/sudo_sendlog
> +@bin sbin/visudo
> +share/doc/sudo/
> +share/doc/sudo/CONTRIBUTORS
> +share/doc/sudo/ChangeLog
> +share/doc/sudo/HISTORY
> +share/doc/sudo/LICENSE
> +share/doc/sudo/NEWS
> +share/doc/sudo/README
> +share/doc/sudo/TROUBLESHOOTING
> +share/doc/sudo/UPGRADE
> +share/examples/sudo/
> +share/examples/sudo/sudo.conf
> +share/examples/sudo/sudo_logsrvd.conf
> +share/examples/sudo/sudoers
> +share/examples/sudo/sudoers.OpenBSD
> +share/examples/sudo/syslog.conf
> +@mode 0440
> +@sample ${SYSCONFDIR}/sudoers
> +@mode
> +@sample ${SYSCONFDIR}/sudo.conf
> +@sample ${SYSCONFDIR}/sudo_logsrvd.conf
> +%%gettext%%
> Index: security/sudo/pkg/PLIST-python
> ===================================================================
> RCS file: security/sudo/pkg/PLIST-python
> diff -N security/sudo/pkg/PLIST-python
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ security/sudo/pkg/PLIST-python    19 Jun 2020 20:24:42 -0000
> @@ -0,0 +1,11 @@
> +@comment $OpenBSD: PLIST-python,v$
> +libexec/sudo/python_plugin.la
> +@so libexec/sudo/python_plugin.so
> +@man man/man8/sudo_plugin_python.8
> +share/examples/sudo/example_approval_plugin.py
> +share/examples/sudo/example_audit_plugin.py
> +share/examples/sudo/example_conversation.py
> +share/examples/sudo/example_debugging.py
> +share/examples/sudo/example_group_plugin.py
> +share/examples/sudo/example_io_plugin.py
> +share/examples/sudo/example_policy_plugin.py
> Index: security/sudo/pkg/sudo_logsrvd.rc
> ===================================================================
> RCS file: security/sudo/pkg/sudo_logsrvd.rc
> diff -N security/sudo/pkg/sudo_logsrvd.rc
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ security/sudo/pkg/sudo_logsrvd.rc 19 Jun 2020 19:54:06 -0000
> @@ -0,0 +1,9 @@
> +#!/bin/ksh
> +#
> +# $OpenBSD$
> +
> +daemon="${TRUEPREFIX}/sbin/sudo_logsrvd"
> +
> +. /etc/rc.d/rc.subr
> +
> +rc_cmd $1
> 

-- 
Antoine

Reply via email to