3 include $(TOPDIR)/rules.mk
8 PKG_MD5SUM := 848f6c3cafeb6074ffeb293c3af79b7c
10 PKG_SOURCE_SITE := ftp://ftp.samba.org/pub/ppp/
11 PKG_SOURCE_FILE := $(PKG_NAME)-$(PKG_VERSION).tar.gz
12 PKG_SOURCE_CAT := zcat
13 PKG_SOURCE_DIR := $(PKG_NAME)-$(PKG_VERSION)
14 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_SOURCE_DIR)
16 PKG_PPP := $(PACKAGE_DIR)/ppp_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
17 PKG_PPP_PPPOE_PLUGIN := $(PACKAGE_DIR)/ppp-pppoe-plugin_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
18 PKG_PPP_RADIUS_PLUGIN := $(PACKAGE_DIR)/ppp-radius-plugin_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
19 PKG_PPPSTATS := $(PACKAGE_DIR)/pppstats_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
20 PKG_PPPDUMP := $(PACKAGE_DIR)/pppdump_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
22 I_PPP := $(PKG_BUILD_DIR)/ipkg/ppp
23 I_PPP_PPPOE_PLUGIN := $(PKG_BUILD_DIR)/ipkg/ppp-pppoe-plugin
24 I_PPP_RADIUS_PLUGIN := $(PKG_BUILD_DIR)/ipkg/ppp-radius-plugin
25 I_PPPDUMP := $(PKG_BUILD_DIR)/ipkg/pppdump
26 I_PPPSTATS := $(PKG_BUILD_DIR)/ipkg/pppstats
29 ifneq ($(BR2_PACKAGE_PPP_PPPOE),)
30 TARGETS += $(PKG_PPP_PPPOE_PLUGIN)
32 ifneq ($(BR2_PACKAGE_PPP_RADIUS),)
33 TARGETS += $(PKG_PPP_RADIUS_PLUGIN)
35 ifneq ($(BR2_PACKAGE_PPPDUMP),)
36 TARGETS += $(PKG_PPPDUMP)
38 ifneq ($(BR2_PACKAGE_PPPSTATS),)
39 TARGETS += $(PKG_PPPSTATS)
42 INSTALL_TARGETS := $(IPKG_STATE_DIR)/info/ppp.list
43 ifeq ($(BR2_PACKAGE_PPP_PPPOE),y)
44 INSTALL_TARGETS += $(IPKG_STATE_DIR)/info/ppp-pppoe-plugin.list
46 ifeq ($(BR2_PACKAGE_PPP_RADIUS),y)
47 INSTALL_TARGETS += $(IPKG_STATE_DIR)/info/ppp-radius-plugin.list
49 ifeq ($(BR2_PACKAGE_PPPDUMP),y)
50 INSTALL_TARGETS += $(IPKG_STATE_DIR)/info/pppdump.list
52 ifeq ($(BR2_PACKAGE_PPPSTATS),y)
53 INSTALL_TARGETS += $(IPKG_STATE_DIR)/info/pppstats.list
56 $(DL_DIR)/$(PKG_SOURCE_FILE):
58 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE_FILE) $(PKG_MD5SUM) $(PKG_SOURCE_SITE)
60 $(PKG_BUILD_DIR)/.patched: $(DL_DIR)/$(PKG_SOURCE_FILE)
61 mkdir -p $(TOOL_BUILD_DIR)
62 $(PKG_SOURCE_CAT) $(DL_DIR)/$(PKG_SOURCE_FILE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
63 $(PATCH) $(PKG_BUILD_DIR) . $(PKG_NAME).patch
64 touch $(PKG_BUILD_DIR)/.patched
66 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.patched
67 (cd $(PKG_BUILD_DIR); \
69 $(TARGET_CONFIGURE_OPTS) \
70 CFLAGS="$(TARGET_CFLAGS)" \
72 --target=$(GNU_TARGET_NAME) \
73 --host=$(GNU_TARGET_NAME) \
74 --build=$(GNU_HOST_NAME) \
78 --datadir=/usr/share \
79 --infodir=/usr/share/info \
80 --libexecdir=/usr/lib \
81 --localstatedir=/var \
82 --mandir=/usr/share/man \
86 touch $(PKG_BUILD_DIR)/.configured
88 $(PKG_BUILD_DIR)/pppd/pppd $(PKG_BUILD_DIR)/pppd/plugins/radius/radius.so: $(PKG_BUILD_DIR)/.configured
89 $(MAKE) -C $(PKG_BUILD_DIR) \
91 COPTS="$(TARGET_CFLAGS)" \
94 $(PKG_PPP): $(PKG_BUILD_DIR)/pppd/pppd
96 cp -af ./ipkg/ppp/* $(I_PPP)
97 $(SCRIPT_DIR)/make-ipkg-dir.sh $(I_PPP) control/ppp.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
98 mkdir -p $(I_PPP)/etc/ppp
99 ln -sf /tmp/resolv.conf $(I_PPP)/etc/ppp/resolv.conf
100 mkdir -p $(I_PPP)/usr/sbin
101 cp -af $(PKG_BUILD_DIR)/pppd/pppd $(I_PPP)/usr/sbin/
102 $(STRIP) $(I_PPP)/usr/sbin/*
103 mkdir -p $(I_PPP)/usr/lib/pppd
104 cp $(PKG_BUILD_DIR)/pppd/plugins/*.so $(I_PPP)/usr/lib/pppd/
105 $(STRIP) $(I_PPP)/usr/lib/pppd/*.so
106 mkdir -p $(I_PPP)/$(MODULES_SUBDIR)
107 cp $(MODULES_DIR)/kernel/drivers/net/ppp_async.o $(I_PPP)/$(MODULES_SUBDIR)
108 cp $(MODULES_DIR)/kernel/drivers/net/ppp_deflate.o $(I_PPP)/$(MODULES_SUBDIR)
109 cp $(MODULES_DIR)/kernel/drivers/net/bsd_comp.o $(I_PPP)/$(MODULES_SUBDIR)
110 find $(I_PPP) -name CVS | xargs rm -rf
111 $(IPKG_BUILD) $(I_PPP) $(PACKAGE_DIR)
113 $(IPKG_STATE_DIR)/info/ppp.list: $(PKG_PPP)
114 $(IPKG) install $(PKG_PPP)
116 $(PKG_PPP_PPPOE_PLUGIN): $(PKG_PPP)
117 $(SCRIPT_DIR)/make-ipkg-dir.sh $(I_PPP_PPPOE_PLUGIN) control/ppp-pppoe-plugin.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
118 cp -af ./ipkg/ppp-pppoe-plugin/* $(I_PPP_PPPOE_PLUGIN)
119 mkdir -p $(I_PPP_PPPOE_PLUGIN)/usr/lib/pppd/rp-pppoe
120 cp -af $(PKG_BUILD_DIR)/pppd/plugins/rp-pppoe/rp-pppoe.so \
121 $(I_PPP_PPPOE_PLUGIN)/usr/lib/pppd/rp-pppoe
122 $(STRIP) $(I_PPP_PPPOE_PLUGIN)/usr/lib/pppd/*/*.so
123 mkdir -p $(I_PPP_PPPOE_PLUGIN)/$(MODULES_SUBDIR)
124 cp $(MODULES_DIR)/kernel/drivers/net/pppo*.o $(I_PPP_PPPOE_PLUGIN)/$(MODULES_SUBDIR)
125 find $(I_PPP_PPPOE_PLUGIN) -name CVS | xargs rm -rf
126 $(IPKG_BUILD) $(I_PPP_PPPOE_PLUGIN) $(PACKAGE_DIR)
128 $(IPKG_STATE_DIR)/info/ppp-pppoe-plugin.list: $(PKG_PPP_PPPOE_PLUGIN)
129 $(IPKG) install $(PKG_PPP_PPPOE_PLUGIN)
131 $(PKG_PPP_RADIUS_PLUGIN): $(PKG_PPP)
132 $(SCRIPT_DIR)/make-ipkg-dir.sh $(I_PPP_RADIUS_PLUGIN) control/ppp-radius-plugin.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
133 mkdir -p $(I_PPP_RADIUS_PLUGIN)/usr/lib/pppd/radius
134 cp -af $(PKG_BUILD_DIR)/pppd/plugins/radius/radius.so \
135 $(I_PPP_RADIUS_PLUGIN)/usr/lib/pppd/radius/
136 $(STRIP) $(I_PPP_RADIUS_PLUGIN)/usr/lib/pppd/*/*.so
137 find $(I_PPP_RADIUS_PLUGIN) -name CVS | xargs rm -rf
138 $(IPKG_BUILD) $(I_PPP_RADIUS_PLUGIN) $(PACKAGE_DIR)
140 $(IPKG_STATE_DIR)/info/ppp-radius-plugin.list: $(PKG_PPP_RADIUS_PLUGIN)
141 $(IPKG) install $(PKG_PPP_RADIUS_PLUGIN)
143 $(PKG_PPPDUMP): $(PKG_PPP)
144 $(SCRIPT_DIR)/make-ipkg-dir.sh $(I_PPPDUMP) control/pppdump.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
145 mkdir -p $(I_PPPDUMP)/usr/sbin
146 cp -af $(PKG_BUILD_DIR)/pppdump/pppdump $(I_PPPDUMP)/usr/sbin/
147 $(STRIP) $(I_PPPDUMP)/usr/sbin/*
148 find $(I_PPPDUMP) -name CVS | xargs rm -rf
149 $(IPKG_BUILD) $(I_PPPDUMP) $(PACKAGE_DIR)
151 $(IPKG_STATE_DIR)/info/pppdump.list: $(PKG_PPPDUMP)
152 $(IPKG) install $(PKG_PPPDUMP)
154 $(PKG_PPPSTATS): $(PKG_PPP)
155 $(SCRIPT_DIR)/make-ipkg-dir.sh $(I_PPPSTATS) control/pppstats.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
156 mkdir -p $(I_PPPSTATS)/usr/sbin
157 cp -af $(PKG_BUILD_DIR)/pppstats/pppstats $(I_PPPSTATS)/usr/sbin/
158 $(STRIP) $(I_PPPSTATS)/usr/sbin/*
159 find $(I_PPPSTATS) -name CVS | xargs rm -rf
160 $(IPKG_BUILD) $(I_PPPSTATS) $(PACKAGE_DIR)
162 $(IPKG_STATE_DIR)/info/pppstats.list: $(PKG_PPPSTATS)
163 $(IPKG) install $(PKG_PPPSTATS)
165 source: $(DL_DIR)/$(PKG_SOURCE_FILE)
166 prepare: $(PKG_BUILD_DIR)/.patched
168 install: $(INSTALL_TARGETS)
171 rm -rf $(PKG_BUILD_DIR)
172 rm -f $(PKG_PPP) $(PKG_PPP_PPPOE_PLUGIN) $(PKG_PPP_RADIUS_PLUGIN) $(PKG_PPPSTATS) $(PKG_PPPDUMP)