git: 8db220ac1a80 - main - New port: security/duo_openvpn:

Ryan Steinmetz zi at FreeBSD.org
Thu May 6 23:13:08 UTC 2021


The branch main has been updated by zi:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8db220ac1a80b30f99cecdfd222a6b1254c4b00e

commit 8db220ac1a80b30f99cecdfd222a6b1254c4b00e
Author:     Ryan Steinmetz <zi at FreeBSD.org>
AuthorDate: 2021-05-06 23:12:22 +0000
Commit:     Ryan Steinmetz <zi at FreeBSD.org>
CommitDate: 2021-05-06 23:12:22 +0000

    New port: security/duo_openvpn:
    
    Duo provides simple two-factor authentication as a service via:
    
        1.  Phone callback
        2.  SMS-delivered one-time passcodes
        3.  Duo mobile app to generate one-time passcodes
        4.  Duo mobile app for smartphone push authentication
        5.  Duo hardware token to generate one-time passcodes
    
    Duo two-factor authentication for OpenVPN
    
    WWW: https://github.com/duosecurity/duo_openvpn
---
 security/duo_openvpn/Makefile                    | 53 ++++++++++++++++++++++++
 security/duo_openvpn/distinfo                    |  3 ++
 security/duo_openvpn/files/patch-Makefile        |  8 ++++
 security/duo_openvpn/files/patch-duo__openvpn.py | 12 ++++++
 security/duo_openvpn/files/pkg-message.in        | 13 ++++++
 security/duo_openvpn/pkg-descr                   | 11 +++++
 security/duo_openvpn/pkg-plist                   |  6 +++
 7 files changed, 106 insertions(+)

