Magellan Linux

Contents of /branches/magellan-next/extras/openvpn/openvpn-2.1.3-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9268 - (show annotations) (download)
Thu Nov 24 11:04:46 2011 UTC (12 years, 5 months ago) by niro
File size: 2005 byte(s)
-rebuild added system unit and dropped sysv support
1 # $Id$
2
3 PNAME="openvpn"
4 PVER="2.1.3"
5 PBUILD="r2"
6
7 PCATEGORIE="net-vpn"
8
9 DESCRIPTION="openvpn - an OpenSource SSL-VPN client."
10 HOMEPAGE="http://openvpn.net/"
11
12 DEPEND=">= dev-libs/lzo-2
13 >= dev-libs/openssl-1.0.0
14 >= sys-apps/iproute2-2.6
15 >= sys-libs/pam-1.1"
16
17 SDEPEND=">= virtual/kernel-headers"
18
19 SRCFILE="${PNAME}-${PVER}.tar.gz"
20 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
21
22 sminclude mbuild mtools
23
24 ENABLED_PLUGINS="auth-pam down-root"
25
26 # rc-script cvs revision
27 RC_REV=1.2
28
29 SRC_URI=(
30 http://openvpn.net/release/${SRCFILE}
31 mirror://${PNAME}/${SRCFILE}
32 mirror://${PNAME}/openvpn.unit
33 )
34
35 UP2DATE="updatecmd 'http://openvpn.net/release/?C=M;O=A' | grep ${PNAME}- | lasttarball gz"
36
37 src_compile()
38 {
39 cd ${SRCDIR}
40
41 mconfigure --enable-lzo --enable-crypto --enable-ssl --enable-pthread --enable-iproute2 || die
42 mmake || die
43
44 local plugin
45 for plugin in ${ENABLED_PLUGINS}
46 do
47 mmake -C plugin/${plugin} || die ${plugin}
48 done
49 }
50
51 src_install()
52 {
53 cd ${SRCDIR}
54
55 # needed directories
56 minstalldir /usr/share/doc/${PNAME}-${PVER}/sample-config-files || die
57 minstalldir /usr/share/doc/${PNAME}-${PVER}/sample-scripts || die
58 minstalldir /usr/$(mlibdir)/openvpn/plugins || die
59
60 mmake DESTDIR=${BINDIR} install || die
61
62 minstallfile sample-config-files/\* \
63 /usr/share/doc/${PNAME}-${PVER}/sample-config-files || die
64 minstallfile sample-scripts/\* \
65 /usr/share/doc/${PNAME}-${PVER}/sample-scripts || die
66
67 # install enabled plugins
68 local plugin
69 for plugin in ${ENABLED_PLUGINS}
70 do
71 minstallexec plugin/${plugin}/openvpn-${plugin}.so \
72 /usr/$(mlibdir)/openvpn/plugins || die ${plugin}
73 cp plugin/${plugin}/{,${plugin}}README || die ${plugin}
74 minstalldocs plugin/${plugin}/${plugin}.README || die ${plugin}
75 done
76
77 # initscript stuff
78 mkeepdir /etc/openvpn || die
79 minstallunit openvpn.unit openvpn || die
80
81 minstalldocs AUTHORS COPYING COPYRIGHT.GPL ChangeLog NEWS PORTS README || die
82 }
83
84 postinstall()
85 {
86 mstartunit openvpn
87 }
88
89 postremove()
90 {
91 [[ ! -f /usr/sbin/openvpn ]] && mstopunit openvpn
92 }