提交 b98f515d 编写于 作者: D Dmitry Kozlov

updated contrib files

上级 53f22bd8
......@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.6)
cmake_policy(SET CMP0005 NEW)
cmake_policy(SET CMP0003 OLD)
PROJECT (accel-pptpd C)
PROJECT (accel-pppd C)
include(cmake/cpack.cmake)
......
......@@ -4,9 +4,9 @@ SET(CPACK_PACKAGE_VERSION_MAJOR "1")
SET(CPACK_PACKAGE_VERSION_MINOR "3")
SET(CPACK_PACKAGE_VERSION_PATCH "2")
SET(CPACK_PACKAGE_NAME "accel-pptp")
SET(CPACK_PACKAGE_NAME "accel-ppp")
SET(CPACK_PACKAGE_CONTACT "Dmitry Kozlov <xeb@mail.ru>")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "High-performance multi-protocol tunneling server for Linux")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "PPtP/L2TP/PPPoE server for Linux")
SET(CPACK_PACKAGE_VENDOR "Dmitry Kozlov")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
......
SET(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
SET(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME})
SET(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME})
if (BUILD_DRIVER_ONLY)
SET(CPACK_PACKAGE_NAME "accel-pptp-kmod")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "accel-pptp kernel module")
SET(CPACK_PACKAGE_NAME "accel-ppp-kmod")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "accel-ppp kernel module")
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian-kmod/postinst")
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/driver/driver/pptp.ko DESTINATION lib/modules/${DEBIAN_KDIR}/extra)
#SET(CPACK_DEBIAN_PACKAGE_DEPENDS "linux-image (= ${LINUX_IMAGE})")
......@@ -11,7 +11,7 @@ else (BUILD_DRIVER_ONLY)
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.7), libssl0.9.8 (>= 0.9.8), libpcre3 (>= 7.6)")
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian/postinst;${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian/conffiles")
INSTALL(FILES ${CMAKE_HOME_DIRECTORY}/accel-pptpd/accel-pptp.conf DESTINATION ${CMAKE_BINARY_DIR}/_CPack_Packages/Linux/DEB/${CPACK_PACKAGE_FILE_NAME}/etc RENAME accel-pptp.conf.dist)
INSTALL(FILES ${CMAKE_HOME_DIRECTORY}/contrib/debian/accel-pptp-init DESTINATION ${CMAKE_BINARY_DIR}/_CPack_Packages/Linux/DEB/${CPACK_PACKAGE_FILE_NAME}/etc/init.d RENAME accel-pptp)
INSTALL(FILES ${CMAKE_HOME_DIRECTORY}/contrib/debian/accel-pptp-default DESTINATION ${CMAKE_BINARY_DIR}/_CPack_Packages/Linux/DEB/${CPACK_PACKAGE_FILE_NAME}/etc/default RENAME accel-pptp)
INSTALL(FILES ${CMAKE_HOME_DIRECTORY}/accel-pppd/accel-ppp.conf DESTINATION ${CMAKE_BINARY_DIR}/_CPack_Packages/Linux/DEB/${CPACK_PACKAGE_FILE_NAME}/etc RENAME accel-ppp.conf.dist)
INSTALL(FILES ${CMAKE_HOME_DIRECTORY}/contrib/debian/accel-ppp-init DESTINATION ${CMAKE_BINARY_DIR}/_CPack_Packages/Linux/DEB/${CPACK_PACKAGE_FILE_NAME}/etc/init.d RENAME accel-ppp)
INSTALL(FILES ${CMAKE_HOME_DIRECTORY}/contrib/debian/accel-ppp-default DESTINATION ${CMAKE_BINARY_DIR}/_CPack_Packages/Linux/DEB/${CPACK_PACKAGE_FILE_NAME}/etc/default RENAME accel-ppp)
endif (BUILD_DRIVER_ONLY)
#!/bin/sh
# /etc/init.d/accel-pptpd: set up the accel-pptp server
# /etc/init.d/accel-pppd: set up the accel-ppp server
### BEGIN INIT INFO
# Provides: accel-pptp
# Provides: accel-ppp
# Required-Start: $networking
# Required-Stop: $networking
# Default-Start: 2 3 4 5
......@@ -14,27 +14,27 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin
. /lib/lsb/init-functions
if test -f /etc/default/accel-pptp; then
. /etc/default/accel-pptp
if test -f /etc/default/accel-ppp; then
. /etc/default/accel-ppp
fi
if [ -z $ACCEL_PPPTD_OPTS ]; then
ACCEL_PPTPD_OPTS="-c /etc/accel-pptp.conf"
if [ -z $ACCEL_PPPD_OPTS ]; then
ACCEL_PPPD_OPTS="-c /etc/accel-ppp.conf"
fi
case "$1" in
start)
log_daemon_msg "Starting accel-pptp server" "accel-pptpd"
if start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/accel-pptpd -- -d -p /var/run/accel-pptpd.pid $ACCEL_PPTPD_OPTS; then
log_daemon_msg "Starting PPtP/L2TP/PPPoE server" "accel-pppd"
if start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/accel-pppd -- -d -p /var/run/accel-pppd.pid $ACCEL_PPPD_OPTS; then
log_end_msg 0
else
log_end_msg 1
fi
;;
restart)
log_daemon_msg "Restarting accel-pptp server" "accel-pptpd"
start-stop-daemon --stop --quiet --oknodo --retry 180 --pidfile /var/run/accel-pptpd.pid
if start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/accel-pptpd -- -d -p /var/run/accel-pptpd.pid $ACCEL_PPTPD_OPTS; then
log_daemon_msg "Restarting PPtP/L2TP/PPPoE server" "accel-pppd"
start-stop-daemon --stop --quiet --oknodo --retry 180 --pidfile /var/run/accel-pppd.pid
if start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/accel-pppd -- -d -p /var/run/accel-pppd.pid $ACCEL_PPPD_OPTS; then
log_end_msg 0
else
log_end_msg 1
......@@ -42,8 +42,8 @@ case "$1" in
;;
stop)
log_daemon_msg "Stopping accel-pptp server" "accel-pptpd"
start-stop-daemon --stop --quiet --oknodo --retry 180 --pidfile /var/run/accel-pptpd.pid
log_daemon_msg "Stopping PPtP/L2TP/PPPoE server" "accel-pppd"
start-stop-daemon --stop --quiet --oknodo --retry 180 --pidfile /var/run/accel-pppd.pid
log_end_msg 0
;;
......@@ -51,7 +51,7 @@ case "$1" in
do_status
;;
*)
log_success_msg "Usage: /etc/init.d/accel-pptp {start|stop|status|restart}"
log_success_msg "Usage: /etc/init.d/accel-ppp {start|stop|status|restart}"
exit 1
;;
esac
......
......@@ -5,24 +5,23 @@ EAPI=2
inherit eutils linux-mod cmake-utils
DESCRIPTION="Point-to-Point Tunnelling Protocol Client/Server for Linux"
SRC_URI="http://sourceforge.net/projects/accel-pptp/files/accel-pptp/${P}.tar.bz2"
HOMEPAGE="http://accel-pptp.sourceforge.net/"
DESCRIPTION="PPtP/L2TP/PPPoE server for Linux"
SRC_URI="http://sourceforge.net/projects/accel-ppp/files/accel-ppp/${P}.tar.bz2"
HOMEPAGE="http://accel-ppp.sourceforge.net/"
SLOT="0"
LICENSE="GPL"
KEYWORDS="~amd64 ~x86"
IUSE="postgres debug l2tp shaper"
IUSE="postgres debug shaper pptp_driver"
DEPEND=">=sys-libs/glibc-2.8
dev-libs/openssl
dev-libs/libaio
l2tp? ( =dev-libs/libnl-9999 )
shaper? ( =dev-libs/libnl-9999 )
shaper? ( =dev-libs/libnl-2 )
postgres? ( >=dev-db/postgresql-base-8.1 )"
RDEPEND="$DEPEND
virtual/modutils"
pptp_driver? ( virtual/modutils )"
BUILD_TARGETS="default"
BUILD_PARAMS="KDIR=${KERNEL_DIR}"
......@@ -32,7 +31,7 @@ PREFIX="/"
MODULE_NAMES="pptp(extra:${S}/driver/)"
src_prepare() {
sed -i -e "/mkdir/d" "${S}/accel-pptpd/CMakeLists.txt"
sed -i -e "/mkdir/d" "${S}/accel-pppd/CMakeLists.txt"
sed -i -e "/INSTALL/d" "${S}/driver/CMakeLists.txt"
}
......@@ -44,10 +43,6 @@ src_configure() {
if use postgres; then
mycmakeargs+=( "-DLOG_PGSQL=TRUE" )
fi
if use l2tp; then
mycmakeargs+=( "-DL2TP=TRUE" )
fi
if use shaper; then
mycmakeargs+=( "-DSHAPER=TRUE" )
......@@ -58,23 +53,28 @@ src_configure() {
src_compile() {
cmake-utils_src_compile
cd ${S}/driver
linux-mod_src_compile || die "failed to build driver"
if use pptp_driver; then
cd ${S}/driver
linux-mod_src_compile || die "failed to build driver"
fi
}
src_install() {
cmake-utils_src_install
cd ${S}/driver
linux-mod_src_install
if use pptp_driver; then
cd ${S}/driver
linux-mod_src_install
fi
exeinto /etc/init.d
newexe "${S}/contrib/gentoo/net-dialup/accel-pptp/files/pptpd-init" accel-pptpd
newexe "${S}/contrib/gentoo/net-dialup/accel-ppp/files/accel-pppd-init" accel-pppd
insinto /etc/conf.d
newins "${S}/contrib/gentoo/net-dialup/accel-pptp/files/pptpd-confd" accel-pptpd
newins "${S}/contrib/gentoo/net-dialup/accel-ppp/files/pppd-confd" accel-pppd
dodir /var/log/accel-pptp
dodir /var/log/accel-ppp
dodir /var/run/accel-ppp
dodir /var/run/radattr
}
......@@ -5,16 +5,16 @@ EAPI=2
inherit eutils git linux-mod cmake-utils
EGIT_REPO_URI="git://accel-pptp.git.sourceforge.net/gitroot/accel-pptp/accel-pptp"
EGIT_REPO_URI="git://accel-ppp.git.sourceforge.net/gitroot/accel-ppp/accel-ppp"
DESCRIPTION="Point-to-Point Tunnelling Protocol Client/Server for Linux"
DESCRIPTION="PPtP/L2TP/PPPoE Server for Linux"
SRC_URI=""
HOMEPAGE="http://accel-pptp.sourceforge.net/"
HOMEPAGE="http://accel-ppp.sourceforge.net/"
SLOT="0"
LICENSE="GPL"
KEYWORDS="~amd64 ~x86"
IUSE="postgres debug shaper"
IUSE="postgres debug shaper pptp_driver"
DEPEND=">=sys-libs/glibc-2.8
dev-libs/openssl
......@@ -23,7 +23,7 @@ DEPEND=">=sys-libs/glibc-2.8
postgres? ( >=dev-db/postgresql-base-8.1 )"
RDEPEND="$DEPEND
virtual/modutils"
pptp_driver? ( virtual/modutils )"
BUILD_TARGETS="default"
BUILD_PARAMS="KDIR=${KERNEL_DIR}"
......@@ -37,8 +37,8 @@ src_unpack () {
}
src_prepare() {
sed -i -e "/mkdir/d" "${S}/accel-pptpd/CMakeLists.txt"
sed -i -e "/echo/d" "${S}/accel-pptpd/CMakeLists.txt"
sed -i -e "/mkdir/d" "${S}/accel-pppd/CMakeLists.txt"
sed -i -e "/echo/d" "${S}/accel-pppd/CMakeLists.txt"
sed -i -e "/INSTALL/d" "${S}/driver/CMakeLists.txt"
}
......@@ -61,24 +61,28 @@ src_configure() {
src_compile() {
cmake-utils_src_compile
cd ${S}/driver
#convert_to_m Makefile
linux-mod_src_compile || die "failed to build driver"
if use pptp_driver; then
cd ${S}/driver
#convert_to_m Makefile
linux-mod_src_compile || die "failed to build driver"
fi
}
src_install() {
cmake-utils_src_install
cd ${S}/driver
linux-mod_src_install
if use pptp_driver; then
cd ${S}/driver
linux-mod_src_install
fi
exeinto /etc/init.d
newexe "${S}/contrib/gentoo/net-dialup/accel-pptp/files/pptpd-init" accel-pptpd
newexe "${S}/contrib/gentoo/net-dialup/accel-ppp/files/accel-pppd-init" accel-pppd
insinto /etc/conf.d
newins "${S}/contrib/gentoo/net-dialup/accel-pptp/files/pptpd-confd" accel-pptpd
newins "${S}/contrib/gentoo/net-dialup/accel-ppp/files/accel-pppd-confd" accel-pppd
dodir /var/log/accel-pptp
dodir /var/run/accel-pptp
dodir /var/log/accel-ppp
dodir /var/run/accel-ppp
dodir /var/run/radattr
}
......@@ -2,4 +2,4 @@
# Any extra options you want to pass to pptpd
# on start-up should be put here.
PPTPD_OPTS="-d -c /etc/accel-pptp.conf"
ACCEL_PPPD_OPTS="-d -c /etc/accel-ppp.conf"
#!/sbin/runscript
depend() {
need net
}
start() {
ebegin "Starting accel-pptpd"
start-stop-daemon --start --quiet --exec /usr/sbin/accel-pptpd -- -p /var/run/pptpd.pid ${PPTPD_OPTS}
eend $?
}
stop() {
ebegin "Stopping accel-pptpd"
start-stop-daemon --stop --quiet --pidfile /var/run/pptpd.pid
result=$?
start-stop-daemon --stop --quiet --oknodo --exec /usr/sbin/accel-pptpd
result=$(( $result + $? ))
eend $result
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册