mirror of
https://github.com/MiyooCFW/buildroot.git
synced 2025-09-27 22:24:19 +03:00
Merge from bittboy/buildroot@db180c0
This commit is contained in:
38
package/openvpn/Config.in
Normal file
38
package/openvpn/Config.in
Normal file
@@ -0,0 +1,38 @@
|
||||
config BR2_PACKAGE_OPENVPN
|
||||
bool "openvpn"
|
||||
depends on BR2_USE_MMU # fork()
|
||||
select BR2_PACKAGE_OPENSSL
|
||||
help
|
||||
OpenVPN is a full-featured SSL VPN solution which can
|
||||
accomodate a wide range of configurations, including road
|
||||
warrior access, home/office/campus telecommuting, WiFi
|
||||
security, secure branch office linking, and enterprise-scale
|
||||
remote access solutions with load balancing, failover, and
|
||||
fine-grained access-controls.
|
||||
|
||||
http://openvpn.net/
|
||||
|
||||
if BR2_PACKAGE_OPENVPN
|
||||
|
||||
config BR2_PACKAGE_OPENVPN_LZ4
|
||||
bool "LZ4 compression"
|
||||
default y
|
||||
select BR2_PACKAGE_LZ4
|
||||
help
|
||||
Enable LZ4 compression.
|
||||
|
||||
config BR2_PACKAGE_OPENVPN_LZO
|
||||
bool "LZO compression"
|
||||
default y
|
||||
select BR2_PACKAGE_LZO
|
||||
help
|
||||
Enable LZO compression.
|
||||
|
||||
config BR2_PACKAGE_OPENVPN_SMALL
|
||||
bool "Optimize for small size"
|
||||
help
|
||||
Make OpenVPN as small as possible.
|
||||
You loose eurephia, debugging info, help messages and more.
|
||||
It saves around 100 KiB in binary file size.
|
||||
|
||||
endif
|
||||
99
package/openvpn/S60openvpn
Normal file
99
package/openvpn/S60openvpn
Normal file
@@ -0,0 +1,99 @@
|
||||
#!/bin/sh -e
|
||||
#
|
||||
# Original version by Robert Leslie
|
||||
# <rob@mars.org>, edited by iwj and cs
|
||||
# Modified for openvpn by Alberto Gonzalez Iniesta <agi@agi.as>
|
||||
# Modified for restarting / starting / stopping single tunnels by Richard Mueller <mueller@teamix.net>
|
||||
|
||||
test $DEBIAN_SCRIPT_DEBUG && set -v -x
|
||||
|
||||
CONFIG_DIR=/etc/openvpn
|
||||
test -d $CONFIG_DIR || exit 0
|
||||
|
||||
start_vpn () {
|
||||
/usr/sbin/openvpn --daemon --writepid /var/run/openvpn.$NAME.pid \
|
||||
--config $CONFIG_DIR/$NAME.conf --cd $CONFIG_DIR || printf " FAILED->"
|
||||
printf " $NAME"
|
||||
}
|
||||
stop_vpn () {
|
||||
kill `cat $PIDFILE` || true
|
||||
rm $PIDFILE
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
printf "Starting openvpn:"
|
||||
|
||||
if test -z $2 ; then
|
||||
for CONFIG in `cd $CONFIG_DIR; ls *.conf 2> /dev/null`; do
|
||||
NAME=${CONFIG%%.conf}
|
||||
start_vpn
|
||||
done
|
||||
else
|
||||
if test -e $CONFIG_DIR/$2.conf ; then
|
||||
NAME=$2
|
||||
start_vpn
|
||||
else
|
||||
printf " No such VPN: $2"
|
||||
fi
|
||||
fi
|
||||
echo "."
|
||||
|
||||
;;
|
||||
stop)
|
||||
printf "Stopping openvpn:"
|
||||
|
||||
if test -z $2 ; then
|
||||
for PIDFILE in `ls /var/run/openvpn.*.pid 2> /dev/null`; do
|
||||
NAME=`echo $PIDFILE | cut -c18-`
|
||||
NAME=${NAME%%.pid}
|
||||
stop_vpn
|
||||
printf " $NAME"
|
||||
done
|
||||
else
|
||||
if test -e /var/run/openvpn.$2.pid ; then
|
||||
PIDFILE=`ls /var/run/openvpn.$2.pid 2> /dev/null`
|
||||
NAME=`echo $PIDFILE | cut -c18-`
|
||||
NAME=${NAME%%.pid}
|
||||
stop_vpn
|
||||
printf " $NAME"
|
||||
else
|
||||
printf " No such VPN: $2"
|
||||
fi
|
||||
fi
|
||||
echo "."
|
||||
;;
|
||||
# We only 'reload' for running VPNs. New ones will only start with 'start' or 'restart'.
|
||||
reload|force-reload)
|
||||
printf "Reloading openvpn:"
|
||||
for PIDFILE in `ls /var/run/openvpn.*.pid 2> /dev/null`; do
|
||||
NAME=`echo $PIDFILE | cut -c18-`
|
||||
NAME=${NAME%%.pid}
|
||||
# If openvpn if running under a different user than root we'll need to restart
|
||||
if egrep '^( |\t)*user' $CONFIG_DIR/$NAME.conf > /dev/null 2>&1 ; then
|
||||
stop_vpn
|
||||
sleep 1
|
||||
start_vpn
|
||||
printf "(restarted)"
|
||||
else
|
||||
kill -HUP `cat $PIDFILE` || true
|
||||
printf " $NAME"
|
||||
fi
|
||||
done
|
||||
echo "."
|
||||
;;
|
||||
|
||||
restart)
|
||||
$0 stop $2
|
||||
sleep 1
|
||||
$0 start $2
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|reload|restart|force-reload}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# vim:set ai et sts=2 sw=2 tw=0:
|
||||
3
package/openvpn/openvpn.hash
Normal file
3
package/openvpn/openvpn.hash
Normal file
@@ -0,0 +1,3 @@
|
||||
# Locally calculated after checking signature
|
||||
sha256 a42f53570f669eaf10af68e98d65b531015ff9e12be7a62d9269ea684652f648 openvpn-2.4.7.tar.xz
|
||||
sha256 1fcb78d7e478bb8a9408010bdc91b36e213b1facfad093df3f7ce7e28af19043 COPYRIGHT.GPL
|
||||
51
package/openvpn/openvpn.mk
Normal file
51
package/openvpn/openvpn.mk
Normal file
@@ -0,0 +1,51 @@
|
||||
################################################################################
|
||||
#
|
||||
# openvpn
|
||||
#
|
||||
################################################################################
|
||||
|
||||
OPENVPN_VERSION = 2.4.7
|
||||
OPENVPN_SOURCE = openvpn-$(OPENVPN_VERSION).tar.xz
|
||||
OPENVPN_SITE = http://swupdate.openvpn.net/community/releases
|
||||
OPENVPN_DEPENDENCIES = host-pkgconf openssl
|
||||
OPENVPN_LICENSE = GPL-2.0
|
||||
OPENVPN_LICENSE_FILES = COPYRIGHT.GPL
|
||||
OPENVPN_CONF_OPTS = \
|
||||
--disable-plugin-auth-pam \
|
||||
--enable-iproute2 \
|
||||
--with-crypto-library=openssl \
|
||||
$(if $(BR2_STATIC_LIBS),--disable-plugins)
|
||||
OPENVPN_CONF_ENV = IFCONFIG=/sbin/ifconfig \
|
||||
NETSTAT=/bin/netstat \
|
||||
ROUTE=/sbin/route \
|
||||
IPROUTE=/sbin/ip
|
||||
|
||||
ifeq ($(BR2_PACKAGE_OPENVPN_SMALL),y)
|
||||
OPENVPN_CONF_OPTS += \
|
||||
--enable-small \
|
||||
--disable-plugins
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_OPENVPN_LZ4),y)
|
||||
OPENVPN_DEPENDENCIES += lz4
|
||||
else
|
||||
OPENVPN_CONF_OPTS += --disable-lz4
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_OPENVPN_LZO),y)
|
||||
OPENVPN_DEPENDENCIES += lzo
|
||||
else
|
||||
OPENVPN_CONF_OPTS += --disable-lzo
|
||||
endif
|
||||
|
||||
define OPENVPN_INSTALL_TARGET_CMDS
|
||||
$(INSTALL) -m 755 $(@D)/src/openvpn/openvpn \
|
||||
$(TARGET_DIR)/usr/sbin/openvpn
|
||||
endef
|
||||
|
||||
define OPENVPN_INSTALL_INIT_SYSV
|
||||
$(INSTALL) -m 755 -D package/openvpn/S60openvpn \
|
||||
$(TARGET_DIR)/etc/init.d/S60openvpn
|
||||
endef
|
||||
|
||||
$(eval $(autotools-package))
|
||||
Reference in New Issue
Block a user