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 $(DL_DIR
)/$(PKG_SOURCE_FILE
):
42 $(WGET
) -P
$(DL_DIR
) $(PKG_SOURCE_SITE
)/$(PKG_SOURCE_FILE
)
44 $(PKG_BUILD_DIR
)/.patched
: $(DL_DIR
)/$(PKG_SOURCE_FILE
)
45 mkdir
-p
$(TOOL_BUILD_DIR
)
46 $(PKG_SOURCE_CAT
) $(DL_DIR
)/$(PKG_SOURCE_FILE
) |
tar -C
$(BUILD_DIR
) $(TAR_OPTIONS
) -
47 $(PATCH
) $(PKG_BUILD_DIR
) .
$(PKG_NAME
).patch
48 touch
$(PKG_BUILD_DIR
)/.patched
50 $(PKG_BUILD_DIR
)/.configured
: $(PKG_BUILD_DIR
)/.patched
51 (cd
$(PKG_BUILD_DIR
); \
53 $(TARGET_CONFIGURE_OPTS
) \
54 CFLAGS
="$(TARGET_CFLAGS)" \
56 --target
=$(GNU_TARGET_NAME
) \
57 --host
=$(GNU_TARGET_NAME
) \
58 --build
=$(GNU_HOST_NAME
) \
62 --datadir=/usr
/share \
63 --infodir=/usr
/share
/info \
64 --libexecdir
=/usr
/lib \
65 --localstatedir
=/var \
66 --mandir=/usr
/share
/man \
70 touch
$(PKG_BUILD_DIR
)/.configured
72 $(PKG_BUILD_DIR
)/pppd
/pppd
$(PKG_BUILD_DIR
)/pppd
/plugins
/radius
/radius.so
: $(PKG_BUILD_DIR
)/.configured
73 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
75 COPTS
="$(TARGET_CFLAGS)" \
78 $(PKG_PPP
): $(PKG_BUILD_DIR
)/pppd
/pppd
80 cp
-af .
/ipkg
/ppp
/* $(I_PPP
)
81 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(I_PPP
) control
/ppp.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
82 mkdir
-p
$(I_PPP
)/usr
/sbin
83 cp
-af
$(PKG_BUILD_DIR
)/pppd
/pppd
$(I_PPP
)/usr
/sbin
/
84 $(STRIP
) $(I_PPP
)/usr
/sbin
/*
85 mkdir
-p
$(I_PPP
)/usr
/lib
/pppd
86 cp
$(PKG_BUILD_DIR
)/pppd
/plugins
/*.so
$(I_PPP
)/usr
/lib
/pppd
/
87 $(STRIP
) $(I_PPP
)/usr
/lib
/pppd
/*.so
88 mkdir
-p
$(I_PPP
)/$(MODULES_SUBDIR
)
89 cp
$(MODULES_DIR
)/kernel
/drivers
/net
/ppp_async.o
$(I_PPP
)/$(MODULES_SUBDIR
)
90 cp
$(MODULES_DIR
)/kernel
/drivers
/net
/ppp_deflate.o
$(I_PPP
)/$(MODULES_SUBDIR
)
91 cp
$(MODULES_DIR
)/kernel
/drivers
/net
/bsd_comp.o
$(I_PPP
)/$(MODULES_SUBDIR
)
92 $(IPKG_BUILD
) $(I_PPP
) $(PACKAGE_DIR
)
94 $(PKG_PPP_PPPOE_PLUGIN
): $(PKG_PPP
)
95 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(I_PPP_PPPOE_PLUGIN
) control
/ppp-pppoe-plugin.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
96 mkdir
-p
$(I_PPP_PPPOE_PLUGIN
)/usr
/lib
/pppd
/rp-pppoe
97 cp
-af
$(PKG_BUILD_DIR
)/pppd
/plugins
/rp-pppoe
/rp-pppoe.so \
98 $(I_PPP_PPPOE_PLUGIN
)/usr
/lib
/pppd
/rp-pppoe
99 $(STRIP
) $(I_PPP_PPPOE_PLUGIN
)/usr
/lib
/pppd
/*/*.so
100 mkdir
-p
$(I_PPP_PPPOE_PLUGIN
)/$(MODULES_SUBDIR
)
101 cp
$(MODULES_DIR
)/kernel
/drivers
/net
/pppo
*.o
$(I_PPP_PPPOE_PLUGIN
)/$(MODULES_SUBDIR
)
102 $(IPKG_BUILD
) $(I_PPP_PPPOE_PLUGIN
) $(PACKAGE_DIR
)
104 $(PKG_PPP_RADIUS_PLUGIN
): $(PKG_PPP
)
105 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(I_PPP_RADIUS_PLUGIN
) control
/ppp-radius-plugin.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
106 mkdir
-p
$(I_PPP_RADIUS_PLUGIN
)/usr
/lib
/pppd
/radius
107 cp
-af
$(PKG_BUILD_DIR
)/pppd
/plugins
/radius
/radius.so \
108 $(I_PPP_RADIUS_PLUGIN
)/usr
/lib
/pppd
/radius
/
109 $(STRIP
) $(I_PPP_RADIUS_PLUGIN
)/usr
/lib
/pppd
/*/*.so
110 $(IPKG_BUILD
) $(I_PPP_RADIUS_PLUGIN
) $(PACKAGE_DIR
)
112 $(PKG_PPPDUMP
): $(PKG_PPP
)
113 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(I_PPPDUMP
) control
/pppdump.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
114 mkdir
-p
$(I_PPPDUMP
)/usr
/sbin
115 cp
-af
$(PKG_BUILD_DIR
)/pppdump
/pppdump
$(I_PPPDUMP
)/usr
/sbin
/
116 $(STRIP
) $(I_PPPDUMP
)/usr
/sbin
/*
117 $(IPKG_BUILD
) $(I_PPPDUMP
) $(PACKAGE_DIR
)
119 $(PKG_PPPSTATS
): $(PKG_PPP
)
120 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(I_PPPSTATS
) control
/pppstats.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
121 mkdir
-p
$(I_PPPSTATS
)/usr
/sbin
122 cp
-af
$(PKG_BUILD_DIR
)/pppstats
/pppstats
$(I_PPPSTATS
)/usr
/sbin
/
123 $(STRIP
) $(I_PPPSTATS
)/usr
/sbin
/*
124 $(IPKG_BUILD
) $(I_PPPSTATS
) $(PACKAGE_DIR
)
127 source
: $(DL_DIR
)/$(PKG_SOURCE_FILE
)
128 prepare
: $(PKG_BUILD_DIR
)/.patched
131 $(IPKG
) install $(PKG_PPP
)
132 ifeq ($(BR2_PACKAGE_PPP_PPPOE
),y
)
133 $(IPKG
) install $(PKG_PPP_PPPOE_PLUGIN
)
135 ifeq ($(BR2_PACKAGE_PPP_RADIUS
),y
)
136 $(IPKG
) install $(PKG_PPP_RADIUS_PLUGIN
)
138 ifeq ($(BR2_PACKAGE_PPPDUMP
),y
)
139 $(IPKG
) install $(PKG_PPPDUMP
)
141 ifeq ($(BR2_PACKAGE_PPPSTATS
),y
)
142 $(IPKG
) install $(PKG_PPPSTATS
)
146 rm -rf
$(PKG_BUILD_DIR
)
147 rm -f
$(PKG_PPP
) $(PKG_PPP_PPPOE_PLUGIN
) $(PKG_PPP_RADIUS_PLUGIN
) $(PKG_PPPSTATS
) $(PKG_PPPDUMP
)