diff --git a/security/duo_openvpn/Makefile b/security/duo_openvpn/Makefile
new file mode 100644
index 000000000000..09cc5bab9d44
--- /dev/null
+++ b/security/duo_openvpn/Makefile
@@ -0,0 +1,53 @@
+# Created by: Ryan Steinmetz <zi at FreeBSD.org>
+
+PORTNAME=	duo_openvpn
+PORTVERSION=	2.4
+CATEGORIES=	security
+
+MAINTAINER=	zi at FreeBSD.org
+COMMENT=	Duo two-factor authentication for OpenVPN
+
+LICENSE=	GPLv2
+
+RUN_DEPENDS=	openvpn>0:security/openvpn
+
+USES=		gmake
+USE_GITHUB=	yes
+GH_ACCOUNT=	duosecurity
+
+CFLAGS+=	-DPREFIX='\"${DATADIR}\"'
+
+SUB_FILES=	pkg-message
+
+OPTIONS_SINGLE=	HELPER
+OPTIONS_SINGLE_HELPER=	PERL PYTHON
+OPTIONS_DEFAULT=PERL
+OPTIONS_SUB=	yes
+
+PERL_USES=		perl5
+PERL_VARS=		USE_PERL5=run CFLAGS+=-DUSE_PERL
+PERL_RUN_DEPENDS=	p5-JSON-XS>0:converters/p5-JSON-XS \
+			p5-libwww>0:www/p5-libwww \
+			p5-LWP-Protocol-https>0:www/p5-LWP-Protocol-https \
+			p5-Digest-HMAC>0:security/p5-Digest-HMAC
+PYTHON_USES=		python:3.7+,run
+
+.include <bsd.port.options.mk>
+
+post-patch:
+	${REINPLACE_CMD} 's|%%SHEBANG%%|${PYTHON_CMD}|' ${WRKSRC}/duo_openvpn.py
+
+do-install:
+	@${MKDIR} ${STAGEDIR}${DATADIR}
+	${INSTALL_LIB} ${WRKSRC}/duo_openvpn.so ${STAGEDIR}${DATADIR}
+	${INSTALL_DATA} ${WRKSRC}/ca_certs.pem ${STAGEDIR}${DATADIR}
+
+do-install-PERL-on:
+	${INSTALL_SCRIPT} ${WRKSRC}/duo_openvpn.pl ${STAGEDIR}${DATADIR}
+
+do-install-PYTHON-on:
+	${INSTALL_SCRIPT} ${WRKSRC}/duo_openvpn.py ${STAGEDIR}${DATADIR}
+	${INSTALL_SCRIPT} ${WRKSRC}/https_wrapper.py ${STAGEDIR}${DATADIR}
+	${INSTALL_SCRIPT} ${WRKSRC}/six.py ${STAGEDIR}${DATADIR}
+
+.include <bsd.port.mk>
diff --git a/security/duo_openvpn/distinfo b/security/duo_openvpn/distinfo
new file mode 100644
index 000000000000..5338049be180
--- /dev/null
+++ b/security/duo_openvpn/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1620320015
+SHA256 (duosecurity-duo_openvpn-2.4_GH0.tar.gz) = a15c2534fb63f8a5b0130e59fc8c6189c2511a49f161fa9dbf415485aa21b962
+SIZE (duosecurity-duo_openvpn-2.4_GH0.tar.gz) = 35768
diff --git a/security/duo_openvpn/files/patch-Makefile b/security/duo_openvpn/files/patch-Makefile
new file mode 100644
index 000000000000..240ce139c1fb
--- /dev/null
+++ b/security/duo_openvpn/files/patch-Makefile
@@ -0,0 +1,8 @@
+--- Makefile.orig	2021-05-06 18:10:21 UTC
++++ Makefile
+@@ -1,5 +1,3 @@
+-PREFIX=/opt/duo
+-CFLAGS += -DPREFIX='"$(PREFIX)"'
+ 
+ ifdef USE_PERL
+ CFLAGS += -DUSE_PERL
diff --git a/security/duo_openvpn/files/patch-duo__openvpn.py b/security/duo_openvpn/files/patch-duo__openvpn.py
new file mode 100644
index 000000000000..f1872659cf27
--- /dev/null
+++ b/security/duo_openvpn/files/patch-duo__openvpn.py
@@ -0,0 +1,12 @@
+--- duo_openvpn.py.orig	2021-05-06 18:37:22 UTC
++++ duo_openvpn.py
+@@ -1,8 +1,4 @@
+-#!/bin/sh
+-''''which python3  >/dev/null 2>&1 && exec python3  "$0" "$@" # '''
+-''''which python  >/dev/null 2>&1 && exec python  "$0" "$@" # '''
+-''''which python2 >/dev/null 2>&1 && exec python2 "$0" "$@" # '''
+-''''exec echo "Error: No python module found in system"# '''
++#!%%SHEBANG%%
+ #
+ # duo_openvpn.py
+ # Duo OpenVPN
diff --git a/security/duo_openvpn/files/pkg-message.in b/security/duo_openvpn/files/pkg-message.in
new file mode 100644
index 000000000000..b3154f8a88cb
--- /dev/null
+++ b/security/duo_openvpn/files/pkg-message.in
@@ -0,0 +1,13 @@
+[
+{ type: install
+  message: <<EOM
+After creating a new protected OpenVPN application in your duo
+admin panel, add the following to your openvpn configuration file:
+
+plugin %%DATADIR%%/duo_openvpn.so 'IKEY SKEY HOST'
+
+For more detailed installation instructions, please visit:
+https://duo.com/docs/openvpn
+EOM
+}
+]
diff --git a/security/duo_openvpn/pkg-descr b/security/duo_openvpn/pkg-descr
new file mode 100644
index 000000000000..d81dbcc8cb08
--- /dev/null
+++ b/security/duo_openvpn/pkg-descr
@@ -0,0 +1,11 @@
+Duo provides simple two-factor authentication as a service via:
+
+    1.  Phone callback
+    2.  SMS-delivered one-time passcodes
+    3.  Duo mobile app to generate one-time passcodes
+    4.  Duo mobile app for smartphone push authentication
+    5.  Duo hardware token to generate one-time passcodes
+
+Duo two-factor authentication for OpenVPN
+
+WWW: https://github.com/duosecurity/duo_openvpn
diff --git a/security/duo_openvpn/pkg-plist b/security/duo_openvpn/pkg-plist
new file mode 100644
index 000000000000..0e32281dc386
--- /dev/null
+++ b/security/duo_openvpn/pkg-plist
@@ -0,0 +1,6 @@
+%%DATADIR%%/ca_certs.pem
+%%PERL%%%%DATADIR%%/duo_openvpn.pl
+%%PYTHON%%%%DATADIR%%/duo_openvpn.py
+%%PYTHON%%%%DATADIR%%/https_wrapper.py
+%%PYTHON%%%%DATADIR%%/six.py
+%%DATADIR%%/duo_openvpn.so


More information about the dev-commits-ports-all mailing list