[oe-commits] org.oe.dev rp-pppoe 3.8: More cleanups to the pppoe package:
lenehan commit
openembedded-commits at lists.openembedded.org
Thu Jun 7 16:57:16 UTC 2007
rp-pppoe 3.8: More cleanups to the pppoe package:
* Seperate out the server, sniff and relay programs from the main
package.
* Add an init script for the server.
* Add templates to the AC_DEFINE's in the configure script so the
variables are correctly added to the header. Without this the
variables don't get added and server and relay complain about not
being able to be used on linux 2.0 system.
Author: lenehan at openembedded.org
Branch: org.openembedded.dev
Revision: 5e2d15cbe531dc544eb1c04db1880abe0226013f
ViewMTN: http://monotone.openembedded.org/revision.psp?id=5e2d15cbe531dc544eb1c04db1880abe0226013f
Files:
1
packages/rp-pppoe/rp-pppoe-3.8/pppoe-server.default
packages/rp-pppoe/rp-pppoe-3.8/pppoe-server.init
packages/rp-pppoe/rp-pppoe-3.8/configure_in_cross.patch
packages/rp-pppoe/rp-pppoe_3.8.bb
mtn:execute
true
Diffs:
#
# mt diff -rca4352019fea2c61637c38660d9eed6d21eacc82 -r5e2d15cbe531dc544eb1c04db1880abe0226013f
#
#
#
# add_file "packages/rp-pppoe/rp-pppoe-3.8/pppoe-server.default"
# content [52037ba6edf14d95cdb204edf292a4a22970deff]
#
# add_file "packages/rp-pppoe/rp-pppoe-3.8/pppoe-server.init"
# content [9167dad4f2ff984cf0d7a640fca743cbf05c8c0a]
#
# patch "packages/rp-pppoe/rp-pppoe-3.8/configure_in_cross.patch"
# from [5f93f176bc84040fa4aa56c03191ae287960d070]
# to [0cfb9d872274d804ea4276941d3cc26a2187b7ed]
#
# patch "packages/rp-pppoe/rp-pppoe_3.8.bb"
# from [eb56536bdb7e178e8911738e5cbb847de56e88bd]
# to [2451465e79c0c95ac59cb628be06f4772df0b729]
#
# set "packages/rp-pppoe/rp-pppoe-3.8/pppoe-server.init"
# attr "mtn:execute"
# value "true"
#
============================================================
--- packages/rp-pppoe/rp-pppoe-3.8/pppoe-server.default 52037ba6edf14d95cdb204edf292a4a22970deff
+++ packages/rp-pppoe/rp-pppoe-3.8/pppoe-server.default 52037ba6edf14d95cdb204edf292a4a22970deff
@@ -0,0 +1,22 @@
+# PPPoE Server options
+
+# Maximum segment size, not used for in kernel PPPoE
+#MSS=1412
+
+# Device(s) - Space seperated list of devices to listen on
+#DEVICES="eth1"
+
+# Local IP
+#LOCAL_IP=10.0.0.1
+
+# Starting remote IP
+#REMOTE_IP=10.67.15.1
+
+# Service name
+#SERVICE_NAME="acme"
+
+# Maximum number of sessions, default is 16
+#MAX_SESSIONS=64
+
+# Access concentrator name, default is the hostname
+#ACCESS_CONCENTRATOR_NAME="pppoe-rtr-1"
============================================================
--- packages/rp-pppoe/rp-pppoe-3.8/pppoe-server.init 9167dad4f2ff984cf0d7a640fca743cbf05c8c0a
+++ packages/rp-pppoe/rp-pppoe-3.8/pppoe-server.init 9167dad4f2ff984cf0d7a640fca743cbf05c8c0a
@@ -0,0 +1,59 @@
+#! /bin/sh
+
+test -f /usr/sbin/pppoe-server || exit 0
+test -f /etc/default/pppoe-server && . /etc/default/pppoe-server
+
+case $1 in
+ start)
+ OPTIONS=""
+ if [ -n "$MSS" ]; then
+ OPTIONS="$OPTIONS -m $MSS"
+ fi
+ if [ -n "$DEVICES" ]; then
+ for i in $DEVICES; do
+ OPTIONS="$OPTIONS -I $i"
+ done
+ fi
+ if [ -n "$LOCAL_IP" ]; then
+ OPTIONS="$OPTIONS -L $LOCAL_IP"
+ fi
+ if [ -n "$REMOTE_IP" ]; then
+ OPTIONS="$OPTIONS -R $REMOTE_IP"
+ fi
+ if [ -n "$SERVICE_NAME" ]; then
+ OPTIONS="$OPTIONS -S $SERVICE_NAME"
+ fi
+ if [ -n "$MAX_SESSIONS" ]; then
+ OPTIONS="$OPTIONS -N $MAX_SESSIONS"
+ fi
+ if [ -n "$ACCESS_CONCENTRATOR_NAME" ]; then
+ OPTIONS="$OPTIONS -C $ACCESS_CONCENTRATOR_NAME"
+ fi
+ echo -n "Starting PPPoE server: pppoe-server"
+ start-stop-daemon --start --quiet --exec /usr/sbin/pppoe-server -- $OPTIONS
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping PPPoE server: pppoe-server"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/pppoe-server -- $OPTIONS
+ echo "."
+ ;;
+ status)
+ pid=$(pidof pppoe-server)
+ if [ -n "$pid" ] ; then
+ echo "Running with pid $pid"
+ else
+ echo "Not running"
+ fi
+ ;;
+ restart|force-reload)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "Usage: /etc/init.d/pppoe-server {start|stop|restart|force-reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
============================================================
--- packages/rp-pppoe/rp-pppoe-3.8/configure_in_cross.patch 5f93f176bc84040fa4aa56c03191ae287960d070
+++ packages/rp-pppoe/rp-pppoe-3.8/configure_in_cross.patch 0cfb9d872274d804ea4276941d3cc26a2187b7ed
@@ -1,7 +1,7 @@ Index: src/configure.in
Index: src/configure.in
===================================================================
---- rp-pppoe-3.8.org/src/configure.in 2006-04-03 00:29:42.000000000 +1000
-+++ rp-pppoe-3.8/src/configure.in 2007-06-07 20:00:48.000000000 +1000
+--- rp-pppoe-3.8.orig/src/configure.in 2006-04-03 00:29:42.000000000 +1000
++++ rp-pppoe-3.8/src/configure.in 2007-06-07 22:19:36.000000000 +1000
@@ -5,6 +5,13 @@
dnl pppd directory for kernel-mode PPPoE
PPPD_DIR=ppp-2.4.1.pppoe2
@@ -16,6 +16,40 @@ Index: src/configure.in
AC_CONFIG_HEADER(config.h)
AC_PREFIX_DEFAULT(/usr)
+@@ -44,7 +51,7 @@
+ AC_MSG_RESULT($ac_cv_struct_sockaddr_ll)
+
+ if test "$ac_cv_struct_sockaddr_ll" = yes ; then
+-AC_DEFINE(HAVE_STRUCT_SOCKADDR_LL)
++AC_DEFINE([HAVE_STRUCT_SOCKADDR_LL], [], [Have struct SOCKADDR_LL])
+ fi
+
+ dnl Check for N_HDLC line discipline
+@@ -55,7 +62,7 @@
+ ac_cv_n_hdlc=no)
+ AC_MSG_RESULT($ac_cv_n_hdlc)
+ if test "$ac_cv_n_hdlc" = yes ; then
+-AC_DEFINE(HAVE_N_HDLC)
++AC_DEFINE([HAVE_N_HDLC], [], [Have N_HDLC])
+ fi
+
+ AC_ARG_ENABLE(plugin, [ --enable-plugin=pppd_src_path build pppd plugin], ac_cv_pluginpath=$enableval, ac_cv_pluginpath=no)
+@@ -100,13 +107,13 @@
+ if test "$ac_cv_header_linux_if_pppox_h" = yes ; then
+ if test "$ac_cv_pluginpath" != no ; then
+ LINUX_KERNELMODE_PLUGIN=rp-pppoe.so
+- AC_DEFINE(HAVE_LINUX_KERNEL_PPPOE)
++ AC_DEFINE([HAVE_LINUX_KERNEL_PPPOE], [], [Have kernel PPPoE])
+ PPPD_INCDIR=$ac_cv_pluginpath
+ fi
+ fi
+
+ if test "$ac_cv_debugging" = "yes" ; then
+- AC_DEFINE(DEBUGGING_ENABLED)
++ AC_DEFINE([DEBUGGING_ENABLED], [], [Debugging enabled])
+ fi
+
+ AC_SUBST(LINUX_KERNELMODE_PLUGIN)
@@ -131,15 +138,8 @@
AC_CHECK_SIZEOF(unsigned int)
AC_CHECK_SIZEOF(unsigned long)
@@ -79,7 +113,7 @@ Index: src/configure.in
AC_TRY_RUN([
union foo {
struct bar {
-@@ -245,6 +209,7 @@
+@@ -245,10 +209,11 @@
}
}], rpppoe_cv_pack_bitfields=normal, rpppoe_cv_pack_bitfields=rev,
$ECHO "no defaults for cross-compiling"; exit 0)
@@ -87,3 +121,16 @@ Index: src/configure.in
if test "$rpppoe_cv_pack_bitfields" = "rev" ; then
AC_MSG_RESULT(reversed)
+- AC_DEFINE(PACK_BITFIELDS_REVERSED)
++ AC_DEFINE([PACK_BITFIELDS_REVERSED], [], [Reversed bitfields])
+ else
+ AC_MSG_RESULT(normal)
+ fi
+@@ -312,6 +277,7 @@
+ AC_SUBST(RDYNAMIC)
+ AC_SUBST(LIBEVENT)
+ AC_SUBST(ECHO)
++AC_SUBST(HAVE_STRUCT_SOCKADDR_LL)
+
+ datadir_evaluated=`eval echo $datadir`
+ AC_SUBST(datadir_evaluated)
============================================================
--- packages/rp-pppoe/rp-pppoe_3.8.bb eb56536bdb7e178e8911738e5cbb847de56e88bd
+++ packages/rp-pppoe/rp-pppoe_3.8.bb 2451465e79c0c95ac59cb628be06f4772df0b729
@@ -1,18 +1,21 @@ LICENSE = "GPLv2"
DESCRIPTION = "A user-mode PPPoE client and server suite for Linux"
HOMEPAGE = "http://www.roaringpenguin.com/en/penguin/openSourceProducts/rpPppoe"
SECTION = "console/network"
LICENSE = "GPLv2"
-RDEPENDS = "ppp"
-RRECOMMENDS = "ppp-oe"
-PR = "r1"
+RDEPENDS_${PN} = "ppp"
+RDEPENDS_${PN}-server = "ppp"
+RRECOMMENDS_${PN} = "ppp-oe"
+PR = "r2"
SRC_URI = "http://www.roaringpenguin.com/files/download/${P}.tar.gz \
file://configure_in_cross.patch;patch=1;pnum=2 \
- file://pppoe-src-restrictions.patch;patch=1;pnum=2"
+ file://pppoe-src-restrictions.patch;patch=1;pnum=2 \
+ file://pppoe-server.default \
+ file://pppoe-server.init"
S = "${WORKDIR}/${P}/src"
-inherit autotools
+inherit autotools update-rc.d
do_install() {
# Set timeout to 0. Fixes lots of reconnect issues
@@ -21,18 +24,38 @@ do_install() {
sed -i -e 's,\(CONNECT_TIMEOUT=\)30,\10,g' \
-e 's,\(LINUX_PLUGIN=\)/etc/ppp/plugins/rp-pppoe.so,\1rp-pppoe.so,g' \
${S}/../configs/pppoe.conf
+ # Install init script and default settings
+ install -m 0755 -d ${D}${sysconfdir}/default ${D}${sysconfdir}/init.d
+ install -m 0644 ${WORKDIR}/pppoe-server.default ${D}${sysconfdir}/default/pppoe-server
+ install -m 0755 ${WORKDIR}/pppoe-server.init ${D}${sysconfdir}/init.d/pppoe-server
# Install
oe_runmake -C ${S} RPM_INSTALL_ROOT=${D} docdir=${docdir} install
}
-pkg_postinst() {
+# Insert server package before main package
+PACKAGES = "${PN}-dbg ${PN}-server ${PN}-relay ${PN}-sniff ${PN} ${PN}-doc"
+
+FILES_${PN}-server = "${sysconfdir}/default/pppoe-server \
+ ${sysconfdir}/init.d/pppoe-server \
+ ${sbindir}/pppoe-server \
+ ${sysconfdir}/ppp/pppoe-server-options"
+FILES_${PN}-relay = "${sbindir}/pppoe-relay"
+FILES_${PN}-sniff = "${sbindir}/pppoe-sniff"
+
+pkg_postinst_${PN} () {
if [ x"$D" != "x" ]; then
exit 1
fi
chmod 4755 ${sbindir}/pppoe
}
-CONFFILES_${PN} = "${sysconfdir}/ppp/pppoe-server-options \
- ${sysconfdir}/ppp/pppoe.conf \
+CONFFILES_${PN} = "${sysconfdir}/ppp/pppoe.conf \
${sysconfdir}/ppp/firewall-standalone \
${sysconfdir}/ppp/firewall-masq"
+CONFFILES_${PN}-server = "${sysconfdir}/ppp/pppoe-server-options \
+ ${sysconfdir}/default/pppoe-server"
+
+INITSCRIPT_PACKAGES = "${PN}-server"
+INITSCRIPT_NAME_${PN}-server = "pppoe-server"
+INITSCRIPT_PARAMS_${PN}-server = "defaults 92 08"
+
More information about the Openembedded-commits
mailing list