Skip to contentSkip to conversation

OpenVPN rpm packaging - iproute2 support

PATCH In review Adam Števko 4 participants 8 messages May 17, 2017 – May 18, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OpenVPN rpm packaging - iproute2 support

Hello,

this patch adds support to build openvpn rpms with iproute2 support. It's a rather simple change, which defaults to off. Please review.

Cheers,
Adam

Date: Fri, 12 May 2017 12:00:50 +0200
Subject: [PATCH] Add option to enable iproute2 support

---
distro/rpm/openvpn.spec.in | 10 +++++++++-

1 file changed, 9 insertions(+), 1 deletion(-)
distro/rpm/openvpn.spec.in +0 -0
index 20a8c890..eca39257 100644
@@ -10,6 +10,10 @@

#
# Allow passwords to be read from files
# rpmbuild -tb [openvpn.x.tar.gz] --define 'with_password_save 1'
+#
+# Enable iproute2 support
+# rpmbuild -tb [openvpn.x.tar.gz] --define 'with_iproute2 1'
+#

Summary:    OpenVPN is a robust and highly flexible VPN daemon by James Yonan.
Name:        @PACKAGE@

@@ -52,6 +56,9 @@ Requires: openssl >= 0.9.7
%{?with_pkcs11:BuildRequires: pkcs11-helper-devel}
%{?with_pkcs11:Requires: pkcs11-helper}

+%{?with_iproute2:BuildRequires: iputils}
+%{?with_iproute2:Requires: iputils}
+
#
# Description
#
@@ -102,7 +109,8 @@ Development support for OpenVPN.
%{?with_password_save:--enable-password-save} \
%{!?without_lzo:--enable-lzo} \
%{?with_pkcs11:--enable-pkcs11} \

-    %{?without_pam:--disable-plugin-auth-pam}
+    %{?without_pam:--disable-plugin-auth-pam} \
+    %{?with_iproute2:--enable-iproute2}

%__make

#

Signature · 1 line
2.13.0
#1 lore raw

Hi,

Quoted 1 line · Adam ??tevko

this patch adds support to build openvpn rpms with iproute2 support. It's a rather simple change, which defaults to off. Please review.

Is there a particular reason not to *always* build with iproute2 support?

David, what can a program expect to find on RPM based distributions?

(Is this .spec file what Fedora builds use?)

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#2 lore raw

Hi,

Quoted 8 lines · Gert Doering

Hi,

Quoted 2 lines · Adam ??tevko

this patch adds support to build openvpn rpms with iproute2 support. It's a rather simple change, which defaults to off. Please review.

Is there a particular reason not to *always* build with iproute2 support?

I personally think that iproute should be default as mainstream distributions removed nettools and ship iproute exclusively. However, i want this merged and shipping by default to off is the path of least resistance. Those who need it now have a way how to enable it.

Quoted 10 lines

David, what can a program expect to find on RPM based distributions?

(Is this .spec file what Fedora builds use?)

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                          //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#3 lore raw
In reply to Gert Doering
Quoted 8 lines · Gert Doering

Hi,

Quoted 1 line · Adam ??tevko

this patch adds support to build openvpn rpms with iproute2 support. It's a rather simple change, which defaults to off. Please review.

Is there a particular reason not to *always* build with iproute2 support?

David, what can a program expect to find on RPM based distributions?

It would surprise me if any of them these days don't have iproutes available.

Quoted 1 line

(Is this .spec file what Fedora builds use?)

Far from that. This .spec file is again horridly outdated, and I've done a ton of updates on the Fedora .spec files.

To be very honest, I've been considering to strip the .spec file from our project. The approach of shipping a .spec made sense in the "old days" when the .spec file was merely just a script tackling a source tarball and patches; when distros where not that different from each other. But just looking at difference in the packaging guidelines between SUSE and Fedora today is just the first headache. Even though they mostly agree, they also have subtle different preferences on how to do things. Like, is the package called iproute or iproute2 ?

Of course we could have a massive .spec file doing all the right things with lots of %if blocks .... but ... no, thank you very much! :)

So then we would need to pick a flavour, or having a spec file per distro. And if we're doing that, we can rather just gather a list of pointers to various RPM distros' .spec files instead - with a "pick the one closest to your need". Those .spec files are hopefully better maintained than our .spec file will most likely be.

Signature · 4 lines
kind regards,

