Ported pptpd to buildroot-ng
authorGerry Rozema <groz@openwrt.org>
Fri, 21 Jul 2006 12:00:20 +0000 (12:00 +0000)
committerGerry Rozema <groz@openwrt.org>
Fri, 21 Jul 2006 12:00:20 +0000 (12:00 +0000)
SVN-Revision: 4191

net/pptpd/Makefile [new file with mode: 0755]
net/pptpd/files/options.pptpd [new file with mode: 0644]
net/pptpd/files/pptpd.conf [new file with mode: 0644]
net/pptpd/files/pptpd.init [new file with mode: 0644]
net/pptpd/patches/bad-pqueue-debug.patch [new file with mode: 0644]
net/pptpd/patches/pptpgre-use-debug-option.patch [new file with mode: 0644]
net/wpa_supplicant/Makefile

diff --git a/net/pptpd/Makefile b/net/pptpd/Makefile
new file mode 100755 (executable)
index 0000000..8f07f0d
--- /dev/null
@@ -0,0 +1,93 @@
+# 
+# Copyright (C) 2006 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# $Id:$
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pptpd
+PKG_VERSION:=1.3.0
+PKG_RELEASE:=1
+PKG_MD5SUM:=75d494e881f7027f4e60b114163f6b67
+
+PKG_SOURCE_URL:=@SF/poptop
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_CAT:=zcat
+
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/pptpd
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=
+  TITLE:=PopTop pptp server
+  DESCRIPTION:=PopTop pptp server
+endef
+
+
+define Build/Configure
+       (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \
+               $(TARGET_CONFIGURE_OPTS) \
+               CFLAGS="$(TARGET_CFLAGS)" \
+               ./configure \
+                 --target=$(GNU_TARGET_NAME) \
+                 --host=$(GNU_TARGET_NAME) \
+                 --build=$(GNU_HOST_NAME) \
+                 --program-prefix="" \
+                 --program-suffix="" \
+                 --prefix=/usr \
+                 --exec-prefix=/usr \
+                 --bindir=/usr/bin \
+                 --datadir=/usr/share \
+                 --includedir=/usr/include \
+                 --infodir=/usr/share/info \
+                 --libdir=/usr/lib \
+                 --libexecdir=/usr/lib \
+                 --localstatedir=/var \
+                 --mandir=/usr/share/man \
+                 --sbindir=/usr/sbin \
+                 --sysconfdir=/etc \
+                 $(DISABLE_LARGEFILE) \
+                 $(DISABLE_NLS) \
+                 --with-pppd-ip-alloc \
+       )
+endef
+
+define Build/Compile
+       rm -rf $(PKG_INSTALL_DIR)
+       mkdir -p $(PKG_INSTALL_DIR)
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               CC=$(TARGET_CC) \
+               CFLAGS="$(TARGET_CFLAGS) -DSBINDIR=\\\"/usr/sbin\\\"" \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               INSTALL="install" \
+               all install
+endef
+
+define Package/pptpd/install
+       install -d -m0755 $(1)/etc
+       install -m0644 ./files/pptpd.conf $(1)/etc/
+       install -d -m0755 $(1)/etc/init.d
+       install -m0755 ./files/pptpd.init $(1)/etc/init.d/S50pptpd
+       install -d -m0755 $(1)/etc/ppp
+       install -m0644 ./files/options.pptpd $(1)/etc/ppp/
+       install -d -m0755 $(1)/usr/sbin
+       install -d -m0755 $(1)/usr/lib/pptpd
+       cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/pptpd $(1)/usr/sbin/
+       cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/pptpctrl $(1)/usr/sbin/
+       cp -fpR $(PKG_INSTALL_DIR)/usr/lib/pptpd/* $(1)/usr/lib/pptpd
+       $(STRIP) $1/usr/sbin/*
+       $(STRIP) $1/usr/lib/pptpd/*
+endef
+
+$(eval $(call BuildPackage,pptpd))
+
+
+
diff --git a/net/pptpd/files/options.pptpd b/net/pptpd/files/options.pptpd
new file mode 100644 (file)
index 0000000..5dd2daf
--- /dev/null
@@ -0,0 +1,23 @@
+#debug
+#logfile /tmp/pptp-server.log
+172.16.1.1:
+auth
+name "pptp-server"
+lcp-echo-failure 3
+lcp-echo-interval 60
+default-asyncmap
+mtu 1482
+mru 1482
+nobsdcomp
+nodeflate
+#noproxyarp
+#nomppc
+mppe required,no40,no56,stateless
+require-mschap-v2
+refuse-chap
+refuse-mschap
+refuse-eap
+refuse-pap
+#ms-dns 172.16.1.1
+#plugin radius.so
+#radius-config-file /etc/radius.conf
diff --git a/net/pptpd/files/pptpd.conf b/net/pptpd/files/pptpd.conf
new file mode 100644 (file)
index 0000000..354745f
--- /dev/null
@@ -0,0 +1,5 @@
+#debug
+option /etc/ppp/options.pptpd
+speed 115200
+stimeout 10
+#localip & remoteip are not needed, ip management is done by pppd
diff --git a/net/pptpd/files/pptpd.init b/net/pptpd/files/pptpd.init
new file mode 100644 (file)
index 0000000..d4944c7
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+BIN=pptpd
+DEFAULT=/etc/default/$BIN
+RUN_D=/var/run
+PID_F=$RUN_D/$BIN.pid
+[ -f $DEFAULT ] && . $DEFAULT
+
+case $1 in
+ start)
+  mkdir -p $RUN_D
+  for m in arc4 sha1 slhc crc-ccitt ppp_generic ppp_async ppp_mppe_mppc; do
+   insmod $m >/dev/null 2>&1
+  done
+  $BIN $OPTIONS
+  ;;
+ stop)
+  [ -f $PID_F ] && kill $(cat $PID_F)
+  ;;
+ *)
+  echo "usage: $0 (start|stop)"
+  exit 1
+esac
+
+exit $?
diff --git a/net/pptpd/patches/bad-pqueue-debug.patch b/net/pptpd/patches/bad-pqueue-debug.patch
new file mode 100644 (file)
index 0000000..87e7664
--- /dev/null
@@ -0,0 +1,20 @@
+diff -urN pptpd-1.3.0/pqueue.c.orig pptpd-1.3.0/pqueue.c
+--- pptpd-1.3.0/pqueue.c.orig  2006-04-17 20:44:28.000000000 -0400
++++ pptpd-1.3.0/pqueue.c       2006-04-17 20:44:58.000000000 -0400
+@@ -6,14 +6,11 @@
+ #include "pqueue.h"
+ #ifdef DEBUG_PQUEUE
+-#define DEBUG_ON 1
++#define DEBUG_CMD(_a) { _a }
+ #else
+-#define DEBUG_ON 0
++#define DEBUG_CMD(_a)
+ #endif
+-#define DEBUG_CMD(_a) if (DEBUG_ON) { _a }
+-
+-
+ #define MIN_CAPACITY 128 /* min allocated buffer for a packet */
+ static int pqueue_alloc (int seq, unsigned char *packet, int packlen, pqueue_t **new);
diff --git a/net/pptpd/patches/pptpgre-use-debug-option.patch b/net/pptpd/patches/pptpgre-use-debug-option.patch
new file mode 100644 (file)
index 0000000..d4ffe5c
--- /dev/null
@@ -0,0 +1,35 @@
+diff -Nur pptpd-1.3.0/pptpgre.c.orig pptpd-1.3.0/pptpgre.c
+--- pptpd-1.3.0/pptpgre.c.orig 2006-04-18 02:13:10.000000000 -0400
++++ pptpd-1.3.0/pptpgre.c      2006-04-18 02:14:19.000000000 -0400
+@@ -46,6 +46,9 @@
+ #define PACKET_MAX 8196
++/* Command Line Variable Args */
++extern int pptpctrl_debug;
++
+ typedef int (*callback_t)(int cl, void *pack, unsigned int len);
+ /* test for a 32 bit counter overflow */
+@@ -319,7 +322,9 @@
+                       stats.rx_lost += head->seq - gre.seq_recv - 1;
+                       syslog(LOG_DEBUG, "GRE: timeout waiting for %d packets", head->seq - gre.seq_recv - 1);        
+               }
+-              syslog(LOG_DEBUG, "GRE: accepting #%d from queue", head->seq);
++              if (pptpctrl_debug) {
++                      syslog(LOG_DEBUG, "GRE: accepting #%d from queue", head->seq);
++              }
+               gre.seq_recv = head->seq;
+               status = callback(cl, head->packet, head->packlen);
+               pqueue_del(head);
+@@ -399,7 +404,9 @@
+               }
+               /* check for out-of-order sequence number */
+               if (seq_greater(seq, gre.seq_recv)) {
+-                      syslog(LOG_DEBUG, "GRE: accepting packet #%d", seq);
++                      if (pptpctrl_debug) {
++                              syslog(LOG_DEBUG, "GRE: accepting packet #%d", seq);
++                      }
+                       stats.rx_accepted++;
+                       gre.seq_recv = seq;
+                       return cb(cl, buffer + ip_len + headersize, payload_len);
index 00e477c..8e88632 100755 (executable)
@@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=wpa_supplicant
 PKG_VERSION:=0.4.9
 PKG_RELEASE:=1
-PKG_MD5SUM:=
+PKG_MD5SUM:=98498c152cbfc388c306fd9bbf7d57d4
 
 PKG_SOURCE_URL:=http://hostap.epitest.fi/releases
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz