-PKG_NAME := ppp
-PKG_VERSION := 2.4.3
-PKG_RELEASE := 3
-
-PKG_SOURCE_SITE := ftp://ftp.samba.org/pub/ppp/
-PKG_SOURCE_FILE := $(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_CAT := zcat
-PKG_SOURCE_DIR := $(PKG_NAME)-$(PKG_VERSION)
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_SOURCE_DIR)
-
-PKG_PPP := $(PACKAGE_DIR)/ppp_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
-PKG_PPP_PPPOE_PLUGIN := $(PACKAGE_DIR)/ppp-pppoe-plugin_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
-PKG_PPP_RADIUS_PLUGIN := $(PACKAGE_DIR)/ppp-radius-plugin_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
-PKG_PPPSTATS := $(PACKAGE_DIR)/pppstats_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
-PKG_PPPDUMP := $(PACKAGE_DIR)/pppdump_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
-
-I_PPP := $(PKG_BUILD_DIR)/ipkg/ppp
-I_PPP_PPPOE_PLUGIN := $(PKG_BUILD_DIR)/ipkg/ppp-pppoe-plugin
-I_PPP_RADIUS_PLUGIN := $(PKG_BUILD_DIR)/ipkg/ppp-radius-plugin
-I_PPPDUMP := $(PKG_BUILD_DIR)/ipkg/pppdump
-I_PPPSTATS := $(PKG_BUILD_DIR)/ipkg/pppstats
-
-TARGETS := $(PKG_PPP)
-ifneq ($(BR2_PACKAGE_PPP_PPPOE),)
-TARGETS += $(PKG_PPP_PPPOE_PLUGIN)
-endif
-ifneq ($(BR2_PACKAGE_PPP_RADIUS),)
-TARGETS += $(PKG_PPP_RADIUS_PLUGIN)
-endif
-ifneq ($(BR2_PACKAGE_PPPDUMP),)
-TARGETS += $(PKG_PPPDUMP)
-endif
-ifneq ($(BR2_PACKAGE_PPPSTATS),)
-TARGETS += $(PKG_PPPSTATS)
-endif
-
-INSTALL_TARGETS := $(IPKG_STATE_DIR)/info/ppp.list
-ifeq ($(BR2_PACKAGE_PPP_PPPOE),y)
-INSTALL_TARGETS += $(IPKG_STATE_DIR)/info/ppp-pppoe-plugin.list
-endif
-ifeq ($(BR2_PACKAGE_PPP_RADIUS),y)
-INSTALL_TARGETS += $(IPKG_STATE_DIR)/info/ppp-radius-plugin.list
-endif
-ifeq ($(BR2_PACKAGE_PPPDUMP),y)
-INSTALL_TARGETS += $(IPKG_STATE_DIR)/info/pppdump.list
-endif
-ifeq ($(BR2_PACKAGE_PPPSTATS),y)
-INSTALL_TARGETS += $(IPKG_STATE_DIR)/info/pppstats.list
-endif
-
-$(DL_DIR)/$(PKG_SOURCE_FILE):
- mkdir -p $(DL_DIR)
- $(WGET) -P $(DL_DIR) $(PKG_SOURCE_SITE)/$(PKG_SOURCE_FILE)
-
-$(PKG_BUILD_DIR)/.patched: $(DL_DIR)/$(PKG_SOURCE_FILE)
- mkdir -p $(TOOL_BUILD_DIR)
- $(PKG_SOURCE_CAT) $(DL_DIR)/$(PKG_SOURCE_FILE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
- $(PATCH) $(PKG_BUILD_DIR) . $(PKG_NAME).patch
- touch $(PKG_BUILD_DIR)/.patched
-
-$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.patched
- (cd $(PKG_BUILD_DIR); \
- rm -f config.cache; \
- $(TARGET_CONFIGURE_OPTS) \
- CFLAGS="$(TARGET_CFLAGS)" \
- ./configure \
- --target=$(GNU_TARGET_NAME) \
- --host=$(GNU_TARGET_NAME) \
- --build=$(GNU_HOST_NAME) \
- --prefix=/usr \
- --exec-prefix=/usr \
- --bindir=/usr/bin \
- --datadir=/usr/share \
- --infodir=/usr/share/info \
- --libexecdir=/usr/lib \
- --localstatedir=/var \
- --mandir=/usr/share/man \
- --sbindir=/usr/sbin \
- --sysconfdir=/etc \
- $(DISABLE_NLS))
- touch $(PKG_BUILD_DIR)/.configured
-
-$(PKG_BUILD_DIR)/pppd/pppd $(PKG_BUILD_DIR)/pppd/plugins/radius/radius.so: $(PKG_BUILD_DIR)/.configured
+PKG_NAME:=ppp
+PKG_VERSION:=2.4.3
+PKG_RELEASE:=10
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=ftp://ftp.samba.org/pub/ppp/
+PKG_MD5SUM:=848f6c3cafeb6074ffeb293c3af79b7c
+
+PKG_BUILD_DEPENDS:=libpcap
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+define Package/ppp/Default
+ SECTION:=net
+ CATEGORY:=Network
+ URL:=http://ppp.samba.org/
+endef
+
+define Package/ppp
+$(call Package/ppp/Default)
+ DEPENDS:=+kmod-ppp
+ TITLE:=PPP daemon
+ MENU:=1
+endef
+
+define Package/ppp/description
+ This package contains the PPP (Point-to-Point Protocol) daemon.
+endef
+
+define Package/ppp-mod-pppoa
+$(call Package/ppp/Default)
+ DEPENDS:=ppp +linux-atm +kmod-pppoa
+ TITLE:=PPPoA plugin
+endef
+
+define Package/ppp-mod-pppoa/description
+ This package contains a PPPoA (PPP over ATM) plugin for ppp.
+endef
+
+define Package/ppp-mod-pppoe
+$(call Package/ppp/Default)
+ DEPENDS:=ppp +kmod-pppoe
+ TITLE:=PPPoE plugin
+endef
+
+define Package/ppp-mod-pppoe/description
+ This package contains a PPPoE (PPP over Ethernet) plugin for ppp.
+endef
+
+define Package/ppp-mod-radius
+$(call Package/ppp/Default)
+ DEPENDS:=ppp
+ TITLE:=RADIUS plugin
+endef
+
+define Package/ppp-mod-radius/description
+ This package contains a RADIUS (Remote Authentication Dial-In User
+ Service) plugin for ppp.
+endef
+
+define Package/chat
+$(call Package/ppp/Default)
+ DEPENDS:=ppp
+ TITLE:=Establish conversation with a modem
+endef
+
+define Package/chat/description
+ This package contains an utility to establish conversation with other
+ PPP servers (via a modem).
+endef
+
+define Package/pppdump
+$(call Package/ppp/Default)
+ DEPENDS:=ppp
+ TITLE:=Read PPP record file
+endef
+
+define Package/pppdump/description
+ This package contains an utility to read PPP record file.
+endef
+
+define Package/pppstats
+$(call Package/ppp/Default)
+ DEPENDS:=ppp
+ TITLE:=Report PPP statistics
+endef
+
+define Package/pppstats/description
+ This package contains an utility to report PPP statistics.
+endef
+
+
+define Build/Configure
+$(call Build/Configure/Default,, \
+ UNAME_S="Linux" \
+ UNAME_R="$(LINUX_VERSION)" \
+ UNAME_M="$(ARCH)" \
+)
+endef
+
+define Build/Compile
+ rm -rf $(PKG_INSTALL_DIR)
+ mkdir -p $(PKG_INSTALL_DIR)/usr