%global commit 623982a5d63dd2b7b2b9f9295d10d96a56d58894 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global commitdate 20180315 Name: openvpn-auth-script Version: 0 Release: 0.1.%{commitdate}git%{shortcommit}%{?dist} Summary: OpenVPN plugin to auth connections using non-blocking external script License: ASL 2.0 URL: https://github.com/fac/auth-script-openvpn Source0: %{url}/archive/%{shortcommit}/%{name}-%{shortcommit}.tar.gz # Fix compilation flags Patch0: %{name}-0-flags.patch # Fix build with EL 7 (no C99 support in gcc) Patch1: %{name}-0-c99.patch BuildRequires: gcc BuildRequires: openvpn-devel Requires: openvpn %description Runs an external script to decide whether to authenticate a user or not. Useful for checking 2FA on VPN auth attempts as it doesn't block the main openvpn process, unlike passing the script to --auth-user-pass-verify flag. The idea of the plugin is to do as little as possible, and let the external binary do all the heavy lifting itself. %prep %autosetup -n auth-script-openvpn-%{commit} chmod 0644 examples/external_script %build %make_build CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" %install install -Dpm 0755 openvpn-plugin-auth-script.so $RPM_BUILD_ROOT%{_libdir}/openvpn/plugins/openvpn-plugin-auth-script.so %files %doc README.md examples/ %license LICENSE %{_libdir}/openvpn/plugins/openvpn-plugin-auth-script.so %changelog * Sun Jan 06 2019 Mohamed El Morabity - 0-0.1.20180315git623982a - Initial RPM release