Browse code

cleanup: Remove RPM openvpn.spec build approach

Linux packaging is quite a comprehensive task these days, with many
Linux distributions and each with their own packaging guidelines. In
addition OpenVPN is packaged for most important Linux distributions
already.

The OpenVPN developers is not capable of keeping track of how all the
various recommend packaging guidelines evoloves and our RPM build
process is no longer consistent with guidelines from Fedora, RHEL or
SUSE packaging. We also don't receive any updates improving this
situation. Most likely due to packaging being handled fairly well by
the Linux distributions directly.

In addition comes systemd into play, which more and more Linux
distributions embraces - and even our own RPM openvpn.spec file didn't
account for that move.

This removes all RPM related packaging files and updates the INSTALL
file with pointers to several popular Linux distributions with
accessible information of the OpenVPN packages they provide. Linux
distributions is most likely much better at keeping the packaging
up-to-shape much better than we.

Signed-off-by: David Sommerseth <davids@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20190220131906.22970-1-davids@openvpn.net>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg18222.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>

David Sommerseth authored on 2019/02/20 22:19:06
Showing 8 changed files
... ...
@@ -53,7 +53,6 @@ doc/openvpn.8.html
53 53
 /doc/doxygen/html/
54 54
 /doc/doxygen/latex/
55 55
 /doc/doxygen/openvpn.doxyfile