David Sommerseth
OpenVPN Technologies, Inc
#4 lore raw

Hi,

Quoted 5 lines · David Sommerseth

To be very honest, I've been considering to strip the .spec file from our project. The approach of shipping a .spec made sense in the "old days" when the .spec file was merely just a script tackling a source tarball and patches; when distros where not that different from each other.

So... how to proceed here, and with this patch?

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#5 lore raw

PATCH 1/1 distro: Remove outdated RPM .spec file

Each RPM based distro have their own set of packaging guidelines. We don't adhere to any of them and we're bad at keeping this up-to-date. Rather let distros take care of this job.

---
 distro/rpm/openvpn.spec.in                | 248 ------------------------------
 distro/{rpm => sys-v}/Makefile.am         |   1 -
 distro/{rpm => sys-v}/openvpn.init.d.rhel |   0
 distro/{rpm => sys-v}/openvpn.init.d.suse |   0
 4 files changed, 249 deletions(-)
 delete mode 100644 distro/rpm/openvpn.spec.in
 rename distro/{rpm => sys-v}/Makefile.am (97%)
 rename distro/{rpm => sys-v}/openvpn.init.d.rhel (100%)
 rename distro/{rpm => sys-v}/openvpn.init.d.suse (100%)
distro/rpm/openvpn.spec.in deleted +0 -248
deleted file mode 100644
index 20a8c890..00000000
@@ -1,248 +0,0 @@
-# OpenVPN spec file, used to drive rpmbuild
-
-# OPTIONS
-#
-# Disable LZO
-#   rpmbuild -tb [openvpn.x.tar.gz] --define 'without_lzo 1'
-#
-# Disable PAM plugin
-#   rpmbuild -tb [openvpn.x.tar.gz] --define 'without_pam 1'
-#
-# Allow passwords to be read from files
-#   rpmbuild -tb [openvpn.x.tar.gz] --define 'with_password_save 1'
-
-Summary:	OpenVPN is a robust and highly flexible VPN daemon by James Yonan.
-Name:		@PACKAGE@
-Version:	@VERSION@
-Release:	1
-URL:		http://openvpn.net/
-Source0:	http://prdownloads.sourceforge.net/openvpn/%{name}-%{version}.tar.gz
-
-License:	GPL
-Group:		Applications/Internet
-Vendor:		James Yonan <[email protected]...>
-Packager:	James Yonan <[email protected]...>
-BuildRoot:	%{_tmppath}/%{name}-%(id -un)
-
-#
-# Include dependencies manually
-#
-
-AutoReq: 0
-
-BuildRequires:	openssl-devel >= 0.9.7
-Requires:	openssl       >= 0.9.7
-
-%if "%{_vendor}" == "Mandrakesoft"
-%{!?without_lzo:BuildRequires:	liblzo1-devel >= 1.07}
-%{!?without_lzo:Requires:	liblzo1       >= 1.07}
-%else
-%if "%{_vendor}" == "MandrakeSoft"
-%{!?without_lzo:BuildRequires:	liblzo1-devel >= 1.07}
-%{!?without_lzo:Requires:	liblzo1       >= 1.07}
-%else
-%{!?without_lzo:BuildRequires:	lzo-devel >= 1.07}
-%{!?without_lzo:Requires:	lzo       >= 1.07}
-%endif
-%endif
-
-%{!?without_pam:BuildRequires:	pam-devel}
-%{!?without_pam:Requires:	pam}
-
-%{?with_pkcs11:BuildRequires:	pkcs11-helper-devel}
-%{?with_pkcs11:Requires:	pkcs11-helper}
-
-#
-# Description
-#
-
-%description
-OpenVPN is a robust and highly flexible VPN daemon by James Yonan.
-OpenVPN supports SSL/TLS security,
-ethernet bridging,
-TCP or UDP tunnel transport through proxies or NAT,
-support for dynamic IP addresses and DHCP,
-scalability to hundreds or thousands of users,
-and portability to most major OS platforms.
-
-%package devel
-Summary:	OpenVPN is a robust and highly flexible VPN daemon by James Yonan.
-Group:		Applications/Internet
-Requires:	%{name}
-%description devel
-Development support for OpenVPN.
-
-#
-# Define vendor type
-#
-
-%if "%{_vendor}" == "suse" || "%{_vendor}" == "pc"
-%define VENDOR SuSE
-%else
-%define VENDOR %_vendor
-%endif
-
-#
-# Other definitions
-#
-
-%define debug_package %{nil}
-
-#
-# Build OpenVPN binary
-#
-
-%prep
-%setup -q
-
-%build
-%configure \
-	--disable-dependency-tracking \
-	--docdir="%{_docdir}/%{name}-%{version}" \
-	%{?with_password_save:--enable-password-save} \
-	%{!?without_lzo:--enable-lzo} \
-	%{?with_pkcs11:--enable-pkcs11} \
-	%{?without_pam:--disable-plugin-auth-pam}
-%__make
-
-#
-# Installation section
-#
-
-%install
-[ %{buildroot} != "/" ] && rm -rf %{buildroot}
-%__make install DESTDIR="%{buildroot}"
-
-# Install init script
-%if "%{VENDOR}" == "SuSE"
-%__install -c -d -m 755 "%{buildroot}/etc/init.d"
-%__install -c -m 755 "distro/rpm/%{name}.init.d.suse" "%{buildroot}/etc/init.d/%{name}"
-%else
-%__install -c -d -m 755 "%{buildroot}/etc/rc.d/init.d"
-%__install -c -m 755 distro/rpm/%{name}.init.d.rhel "%{buildroot}/etc/rc.d/init.d/%{name}"
-%endif
-
-# Install /etc/openvpn
-%__install -c -d -m 755 "%{buildroot}/etc/%{name}"
-
-# Install extra %doc stuff
-cp -r AUTHORS ChangeLog NEWS contrib/ sample/ \
-	"%{buildroot}/%{_docdir}/%{name}-%{version}"
-
-#
-# Clean section
-#
-
-%clean
-[ %{buildroot} != "/" ] && rm -rf "%{buildroot}"
-
-#
-# On Linux 2.4, make the device node
-#
-
-%post
-case "`uname -r`" in
-2.4*)
-	/bin/mkdir /dev/net >/dev/null 2>&1
-	/bin/mknod /dev/net/tun c 10 200 >/dev/null 2>&1
-	;;
-esac
-
-#
-# Handle the init script
-#
-
-/sbin/chkconfig --add %{name}
-%if "%{VENDOR}" == "SuSE"
-/etc/init.d/openvpn restart
-%else
-/sbin/service %{name} condrestart
-%endif
-%preun
-if [ "$1" = 0 ]
-then
-	%if "%{VENDOR}" == "SuSE"
-	/etc/init.d/openvpn stop
-	%else
-	/sbin/service %{name} stop
-	%endif
-	/sbin/chkconfig --del %{name}
-fi
-
-#
-# Files section
-#
-# don't use %doc as old rpmbuild removes it[1].
-# [1] http://rpm.org/ticket/836
-
-%files
-%defattr(-,root,root)
-%{_mandir}
-%{_sbindir}/%{name}
-%{_libdir}/%{name}
-%{_docdir}/%{name}-%{version}
-%dir /etc/%{name}
-%if "%{VENDOR}" == "SuSE"
-/etc/init.d/%{name}
-%else
-/etc/rc.d/init.d/%{name}
-%endif
-
-%files devel
-%defattr(-,root,root)
-%{_includedir}/*
-
-%changelog
-* Thu Jul 30 2009 David Sommerseth <[email protected]...>
-- Removed management/ directory from %doc
-
-* Thu Dec 14 2006 Alon Bar-Lev
-- Added with_pkcs11
-
-* Mon Aug 2 2005 James Yonan
-- Fixed build problem with --define 'without_pam 1'
-
-* Mon Apr 4 2005 James Yonan
-- Moved some files from /usr/share/openvpn to %doc for compatibility
-  with Dag Wieers' RPM repository
-
-* Sat Mar 12 2005 Tom Walsh
-- Added MandrakeSoft liblzo1 require
-
-* Fri Dec 10 2004 James Yonan
-- Added AutoReq: 0 for manual dependencies
-
-* Fri Dec 10 2004 James Yonan
-- Packaged the plugins
-
-* Sun Nov 7 2004 Umberto Nicoletti
-- SuSE support
-
-* Wed Aug 18 2004 Bishop Clark (LC957) <[email protected]...>
-- restrict what we claim in /etc/ to avoid ownership conflicts
-
-* Sun Feb 23 2003 Matthias Andree <[email protected]...> 1.3.2.14-1.
-- Have the version number filled in by autoconf.
-
-* Wed Jul 10 2002 James Yonan <[email protected]...> 1.3.1-1
-- Fixed %preun to only remove service on final uninstall
-
-* Mon Jun 17 2002 bishop clark (LC957) <[email protected]...> 1.2.2-1
-- Added condrestart to openvpn.spec & openvpn.init.
-
-* Wed May 22 2002 James Yonan <[email protected]...> 1.2.0-1
-- Added mknod for Linux 2.4.
-
-* Wed May 15 2002 Doug Keller <[email protected]...> 1.1.1.16-2
-- Added init scripts
-- Added conf file support
-
-* Mon May 13 2002 bishop clark (LC957) <[email protected]...> 1.1.1.14-1
-- Added new directories for config examples and such
-
-* Sun May 12 2002 bishop clark (LC957) <[email protected]...> 1.1.1.13-1
-- Updated buildroot directive and cleanup command
-- added easy-rsa utilities
-
-* Mon Mar 25 2002 bishop clark (LC957) <[email protected]...> 1.0-1
-- Initial build.
distro/sys-v/Makefile.am renamed from distro/rpm/Makefile.am +0 -1
similarity index 97%
rename from distro/rpm/Makefile.am
rename to distro/sys-v/Makefile.am
index 37ee099a..98a6e2f4 100644
@@ -13,6 +13,5 @@ MAINTAINERCLEANFILES = \
 	$(srcdir)/Makefile.in
 
 dist_noinst_DATA = \
-	openvpn.spec \
 	openvpn.init.d.rhel \
 	openvpn.init.d.suse
distro/sys-v/openvpn.init.d.rhel renamed from distro/rpm/openvpn.init.d.rhel +0 -0
similarity index 100%
rename from distro/rpm/openvpn.init.d.rhel
rename to distro/sys-v/openvpn.init.d.rhel
distro/sys-v/openvpn.init.d.suse renamed from distro/rpm/openvpn.init.d.suse +0 -0
similarity index 100%
rename from distro/rpm/openvpn.init.d.suse
rename to distro/sys-v/openvpn.init.d.suse
Signature · 1 line
2.11.0
#6 lore raw

Re: [Openvpn-devel] [PATCH] distro: Remove outdated RPM .spec file

Hi,

Quoted 3 lines · David Sommerseth

Each RPM based distro have their own set of packaging guidelines. We don't adhere to any of them and we're bad at keeping this up-to-date. Rather let distros take care of this job.

Generally speaking, I'm fine with the change and the reasoning behind this.

I do wonder, though, where a naive user would / should go looking for "the right .spec file" for his distribution now? Say, I download this tarball, and want to build a RH RPM from it... does it make sense to have a "spec-README.rst" or something that points to the spec files "the major distributions" use?

(In case this is not obvious: I have no idea what I'm talking about, the only RPMs I've ever built are on AIX... :-) )

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#7 lore raw

Re: [Openvpn-devel] [PATCH] distro: Remove outdated RPM .spec file

Quoted 7 lines · Gert Doering

Hi,

Quoted 3 lines · David Sommerseth

Each RPM based distro have their own set of packaging guidelines. We don't adhere to any of them and we're bad at keeping this up-to-date. Rather let distros take care of this job.

Quoted 8 lines

Generally speaking, I'm fine with the change and the reasoning behind this.

I do wonder, though, where a naive user would / should go looking for "the right .spec file" for his distribution now? Say, I download this tarball, and want to build a RH RPM from it... does it make sense to have a "spec-README.rst" or something that points to the spec files "the major distributions" use?

I don't know much out how those other package managers like yum/dnf does it. But there you just do:

    $ yumdownloader --source openvpn-2.4.2

or

    $ dnf download --source openvpn-2.4.2

The SUSE universe uses, zypper instead of yum/dnf, so I presume there is something similar.

In addition, anyone who have touched Fedora packaging also knows how to use "fedpkg clone openvpn".

Quoted 2 lines

(In case this is not obvious: I have no idea what I'm talking about, the only RPMs I've ever built are on AIX... :-) )

Ahh, AIX uses RPMs ... that is, well, kind of funny :) Does it use any tools on top of rpm itself? (yum/dnf/zypper)

Signature · 4 lines
kind regards,

David Sommerseth
OpenVPN Technologies, Inc