From 08baef3396c06774a62087abd7b045c7e53fa6eb Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sat, 6 Jan 2024 08:17:56 +0100 Subject: [PATCH] switch to /run [release 2.3.3-4mamba;Wed May 07 2014] --- README.md | 4 ++ openvpn-tmpfiles.d | 1 + openvpn.spec | 135 +++++++++++++++++++++++++++++++++++++++++++++ openvpn@.service | 13 +++++ 4 files changed, 153 insertions(+) create mode 100644 openvpn-tmpfiles.d create mode 100644 openvpn.spec create mode 100644 openvpn@.service diff --git a/README.md b/README.md index b4b7777..75e1a95 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,6 @@ # openvpn +OpenVPN is a full-featured SSL VPN solution which can accomodate a wide range of configurations, including remote access, site-to-site VPNs, WiFi security, and enterprise-scale remote access solutions with load balancing, failover, and fine-grained access-controls. +OpenVPN implements OSI layer 2 or 3 secure network extension using the industry standard SSL/TLS protocol, supports flexible client authentication methods based on certificates, smart cards, and/or 2-factor authentication, and allows user or group-specific access control policies using firewall rules applied to the VPN virtual interface. +OpenVPN is not a web application proxy and does not operate through a web browser. + diff --git a/openvpn-tmpfiles.d b/openvpn-tmpfiles.d new file mode 100644 index 0000000..9cffe2c --- /dev/null +++ b/openvpn-tmpfiles.d @@ -0,0 +1 @@ +d /run/openvpn 0755 root root - diff --git a/openvpn.spec b/openvpn.spec new file mode 100644 index 0000000..414d546 --- /dev/null +++ b/openvpn.spec @@ -0,0 +1,135 @@ +Name: openvpn +Version: 2.3.3 +Release: 4mamba +Summary: A full-featured SSL VPN solution which can accomodate a wide range of configurations +Group: Network/Security +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: http://openvpn.net/ +Source: http://swupdate.openvpn.org/community/releases/openvpn-%{version}.tar.gz +Source1: openvpn@.service +Source2: openvpn-tmpfiles.d +License: GPL +BuildRoot: %{_tmppath}/%{name}-%{version}-root +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: liblzo-devel +BuildRequires: libopenssl-devel +BuildRequires: libpam-devel +BuildRequires: libperl +BuildRequires: perl-Authen-PAM +## AUTOBUILDREQ-END +BuildRequires: easy-rsa +Requires: openssl + +%description +OpenVPN is a full-featured SSL VPN solution which can accomodate a wide range of configurations, including remote access, site-to-site VPNs, WiFi security, and enterprise-scale remote access solutions with load balancing, failover, and fine-grained access-controls. +OpenVPN implements OSI layer 2 or 3 secure network extension using the industry standard SSL/TLS protocol, supports flexible client authentication methods based on certificates, smart cards, and/or 2-factor authentication, and allows user or group-specific access control policies using firewall rules applied to the VPN virtual interface. +OpenVPN is not a web application proxy and does not operate through a web browser. + +%prep +%setup -q + +%build +%configure +%make + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%makeinstall + +#install -m0755 -D distro/rpm/openvpn.init.d.rhel %{buildroot}%{_initrddir}/openvpn + +install -d %{buildroot}%{_sysconfdir}/openvpn +cp -a %{_datadir}/easy-rsa %{buildroot}%{_sysconfdir}/openvpn/ +sed -i "s|KEY_NAME=.*|KEY_NAME=\"openvpn\"|" %{buildroot}%{_sysconfdir}/openvpn/easy-rsa/vars + +for s in sample-config-files sample-scripts; do + cp -a sample/$s %{buildroot}%{_docdir}/openvpn/ +done + +install -D -m0644 %{SOURCE1} %{buildroot}/lib/systemd/system/openvpn@.service +install -D -m0644 %{SOURCE2} %{buildroot}%{_prefix}/lib/tmpfiles.d/openvpn.conf + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%pre +if [ $1 -gt 1 ]; then + /sbin/chkconfig --del openvpn &>/dev/null +fi +: + +%post +if [ $1 -ge 1 ]; then + systemd-tmpfiles --create %{name}.conf + systemctl -q daemon-reload +fi +: + +%files +%defattr(-,root,root) +%dir %{_sysconfdir}/openvpn +%dir %{_sysconfdir}/openvpn/easy-rsa +%{_sysconfdir}/openvpn/easy-rsa/* +%config(noreplace) %{_sysconfdir}/openvpn/easy-rsa/vars +%{_sbindir}/openvpn +%{_includedir}/openvpn-plugin.h +%{_libdir}/tmpfiles.d/openvpn.conf +%dir %{_libdir}/openvpn +%dir %{_libdir}/openvpn/plugins +%{_libdir}/openvpn/plugins/openvpn-plugin-auth-pam.la +%{_libdir}/openvpn/plugins/openvpn-plugin-auth-pam.so +%{_libdir}/openvpn/plugins/openvpn-plugin-down-root.la +%{_libdir}/openvpn/plugins/openvpn-plugin-down-root.so +/lib/systemd/system/openvpn@.service +%dir %{_datadir}/doc/openvpn +%{_datadir}/doc/openvpn/* +%{_mandir}/man8/openvpn.8* +%{_datadir}/doc/openvpn/management-notes.txt +%doc AUTHORS COPYING +#ChangeLog README + +%changelog +* Wed May 07 2014 Silvan Calarco 2.3.3-4mamba +- switch to /run + +* Wed Apr 30 2014 Silvan Calarco 2.3.3-3mamba +- switch to systemd service (use systemctl enable openvpn@myvpnconf) + +* Tue Apr 29 2014 Silvan Calarco 2.3.3-2mamba +- reintegrate easy-rsa installed under /etc/openvpn +- install sample-config-files and sample-scripts under %{_docdir}/openvpn +- require openssl (for easy-rsa) + +* Fri Apr 11 2014 Automatic Build System 2.3.3-1mamba +- automatic version update by autodist + +* Wed Jun 12 2013 Automatic Build System 2.3.2-1mamba +- automatic version update by autodist + +* Sun Mar 31 2013 Automatic Build System 2.3.1-1mamba +- automatic version update by autodist + +* Tue Feb 05 2013 Automatic Build System 2.3.0-1mamba +- automatic version update by autodist + +* Wed Jun 06 2012 Ercole 'ercolinux' Carpanetto 2.2.0-1mamba +- update to 2.2.2 +- added missing easy-rsa + +* Wed Nov 10 2010 Automatic Build System 2.1.3-1mamba +- automatic update by autodist + +* Wed Aug 25 2010 Automatic Build System 2.1.2-1mamba +- automatic update by autodist + +* Sun Dec 13 2009 Automatic Build System 2.1.1-1mamba +- automatic update by autodist + +* Fri Feb 29 2008 Silvan Calarco 2.0.9-2mamba +- added initscript and configuration directory + +* Wed Mar 28 2007 Silvan Calarco 2.0.9-1mamba +- package created by autospec diff --git a/openvpn@.service b/openvpn@.service new file mode 100644 index 0000000..fa0c4b3 --- /dev/null +++ b/openvpn@.service @@ -0,0 +1,13 @@ +[Unit] +Description=OpenVPN tunneling application on %i +After=network.target NetworkManager-wait-online.service +Requires=network.target NetworkManager-wait-online.service + +[Service] +Type=forking +PrivateTmp=true +ExecStart=/usr/sbin/openvpn --daemon --writepid /run/openvpn/%i.pid --cd /etc/openvpn --config %i.conf +PIDFile=/run/openvpn/%i.pid + +[Install] +WantedBy=multi-user.target