56
-distro/rpm/openvpn.spec
57 56
 distro/systemd/*.service
58 57
 sample/sample-keys/sample-ca/
59 58
 vendor/.build
... ...
@@ -228,32 +228,41 @@ ENVIRONMENT for ./configure:
228 228
 
229 229
 *************************************************************************
230 230
 
231
-BUILDING ON LINUX 2.6+ FROM RPM
231
+Linux distribution packaging:
232 232
 
233
-You can build a binary RPM directly from the OpenVPN tarball file:
233
+Each Linux distribution has their own way of doing packaging and their
234
+own set of guidelines of how proper packaging should be done.  It
235
+is therefore recommended to reach out to the Linux distributions you
236
+want to have OpenVPN packaged for directly.  The OpenVPN project wants
237
+to focus more on the OpenVPN development and less on the packaging
238
+and how packaging is done in all various distributions.
234 239
 
235
-	rpmbuild -tb [tarball]
240
+For more details:
236 241
 
237
-This command will build a binary RPM file and place it in the system
238
-RPM directory.  You can then install the RPM with the standard RPM
239
-install command:
242
+* Arch Linux
243
+  https://www.archlinux.org/packages/?name=openvpn
240 244
 
241
-	rpm -ivh [binary-rpm]
245
+* Debian
246
+  https://packages.debian.org/search?keywords=openvpn&searchon=names
247
+  https://tracker.debian.org/pkg/openvpn
242 248
 
243
-When you install the binary RPM, it will install
244
-sample-scripts/openvpn.init, which can be used to
245
-automatically start or stop one or more OpenVPN tunnels on system
246
-startup or shutdown, based on OpenVPN .conf files in /etc/openvpn.
247
-See the comments in openvpn.init for more information.
249
+* Fedora / Fedora EPEL (Red Hat Enterprise Linux/CentOS/Scientific Linux)
250
+  https://apps.fedoraproject.org/packages/openvpn/overview/
251
+  https://src.fedoraproject.org/rpms/openvpn
248 252
 
249
-Installing the RPM will also configure the TUN/TAP device node
250
-for linux 2.6.
253
+* Gentoo
254
+  https://packages.gentoo.org/packages/net-vpn/openvpn
255
+  https://gitweb.gentoo.org/repo/gentoo.git/tree/net-vpn/openvpn
251 256
 
252
-Note that the current openvpn.spec file, which instructs the rpm tool
253
-how to build a package, will build OpenVPN with all options enabled,
254
-including OpenSSL, LZO, and pthread linkage.  Therefore all of
255
-these packages will need to be present prior to the RPM build, unless
256
-you edit the openvpn.spec file.
257
+* openSUSE
258
+  https://build.opensuse.org/package/show/network:vpn/openvpn
259
+
260
+* Ubuntu
261
+  https://packages.ubuntu.com/search?keywords=openvpn
262
+
263
+In addition, the OpenVPN community provides a best-effort APT repository
264
+for Debian and Ubuntu:
265
+https://community.openvpn.net/openvpn/wiki/OpenvpnSoftwareRepos
257 266
 
258 267
 *************************************************************************
259 268
 
... ...
@@ -1389,8 +1389,6 @@ AC_CONFIG_FILES([
1389 1389
 	build/msvc/Makefile
1390 1390
 	build/msvc/msvc-generate/Makefile
1391 1391
 	distro/Makefile
1392
-	distro/rpm/Makefile
1393
-	distro/rpm/openvpn.spec
1394 1392
 	distro/systemd/Makefile
1395 1393
 	doc/Makefile
1396 1394
 	doc/doxygen/Makefile
... ...
@@ -12,4 +12,4 @@
12 12
 MAINTAINERCLEANFILES = \
13 13
 	$(srcdir)/Makefile.in
14 14
 
15
-SUBDIRS = rpm systemd
15
+SUBDIRS = systemd
16 16
deleted file mode 100644
... ...
@@ -1,18 +0,0 @@
1
-#
2
-#  OpenVPN -- An application to securely tunnel IP networks
3
-#             over a single UDP port, with support for SSL/TLS-based
4
-#             session authentication and key exchange,
5
-#             packet encryption, packet authentication, and
6
-#             packet compression.
7
-#
8
-#  Copyright (C) 2002-2018 OpenVPN Inc <sales@openvpn.net>
9
-#  Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
10
-#
11
-
12
-MAINTAINERCLEANFILES = \
13
-	$(srcdir)/Makefile.in
14
-
15
-dist_noinst_DATA = \
16
-	openvpn.spec \
17
-	openvpn.init.d.rhel \
18
-	openvpn.init.d.suse
19 1
deleted file mode 100755
... ...
@@ -1,244 +0,0 @@
1
-#!/bin/sh
2
-#
3
-# openvpn       This shell script takes care of starting and stopping
4
-#               openvpn on RedHat or other chkconfig-based system.
5
-#
6
-# chkconfig: 345 24 76
7
-#
8
-# description: OpenVPN is a robust and highly flexible tunneling application \
9
-#              that uses all of the encryption, authentication, and \
10
-#              certification features of the OpenSSL library to securely \
11
-#              tunnel IP networks over a single UDP port.
12
-#
13
-
14
-# Contributed to the OpenVPN project by
15
-# Douglas Keller <doug@voidstar.dyndns.org>
16
-# 2002.05.15
17
-
18
-# To install:
19
-#   copy this file to /etc/rc.d/init.d/openvpn
20
-#   shell> chkconfig --add openvpn
21
-#   shell> mkdir /etc/openvpn
22
-#   make .conf or .sh files in /etc/openvpn (see below)
23
-
24
-# To uninstall:
25
-#   run: chkconfig --del openvpn
26
-
27
-# Author's Notes:
28
-#
29
-# I have created an /etc/init.d init script and enhanced openvpn.spec to
30
-# automatically register the init script.  Once the RPM is installed you
31
-# can start and stop OpenVPN with "service openvpn start" and "service
32
-# openvpn stop".
33
-#
34
-# The init script does the following:
35
-#
36
-# - Starts an openvpn process for each .conf file it finds in
37
-#   /etc/openvpn.
38
-#
39
-# - If /etc/openvpn/xxx.sh exists for a xxx.conf file then it executes
40
-#   it before starting openvpn (useful for doing openvpn --mktun...).
41
-#
42
-# - In addition to start/stop you can do:
43
-#
44
-#   service openvpn reload - SIGHUP
45
-#   service openvpn reopen - SIGUSR1
46
-#   service openvpn status - SIGUSR2
47
-#
48
-# Modifications:
49
-#
50
-# 2003.05.02
51
-#   * Changed == to = for sh compliance (Bishop Clark).
52
-#   * If condrestart|reload|reopen|status, check that we were
53
-#     actually started (James Yonan).
54
-#   * Added lock, piddir, and work variables (James Yonan).
55
-#   * If start is attempted twice, without an intervening stop, or
56
-#     if start is attempted when previous start was not properly
57
-#     shut down, then kill any previously started processes, before
58
-#     commencing new start operation (James Yonan).
59
-#   * Do a better job of flagging errors on start, and properly
60
-#     returning success or failure status to caller (James Yonan).
61
-#
62
-# 2005.04.04
63
-#   * Added openvpn-startup and openvpn-shutdown script calls
64
-#     (James Yonan).
65
-#
66
-
67
-# Location of openvpn binary
68
-openvpn=""
69
-openvpn_locations="/usr/sbin/openvpn /usr/local/sbin/openvpn"
70
-for location in $openvpn_locations
71
-do
72
-  if [ -f "$location" ]
73
-  then
74
-    openvpn=$location
75
-  fi
76
-done
77
-
78
-# Lockfile
79
-lock="/var/lock/subsys/openvpn"
80
-
81
-# PID directory
82
-piddir="/var/run/openvpn"
83
-
84
-# Our working directory
85
-work=/etc/openvpn
86
-
87
-# Source function library.
88
-. /etc/rc.d/init.d/functions
89
-
90
-# Source networking configuration.
91
-. /etc/sysconfig/network
92
-
93
-# Check that networking is up.
94
-if [ "${NETWORKING}" = "no" ]
95
-then
96
-  echo "Networking is down"
97
-  exit 0
98
-fi
99
-
100
-# Check that binary exists
101
-if ! [ -f  $openvpn ] 
102
-then
103
-  echo "openvpn binary not found"
104
-  exit 0
105
-fi
106
-
107
-# See how we were called.
108
-case "$1" in
109
-  start)
110
-	echo -n $"Starting openvpn: "
111
-
112
-	/sbin/modprobe tun >/dev/null 2>&1
113
-
114
-	# From a security perspective, I think it makes
115
-	# sense to remove this, and have users who need
116
-	# it explicitly enable in their --up scripts or
117
-	# firewall setups.
118
-
119
-	#echo 1 > /proc/sys/net/ipv4/ip_forward
120
-
121
-	# Run startup script, if defined
122
-	if [ -f $work/openvpn-startup ]; then
123
-	    $work/openvpn-startup
124
-	fi
125
-
126
-	if [ ! -d  $piddir ]; then
127
-	    mkdir $piddir
128
-	fi
129
-
130
-	if [ -f $lock ]; then
131
-	    # we were not shut down correctly
132
-	    for pidf in `/bin/ls $piddir/*.pid 2>/dev/null`; do
133
-	      if [ -s $pidf ]; then
134
-		kill `cat $pidf` >/dev/null 2>&1
135
-	      fi
136
-	      rm -f $pidf
137
-	    done
138
-	    rm -f $lock
139
-	    sleep 2
140
-	fi
141
-
142
-	rm -f $piddir/*.pid
143
-	cd $work
144
-
145
-	# Start every .conf in $work and run .sh if exists
146
-	errors=0
147
-	successes=0
148
-	for c in `/bin/ls *.conf 2>/dev/null`; do
149
-	    bn=${c%%.conf}
150
-	    if [ -f "$bn.sh" ]; then
151
-		. ./$bn.sh
152
-	    fi
153
-	    rm -f $piddir/$bn.pid
154
-	    $openvpn --daemon --writepid $piddir/$bn.pid --config $c --cd $work
155
-	    if [ $? = 0 ]; then
156
-		successes=1
157
-	    else
158
-		errors=1
159
-	    fi
160
-	done
161
-
162
-	if [ $errors = 1 ]; then
163
-	    failure; echo
164
-	else
165
-	    success; echo
166
-	fi
167
-
168
-	if [ $successes = 1 ]; then
169
-	    touch $lock
170
-	fi
171
-	;;
172
-  stop)
173
-	echo -n $"Shutting down openvpn: "
174
-	for pidf in `/bin/ls $piddir/*.pid 2>/dev/null`; do
175
-	  if [ -s $pidf ]; then
176
-	    kill `cat $pidf` >/dev/null 2>&1
177
-	  fi
178
-	  rm -f $pidf
179
-	done
180
-
181
-	# Run shutdown script, if defined
182
-	if [ -f $work/openvpn-shutdown ]; then
183
-	    $work/openvpn-shutdown
184
-	fi
185
-
186
-	success; echo
187
-	rm -f $lock
188
-	;;
189
-  restart)
190
-	$0 stop
191
-	sleep 2
192
-	$0 start
193
-	;;
194
-  reload)
195
-	if [ -f $lock ]; then
196
-	    for pidf in `/bin/ls $piddir/*.pid 2>/dev/null`; do
197
-		if [ -s $pidf ]; then
198
-		    kill -HUP `cat $pidf` >/dev/null 2>&1
199
-		fi
200
-	    done
201
-	else
202
-	    echo "openvpn: service not started"
203
-	    exit 1
204
-	fi
205
-	;;
206
-  reopen)
207
-	if [ -f $lock ]; then
208
-	    for pidf in `/bin/ls $piddir/*.pid 2>/dev/null`; do
209
-		if [ -s $pidf ]; then
210
-		    kill -USR1 `cat $pidf` >/dev/null 2>&1
211
-		fi
212
-	    done
213
-	else
214
-	    echo "openvpn: service not started"
215
-	    exit 1
216
-	fi
217
-	;;
218
-  condrestart)
219
-	if [ -f $lock ]; then
220
-	    $0 stop
221
-	    # avoid race
222
-	    sleep 2
223
-	    $0 start
224
-	fi
225
-	;;
226
-  status)
227
-	if [ -f $lock ]; then
228
-	    for pidf in `/bin/ls $piddir/*.pid 2>/dev/null`; do
229
-		if [ -s $pidf ]; then
230
-		    kill -USR2 `cat $pidf` >/dev/null 2>&1
231
-		fi
232
-	    done
233
-	    echo "Status written to /var/log/messages"
234
-	else
235
-	    echo "openvpn: service not started"
236
-	    exit 1
237
-	fi
238
-        ;;
239
-  *)
240
-	echo "Usage: openvpn {start|stop|restart|condrestart|reload|reopen|status}"
241
-	exit 1
242
-	;;
243
-esac
244
-exit 0
245 1
deleted file mode 100644
... ...
@@ -1,264 +0,0 @@
1
-#!/bin/sh
2
-### BEGIN INIT INFO
3
-# Provides:                     openvpn
4
-# Required-Start:               $network
5
-# Required-Stop:                $network
6
-# Default-Start:                3 5
7
-# Default-Stop:                 0 1 2 6
8
-# Short-Description:            This shell script takes care of starting and stopping OpenVPN.
9
-# Description:                  OpenVPN is a robust and highly flexible tunneling application that uses all of the encryption, authentication, and certification features of the OpenSSL library to securely tunnel IP networks over a single UDP port. 
10
-### END INIT INFO
11
-
12
-# Contributed to the OpenVPN project by
13
-# Douglas Keller <doug@voidstar.dyndns.org>
14
-# 2002.05.15
15
-
16
-# Modified for SuSE by
17
-# Frank Plohmann <openvpn@franks-planet.de>
18
-# 2003.08.24
19
-# Please feel free to contact me if you have problems or suggestions
20
-# using this script.
21
-
22
-# To install:
23
-#   copy this file to /etc/rc.d/init.d/openvpn
24
-#   use the runlevel editor in Yast to add it to runlevel 3 and/or 5
25
-#   shell> mkdir /etc/openvpn
26
-#   make .conf or .sh files in /etc/openvpn (see below)
27
-
28
-# To uninstall:
29
-#   use also Yast and the runlevel editor to uninstall
30
-
31
-# Author's Notes:
32
-#
33
-# I have created an /etc/init.d init script and enhanced openvpn.spec to
34
-# automatically register the init script.  Once the RPM is installed you
35
-# can start and stop OpenVPN with "service openvpn start" and "service
36
-# openvpn stop".
37
-#
38
-# The init script does the following:
39
-#
40
-# - Starts an openvpn process for each .conf file it finds in
41
-#   /etc/openvpn.
42
-#
43
-# - If /etc/openvpn/xxx.sh exists for a xxx.conf file then it executes
44
-#   it before starting openvpn (useful for doing openvpn --mktun...).
45
-#
46
-# - In addition to start/stop you can do:
47
-#
48
-#   /etc/init.d/openvpn reload - SIGHUP
49
-#   /etc/init.d/openvpn reopen - SIGUSR1
50
-#   /etc/init.d/openvpn status - SIGUSR2
51
-
52
-# Modifications 2003.05.02
53
-#   * Changed == to = for sh compliance (Bishop Clark).
54
-#   * If condrestart|reload|reopen|status, check that we were
55
-#     actually started (James Yonan).
56
-#   * Added lock, piddir, and work variables (James Yonan).
57
-#   * If start is attempted twice, without an intervening stop, or
58
-#     if start is attempted when previous start was not properly
59
-#     shut down, then kill any previously started processes, before
60
-#     commencing new start operation (James Yonan).
61
-#   * Do a better job of flagging errors on start, and properly
62
-#     returning success or failure status to caller (James Yonan).
63
-#
64
-# Modifications 2003.08.24
65
-#   * Converted the script for SuSE Linux distribution. 
66
-#	  Tested with version 8.2 (Frank Plohmann).
67
-#		- removed "chkconfig" header
68
-#		- added Yast header
69
-#		- changed installation notes
70
-#		- corrected path to openvpn binary
71
-#		- removes sourcing "functions"
72
-#		- removed sourcing "network"
73
-#		- removed network checking. it seemed not to work with SuSE.
74
-#		- added sourcing "rc.status", comments and "rc_reset" command
75
-#		- removed "success; echo" and "failure; echo" lines
76
-#		- added "rc_status" lines at the end of each section
77
-#		- changed "service" to "/etc/init.d/" in "In addition to start/stop"
78
-#		  section above.
79
-#
80
-# Modifications 2005.04.04
81
-#   * Added openvpn-startup and openvpn-shutdown script calls (James Yonan).
82
-#
83
-
84
-# Location of openvpn binary
85
-openvpn="/usr/sbin/openvpn"
86
-
87
-# Lockfile
88
-lock="/var/lock/subsys/openvpn"
89
-
90
-# PID directory
91
-piddir="/var/run/openvpn"
92
-
93
-# Our working directory
94
-work=/etc/openvpn
95
-
96
-# Source rc functions
97
-. /etc/rc.status
98
-
99
-# Shell functions sourced from /etc/rc.status:
100
-#      rc_check         check and set local and overall rc status
101
-#      rc_status        check and set local and overall rc status
102
-#      rc_status -v     ditto but be verbose in local rc status
103
-#      rc_status -v -r  ditto and clear the local rc status
104
-#      rc_failed        set local and overall rc status to failed
105
-#      rc_reset         clear local rc status (overall remains)
106
-#      rc_exit          exit appropriate to overall rc status
107
-
108
-#      rc_status        check and set local and overall rc status
109
-#      rc_status -v     ditto but be verbose in local rc status
110
-#      rc_status -v -r  ditto and clear the local rc status
111
-#      rc_failed        set local and overall rc status to failed
112
-#      rc_reset         clear local rc status (overall remains)
113
-#      rc_exit          exit appropriate to overall rc status
114
-
115
-# First reset status of this service
116
-rc_reset
117
-
118
-[ -f  $openvpn ] || exit 0
119
-
120
-# See how we were called.
121
-case "$1" in
122
-  start)
123
-	echo -n $"Starting openvpn: "
124
-
125
-	/sbin/modprobe tun >/dev/null 2>&1
126
-
127
-	# From a security perspective, I think it makes
128
-	# sense to remove this, and have users who need
129
-	# it explicitly enable in their --up scripts or
130
-	# firewall setups.
131
-
132
-	#echo 1 > /proc/sys/net/ipv4/ip_forward
133
-
134
-	# Run startup script, if defined
135
-	if [ -f $work/openvpn-startup ]; then
136
-	    $work/openvpn-startup
137
-	fi
138
-
139
-	if [ ! -d  $piddir ]; then
140
-	    mkdir $piddir
141
-	fi
142
-
143
-	if [ -f $lock ]; then
144
-	    # we were not shut down correctly
145
-	    for pidf in `/bin/ls $piddir/*.pid 2>/dev/null`; do
146
-	      if [ -s $pidf ]; then
147
-		kill `cat $pidf` >/dev/null 2>&1
148
-	      fi
149
-	      rm -f $pidf
150
-	    done
151
-	    rm -f $lock
152
-	    sleep 2
153
-	fi
154
-
155
-	rm -f $piddir/*.pid
156
-	cd $work
157
-
158
-	# Start every .conf in $work and run .sh if exists
159
-	errors=0
160
-	successes=0
161
-	for c in `/bin/ls *.conf 2>/dev/null`; do
162
-	    bn=${c%%.conf}
163
-	    if [ -f "$bn.sh" ]; then
164
-		. ./$bn.sh
165
-	    fi
166
-	    rm -f $piddir/$bn.pid
167
-	    $openvpn --daemon --writepid $piddir/$bn.pid --config $c --cd $work
168
-	    if [ $? = 0 ]; then
169
-		successes=1
170
-	    else
171
-		errors=1
172
-	    fi
173
-	done
174
-
175
-	if [ $successes = 1 ]; then
176
-	    touch $lock
177
-	fi
178
-
179
-	rc_status -v
180
-	;;
181
-  stop)
182
-	echo -n $"Shutting down openvpn: "
183
-	for pidf in `/bin/ls $piddir/*.pid 2>/dev/null`; do
184
-	  if [ -s $pidf ]; then
185
-	    kill `cat $pidf` >/dev/null 2>&1
186
-	  fi
187
-	  rm -f $pidf
188
-	done
189
-
190
-	# Run shutdown script, if defined
191
-	if [ -f $work/openvpn-shutdown ]; then
192
-	    $work/openvpn-shutdown
193
-	fi
194
-
195
-	rm -f $lock
196
-
197
-	rc_status -v
198
-	;;
199
-  restart)
200
-	$0 stop
201
-	sleep 2
202
-	$0 start
203
-
204
-	rc_status
205
-	;;
206
-  reload)
207
-	if [ -f $lock ]; then
208
-	    for pidf in `/bin/ls $piddir/*.pid 2>/dev/null`; do
209
-		if [ -s $pidf ]; then
210
-		    kill -HUP `cat $pidf` >/dev/null 2>&1
211
-		fi
212
-	    done
213
-	else
214
-	    echo "openvpn: service not started"
215
-	    exit 1
216
-	fi
217
-
218
-	rc_status -v
219
-	;;
220
-  reopen)
221
-	if [ -f $lock ]; then
222
-	    for pidf in `/bin/ls $piddir/*.pid 2>/dev/null`; do
223
-		if [ -s $pidf ]; then
224
-		    kill -USR1 `cat $pidf` >/dev/null 2>&1
225
-		fi
226
-	    done
227
-	else
228
-	    echo "openvpn: service not started"
229
-	    exit 1
230
-	fi
231
-
232
-	rc_status -v
233
-	;;
234
-  condrestart)
235
-	if [ -f $lock ]; then
236
-	    $0 stop
237
-	    # avoid race
238
-	    sleep 2
239
-	    $0 start
240
-	fi
241
-
242
-	rc_status
243
-	;;
244
-  status)
245
-	if [ -f $lock ]; then
246
-	    for pidf in `/bin/ls $piddir/*.pid 2>/dev/null`; do
247
-		if [ -s $pidf ]; then
248
-		    kill -USR2 `cat $pidf` >/dev/null 2>&1
249
-		fi
250
-	    done
251
-	    echo "Status written to /var/log/messages"
252
-	else
253
-	    echo "openvpn: service not started"
254
-	    exit 1
255
-	fi
256
-
257
-	rc_status -v
258
-        ;;
259
-  *)
260
-	echo "Usage: openvpn {start|stop|restart|condrestart|reload|reopen|status}"
261
-	exit 1
262
-esac
263
-
264
-exit 0
265 1
deleted file mode 100644
... ...
@@ -1,248 +0,0 @@
1
-# OpenVPN spec file, used to drive rpmbuild
2
-
3
-# OPTIONS
4
-#
5
-# Disable LZO
6
-#   rpmbuild -tb [openvpn.x.tar.gz] --define 'without_lzo 1'
7
-#
8
-# Disable PAM plugin
9
-#   rpmbuild -tb [openvpn.x.tar.gz] --define 'without_pam 1'
10
-#
11
-# Allow passwords to be read from files
12
-#   rpmbuild -tb [openvpn.x.tar.gz] --define 'with_password_save 1'
13
-
14
-Summary:	OpenVPN is a robust and highly flexible VPN daemon by James Yonan.
15
-Name:		@PACKAGE@
16
-Version:	@VERSION@
17
-Release:	1
18
-URL:		http://openvpn.net/
19
-Source0:	http://prdownloads.sourceforge.net/openvpn/%{name}-%{version}.tar.gz
20
-
21
-License:	GPL
22
-Group:		Applications/Internet
23
-Vendor:		James Yonan <jim@yonan.net>
24
-Packager:	James Yonan <jim@yonan.net>
25
-BuildRoot:	%{_tmppath}/%{name}-%(id -un)
26
-
27
-#
28
-# Include dependencies manually
29
-#
30
-
31
-AutoReq: 0
32
-
33
-BuildRequires:	openssl-devel >= 0.9.7
34
-Requires:	openssl       >= 0.9.7
35
-
36
-%if "%{_vendor}" == "Mandrakesoft"
37
-%{!?without_lzo:BuildRequires:	liblzo1-devel >= 1.07}
38
-%{!?without_lzo:Requires:	liblzo1       >= 1.07}
39
-%else
40
-%if "%{_vendor}" == "MandrakeSoft"
41
-%{!?without_lzo:BuildRequires:	liblzo1-devel >= 1.07}
42
-%{!?without_lzo:Requires:	liblzo1       >= 1.07}
43
-%else
44
-%{!?without_lzo:BuildRequires:	lzo-devel >= 1.07}
45
-%{!?without_lzo:Requires:	lzo       >= 1.07}
46
-%endif
47
-%endif
48
-
49
-%{!?without_pam:BuildRequires:	pam-devel}
50
-%{!?without_pam:Requires:	pam}
51
-
52
-%{?with_pkcs11:BuildRequires:	pkcs11-helper-devel}
53
-%{?with_pkcs11:Requires:	pkcs11-helper}
54
-
55
-#
56
-# Description
57
-#
58
-
59
-%description
60
-OpenVPN is a robust and highly flexible VPN daemon by James Yonan.
61
-OpenVPN supports SSL/TLS security,
62
-ethernet bridging,
63
-TCP or UDP tunnel transport through proxies or NAT,
64
-support for dynamic IP addresses and DHCP,
65
-scalability to hundreds or thousands of users,
66
-and portability to most major OS platforms.
67
-
68
-%package devel
69
-Summary:	OpenVPN is a robust and highly flexible VPN daemon by James Yonan.
70
-Group:		Applications/Internet
71
-Requires:	%{name}
72
-%description devel
73
-Development support for OpenVPN.
74
-
75
-#
76
-# Define vendor type
77
-#
78
-
79
-%if "%{_vendor}" == "suse" || "%{_vendor}" == "pc"
80
-%define VENDOR SuSE
81
-%else
82
-%define VENDOR %_vendor
83
-%endif
84
-
85
-#
86
-# Other definitions
87
-#
88
-
89
-%define debug_package %{nil}
90
-
91
-#
92
-# Build OpenVPN binary
93
-#
94
-
95
-%prep
96
-%setup -q
97
-
98
-%build
99
-%configure \
100
-	--disable-dependency-tracking \
101
-	--docdir="%{_docdir}/%{name}-%{version}" \
102
-	%{?with_password_save:--enable-password-save} \
103
-	%{!?without_lzo:--enable-lzo} \
104
-	%{?with_pkcs11:--enable-pkcs11} \
105
-	%{?without_pam:--disable-plugin-auth-pam}
106
-%__make
107
-
108
-#
109
-# Installation section
110
-#
111
-
112
-%install
113
-[ %{buildroot} != "/" ] && rm -rf %{buildroot}
114
-%__make install DESTDIR="%{buildroot}"
115
-
116
-# Install init script
117
-%if "%{VENDOR}" == "SuSE"
118
-%__install -c -d -m 755 "%{buildroot}/etc/init.d"
119
-%__install -c -m 755 "distro/rpm/%{name}.init.d.suse" "%{buildroot}/etc/init.d/%{name}"
120
-%else
121
-%__install -c -d -m 755 "%{buildroot}/etc/rc.d/init.d"
122
-%__install -c -m 755 distro/rpm/%{name}.init.d.rhel "%{buildroot}/etc/rc.d/init.d/%{name}"
123
-%endif
124
-
125
-# Install /etc/openvpn
126
-%__install -c -d -m 755 "%{buildroot}/etc/%{name}"
127
-
128
-# Install extra %doc stuff
129
-cp -r AUTHORS ChangeLog NEWS contrib/ sample/ \
130
-	"%{buildroot}/%{_docdir}/%{name}-%{version}"
131
-
132
-#
133
-# Clean section
134
-#
135
-
136
-%clean
137
-[ %{buildroot} != "/" ] && rm -rf "%{buildroot}"
138
-
139
-#
140
-# On Linux 2.4, make the device node
141
-#
142
-
143
-%post
144
-case "`uname -r`" in
145
-2.4*)
146
-	/bin/mkdir /dev/net >/dev/null 2>&1
147
-	/bin/mknod /dev/net/tun c 10 200 >/dev/null 2>&1
148
-	;;
149
-esac
150
-
151
-#
152
-# Handle the init script
153
-#
154
-
155
-/sbin/chkconfig --add %{name}
156
-%if "%{VENDOR}" == "SuSE"
157
-/etc/init.d/openvpn restart
158
-%else
159
-/sbin/service %{name} condrestart
160
-%endif
161
-%preun
162
-if [ "$1" = 0 ]
163
-then
164
-	%if "%{VENDOR}" == "SuSE"
165
-	/etc/init.d/openvpn stop
166
-	%else
167
-	/sbin/service %{name} stop
168
-	%endif
169
-	/sbin/chkconfig --del %{name}
170
-fi
171
-
172
-#
173
-# Files section
174
-#
175
-# don't use %doc as old rpmbuild removes it[1].
176
-# [1] http://rpm.org/ticket/836
177
-
178
-%files
179
-%defattr(-,root,root)
180
-%{_mandir}
181
-%{_sbindir}/%{name}
182
-%{_libdir}/%{name}
183
-%{_docdir}/%{name}-%{version}
184
-%dir /etc/%{name}
185
-%if "%{VENDOR}" == "SuSE"
186
-/etc/init.d/%{name}
187
-%else
188
-/etc/rc.d/init.d/%{name}
189
-%endif
190
-
191
-%files devel
192
-%defattr(-,root,root)
193
-%{_includedir}/*
194
-
195
-%changelog
196
-* Thu Jul 30 2009 David Sommerseth <dazo@users.sourceforge.net>
197
-- Removed management/ directory from %doc
198
-
199
-* Thu Dec 14 2006 Alon Bar-Lev
200
-- Added with_pkcs11
201
-
202
-* Mon Aug 2 2005 James Yonan
203
-- Fixed build problem with --define 'without_pam 1'
204
-
205
-* Mon Apr 4 2005 James Yonan
206
-- Moved some files from /usr/share/openvpn to %doc for compatibility
207
-  with Dag Wieers' RPM repository
208
-
209
-* Sat Mar 12 2005 Tom Walsh
210
-- Added MandrakeSoft liblzo1 require
211
-
212
-* Fri Dec 10 2004 James Yonan
213
-- Added AutoReq: 0 for manual dependencies
214
-
215
-* Fri Dec 10 2004 James Yonan
216
-- Packaged the plugins
217
-
218
-* Sun Nov 7 2004 Umberto Nicoletti
219
-- SuSE support
220
-
221
-* Wed Aug 18 2004 Bishop Clark (LC957) <bishop@platypus.bc.ca>
222
-- restrict what we claim in /etc/ to avoid ownership conflicts
223
-
224
-* Sun Feb 23 2003 Matthias Andree <matthias.andree@gmx.de> 1.3.2.14-1.
225
-- Have the version number filled in by autoconf.
226
-
227
-* Wed Jul 10 2002 James Yonan <jim@yonan.net> 1.3.1-1
228
-- Fixed %preun to only remove service on final uninstall
229
-
230
-* Mon Jun 17 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.2.2-1
231
-- Added condrestart to openvpn.spec & openvpn.init.
232
-
233
-* Wed May 22 2002 James Yonan <jim@yonan.net> 1.2.0-1
234
-- Added mknod for Linux 2.4.
235
-
236
-* Wed May 15 2002 Doug Keller <dsk@voidstar.dyndns.org> 1.1.1.16-2
237
-- Added init scripts
238
-- Added conf file support
239
-
240
-* Mon May 13 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.1.1.14-1
241
-- Added new directories for config examples and such
242
-
243
-* Sun May 12 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.1.1.13-1
244
-- Updated buildroot directive and cleanup command
245
-- added easy-rsa utilities
246
-
247
-* Mon Mar 25 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.0-1
248
-- Initial build.