1 include $(TOPDIR
)/rules.mk
7 PKG_SOURCE_SITE
:= ftp
://ftp.samba.org
/pub
/ppp
/
8 PKG_SOURCE_FILE
:= $(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
10 PKG_SOURCE_DIR
:= $(PKG_NAME
)-$(PKG_VERSION
)
12 PKG_BUILD_DIR
:= $(BUILD_DIR
)/$(PKG_SOURCE_DIR
)
14 PKG_PPP
:= $(PACKAGE_DIR
)/ppp_
$(PKG_VERSION
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
15 PKG_PPP_PPPOE_PLUGIN
:= $(PACKAGE_DIR
)/ppp-pppoe-plugin_
$(PKG_VERSION
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
16 PKG_PPP_RADIUS_PLUGIN
:= $(PACKAGE_DIR
)/ppp-radius-plugin_
$(PKG_VERSION
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
17 PKG_PPPSTATS
:= $(PACKAGE_DIR
)/pppstats_
$(PKG_VERSION
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
18 PKG_PPPDUMP
:= $(PACKAGE_DIR
)/pppdump_
$(PKG_VERSION
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
20 I_PPP
:= $(PKG_BUILD_DIR
)/ipkg
/ppp
21 I_PPP_PPPOE_PLUGIN
:= $(PKG_BUILD_DIR
)/ipkg
/ppp-pppoe-plugin
22 I_PPP_RADIUS_PLUGIN
:= $(PKG_BUILD_DIR
)/ipkg
/ppp-radius-plugin
23 I_PPPDUMP
:= $(PKG_BUILD_DIR
)/ipkg
/pppdump
24 I_PPPSTATS
:= $(PKG_BUILD_DIR
)/ipkg
/pppstats
27 ifneq ($(BR2_PACKAGE_PPP_PPPOE
),)
28 TARGETS
+= $(PKG_PPP_PPPOE_PLUGIN
)
30 ifneq ($(BR2_PACKAGE_PPP_RADIUS
),)
31 TARGETS
+= $(PKG_PPP_RADIUS_PLUGIN
)
33 ifneq ($(BR2_PACKAGE_PPPDUMP
),)
34 TARGETS
+= $(PKG_PPPDUMP
)
36 ifneq ($(BR2_PACKAGE_PPPSTATS
),)
37 TARGETS
+= $(PKG_PPPSTATS
)
40 INSTALL_TARGETS
:= $(IPKG_STATE_DIR
)/info/ppp.list
41 ifeq ($(BR2_PACKAGE_PPP_PPPOE
),y
)
42 INSTALL_TARGETS
+= $(IPKG_STATE_DIR
)/info/ppp-pppoe-plugin.list
44 ifeq ($(BR2_PACKAGE_PPP_RADIUS
),y
)
45 INSTALL_TARGETS
+= $(IPKG_STATE_DIR
)/info/ppp-radius-plugin.list
47 ifeq ($(BR2_PACKAGE_PPPDUMP
),y
)
48 INSTALL_TARGETS
+= $(IPKG_STATE_DIR
)/info/pppdump.list
50 ifeq ($(BR2_PACKAGE_PPPSTATS
),y
)
51 INSTALL_TARGETS
+= $(IPKG_STATE_DIR
)/info/pppstats.list
54 $(DL_DIR
)/$(PKG_SOURCE_FILE
):
56 $(WGET
) -P
$(DL_DIR
) $(PKG_SOURCE_SITE
)/$(PKG_SOURCE_FILE
)
58 $(PKG_BUILD_DIR
)/.patched
: $(DL_DIR
)/$(PKG_SOURCE_FILE
)
59 mkdir
-p
$(TOOL_BUILD_DIR
)
60 $(PKG_SOURCE_CAT
) $(DL_DIR
)/$(PKG_SOURCE_FILE
) |
tar -C
$(BUILD_DIR
) $(TAR_OPTIONS
) -
61 $(PATCH
) $(PKG_BUILD_DIR
) .
$(PKG_NAME
).patch
62 touch
$(PKG_BUILD_DIR
)/.patched
64 $(PKG_BUILD_DIR
)/.configured
: $(PKG_BUILD_DIR
)/.patched
65 (cd
$(PKG_BUILD_DIR
); \
67 $(TARGET_CONFIGURE_OPTS
) \
68 CFLAGS
="$(TARGET_CFLAGS)" \
70 --target
=$(GNU_TARGET_NAME
) \
71 --host
=$(GNU_TARGET_NAME
) \
72 --build
=$(GNU_HOST_NAME
) \
76 --datadir=/usr
/share \
77 --infodir=/usr
/share
/info \
78 --libexecdir
=/usr
/lib \
79 --localstatedir
=/var \
80 --mandir=/usr
/share
/man \
84 touch
$(PKG_BUILD_DIR
)/.configured
86 $(PKG_BUILD_DIR
)/pppd
/pppd
$(PKG_BUILD_DIR
)/pppd
/plugins
/radius
/radius.so
: $(PKG_BUILD_DIR
)/.configured
87 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
89 COPTS
="$(TARGET_CFLAGS)" \
92 $(PKG_PPP
): $(PKG_BUILD_DIR
)/pppd
/pppd
94 cp
-af .
/ipkg
/ppp
/* $(I_PPP
)
95 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(I_PPP
) control
/ppp.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
96 mkdir
-p
$(I_PPP
)/usr
/sbin
97 cp
-af
$(PKG_BUILD_DIR
)/pppd
/pppd
$(I_PPP
)/usr
/sbin
/
98 $(STRIP
) $(I_PPP
)/usr
/sbin
/*
99 mkdir
-p
$(I_PPP
)/usr
/lib
/pppd
100 cp
$(PKG_BUILD_DIR
)/pppd
/plugins
/*.so
$(I_PPP
)/usr
/lib
/pppd
/
101 $(STRIP
) $(I_PPP
)/usr
/lib
/pppd
/*.so
102 mkdir
-p
$(I_PPP
)/$(MODULES_SUBDIR
)
103 cp
$(MODULES_DIR
)/kernel
/drivers
/net
/ppp_async.o
$(I_PPP
)/$(MODULES_SUBDIR
)
104 cp
$(MODULES_DIR
)/kernel
/drivers
/net
/ppp_deflate.o
$(I_PPP
)/$(MODULES_SUBDIR
)
105 cp
$(MODULES_DIR
)/kernel
/drivers
/net
/bsd_comp.o
$(I_PPP
)/$(MODULES_SUBDIR
)
106 $(IPKG_BUILD
) $(I_PPP
) $(PACKAGE_DIR
)
108 $(IPKG_STATE_DIR
)/info/ppp.list
: $(PKG_PPP
)
109 $(IPKG
) install $(PKG_PPP
)
111 $(PKG_PPP_PPPOE_PLUGIN
): $(PKG_PPP
)
112 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(I_PPP_PPPOE_PLUGIN
) control
/ppp-pppoe-plugin.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
113 mkdir
-p
$(I_PPP_PPPOE_PLUGIN
)/usr
/lib
/pppd
/rp-pppoe
114 cp
-af
$(PKG_BUILD_DIR
)/pppd
/plugins
/rp-pppoe
/rp-pppoe.so \
115 $(I_PPP_PPPOE_PLUGIN
)/usr
/lib
/pppd
/rp-pppoe
116 $(STRIP
) $(I_PPP_PPPOE_PLUGIN
)/usr
/lib
/pppd
/*/*.so
117 mkdir
-p
$(I_PPP_PPPOE_PLUGIN
)/$(MODULES_SUBDIR
)
118 cp
$(MODULES_DIR
)/kernel
/drivers
/net
/pppo
*.o
$(I_PPP_PPPOE_PLUGIN
)/$(MODULES_SUBDIR
)
119 $(IPKG_BUILD
) $(I_PPP_PPPOE_PLUGIN
) $(PACKAGE_DIR
)
121 $(IPKG_STATE_DIR
)/info/ppp-pppoe-plugin.list
: $(PKG_PPP_PPPOE_PLUGIN
)
122 $(IPKG
) install $(PKG_PPP_PPPOE_PLUGIN
)
124 $(PKG_PPP_RADIUS_PLUGIN
): $(PKG_PPP
)
125 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(I_PPP_RADIUS_PLUGIN
) control
/ppp-radius-plugin.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
126 mkdir
-p
$(I_PPP_RADIUS_PLUGIN
)/usr
/lib
/pppd
/radius
127 cp
-af
$(PKG_BUILD_DIR
)/pppd
/plugins
/radius
/radius.so \
128 $(I_PPP_RADIUS_PLUGIN
)/usr
/lib
/pppd
/radius
/
129 $(STRIP
) $(I_PPP_RADIUS_PLUGIN
)/usr
/lib
/pppd
/*/*.so
130 $(IPKG_BUILD
) $(I_PPP_RADIUS_PLUGIN
) $(PACKAGE_DIR
)
132 $(IPKG_STATE_DIR
)/info/ppp-radius-plugin.list
: $(PKG_PPP_RADIUS_PLUGIN
)
133 $(IPKG
) install $(PKG_PPP_RADIUS_PLUGIN
)
135 $(PKG_PPPDUMP
): $(PKG_PPP
)
136 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(I_PPPDUMP
) control
/pppdump.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
137 mkdir
-p
$(I_PPPDUMP
)/usr
/sbin
138 cp
-af
$(PKG_BUILD_DIR
)/pppdump
/pppdump
$(I_PPPDUMP
)/usr
/sbin
/
139 $(STRIP
) $(I_PPPDUMP
)/usr
/sbin
/*
140 $(IPKG_BUILD
) $(I_PPPDUMP
) $(PACKAGE_DIR
)
142 $(IPKG_STATE_DIR
)/info/pppdump.list
: $(PKG_PPPDUMP
)
143 $(IPKG
) install $(PKG_PPPDUMP
)
145 $(PKG_PPPSTATS
): $(PKG_PPP
)
146 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(I_PPPSTATS
) control
/pppstats.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
147 mkdir
-p
$(I_PPPSTATS
)/usr
/sbin
148 cp
-af
$(PKG_BUILD_DIR
)/pppstats
/pppstats
$(I_PPPSTATS
)/usr
/sbin
/
149 $(STRIP
) $(I_PPPSTATS
)/usr
/sbin
/*
150 $(IPKG_BUILD
) $(I_PPPSTATS
) $(PACKAGE_DIR
)
152 $(IPKG_STATE_DIR
)/info/pppstats.list
: $(PKG_PPPSTATS
)
153 $(IPKG
) install $(PKG_PPPSTATS
)
155 source
: $(DL_DIR
)/$(PKG_SOURCE_FILE
)
156 prepare
: $(PKG_BUILD_DIR
)/.patched
158 install: $(INSTALL_TARGETS
)
161 rm -rf
$(PKG_BUILD_DIR
)
162 rm -f
$(PKG_PPP
) $(PKG_PPP_PPPOE_PLUGIN
) $(PKG_PPP_RADIUS_PLUGIN
) $(PKG_PPPSTATS
) $(PKG_PPPDUMP
)