[backfire] merge r25044
[openwrt-10.03/.git] / package / ppp / Makefile
1 #
2 # Copyright (C) 2006-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=ppp
12 PKG_VERSION:=2.4.4
13 PKG_RELEASE:=16
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=ftp://ftp.samba.org/pub/ppp/
17 PKG_MD5SUM:=183800762e266132218b204dfb428d29
18
19 PKG_BUILD_DEPENDS:=libpcap
20
21 PKG_INSTALL:=1
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/ppp/Default
26   SECTION:=net
27   CATEGORY:=Network
28   URL:=http://ppp.samba.org/
29 endef
30
31 define Package/ppp
32 $(call Package/ppp/Default)
33   DEPENDS:=+kmod-ppp
34   TITLE:=PPP daemon
35   MENU:=1
36 endef
37
38 define Package/ppp/description
39 This package contains the PPP (Point-to-Point Protocol) daemon.
40 endef
41
42 define Package/ppp/conffiles
43 /etc/ppp/chap-secrets
44 /etc/ppp/filter
45 /etc/ppp/ip-down
46 /etc/ppp/ip-up
47 /etc/ppp/ipv6-down
48 /etc/ppp/ipv6-up
49 /etc/ppp/options
50 endef
51
52 define Package/ppp-mod-pppoa
53 $(call Package/ppp/Default)
54   DEPENDS:=ppp +linux-atm +kmod-pppoa
55   TITLE:=PPPoA plugin
56 endef
57
58 define Package/ppp-mod-pppoa/description
59 This package contains a PPPoA (PPP over ATM) plugin for ppp.
60 endef
61
62 define Package/ppp-mod-pppoe
63 $(call Package/ppp/Default)
64   DEPENDS:=ppp +kmod-pppoe
65   TITLE:=PPPoE plugin
66 endef
67
68 define Package/ppp-mod-pppoe/description
69 This package contains a PPPoE (PPP over Ethernet) plugin for ppp.
70 endef
71
72 define Package/ppp-mod-radius
73 $(call Package/ppp/Default)
74   DEPENDS:=ppp
75   TITLE:=RADIUS plugin
76 endef
77
78 define Package/ppp-mod-radius/description
79 This package contains a RADIUS (Remote Authentication Dial-In User Service)
80 plugin for ppp.
81 endef
82
83 define Package/ppp-mod-radius/conffiles
84 /etc/ppp/radius.conf
85 /etc/ppp/radius/
86 endef
87
88 define Package/chat
89 $(call Package/ppp/Default)
90   DEPENDS:=ppp
91   TITLE:=Establish conversation with a modem
92 endef
93
94 define Package/chat/description
95 This package contains an utility to establish conversation with other PPP servers
96 (via a modem).
97 endef
98
99 define Package/pppdump
100 $(call Package/ppp/Default)
101   DEPENDS:=ppp
102   TITLE:=Read PPP record file
103 endef
104
105 define Package/pppdump/description
106 This package contains an utility to read PPP record file.
107 endef
108
109 define Package/pppstats
110 $(call Package/ppp/Default)
111   DEPENDS:=ppp
112   TITLE:=Report PPP statistics
113 endef
114
115 define Package/pppstats/description
116 This package contains an utility to report PPP statistics.
117 endef
118
119
120 define Build/Configure
121 $(call Build/Configure/Default,, \
122         UNAME_S="Linux" \
123         UNAME_R="$(LINUX_VERSION)" \
124         UNAME_M="$(ARCH)" \
125 )
126         mkdir -p $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux
127         cp \
128                 $(LINUX_DIR)/include/linux/compiler.h \
129                 $(LINUX_DIR)/include/linux/atm*.h \
130                 $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux/
131 endef
132
133 MAKE_FLAGS += COPTS="$(TARGET_CFLAGS)" \
134                 PRECOMPILED_FILTER=1 \
135                 STAGING_DIR="$(STAGING_DIR)"
136
137 define Build/InstallDev
138         $(INSTALL_DIR) $(1)/usr/include
139         $(CP) $(PKG_INSTALL_DIR)/include/pppd $(1)/usr/include/
140 endef
141
142 define Package/ppp/install
143         $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
144         $(INSTALL_DIR) $(1)/usr/sbin
145         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppd $(1)/usr/sbin/
146         $(INSTALL_DIR) $(1)/lib/network
147         $(INSTALL_BIN) ./files/ppp.sh $(1)/lib/network/
148         $(INSTALL_DIR) $(1)/etc/ppp
149         $(INSTALL_CONF) ./files/etc/ppp/chap-secrets $(1)/etc/ppp/
150         $(INSTALL_DATA) ./files/etc/ppp/filter $(1)/etc/ppp/
151         $(INSTALL_BIN) ./files/etc/ppp/ip-up $(1)/etc/ppp/
152         $(INSTALL_DIR) $(1)/etc/ppp/ip-up.d
153         $(INSTALL_BIN) ./files/etc/ppp/ip-down $(1)/etc/ppp/
154         $(INSTALL_DIR) $(1)/etc/ppp/ip-down.d
155         $(INSTALL_BIN) ./files/etc/ppp/ipv6-up $(1)/etc/ppp/
156         $(INSTALL_BIN) ./files/etc/ppp/ipv6-down $(1)/etc/ppp/
157         $(INSTALL_DATA) ./files/etc/ppp/options $(1)/etc/ppp/
158         ln -sf /tmp/resolv.conf.ppp $(1)/etc/ppp/resolv.conf
159 endef
160
161 define Package/ppp-mod-pppoa/install
162         $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
163         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/pppoatm.so \
164                 $(1)/usr/lib/pppd/$(PKG_VERSION)/
165         $(INSTALL_DIR) $(1)/lib/network
166         $(INSTALL_BIN) ./files/pppoa.sh $(1)/lib/network/
167         $(INSTALL_DIR) $(1)/etc/hotplug.d/atm
168         $(INSTALL_DATA) ./files/etc/hotplug.d/atm/20-atm-modem $(1)/etc/hotplug.d/atm/
169 endef
170
171 define Package/ppp-mod-pppoe/install
172         $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
173         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/rp-pppoe.so \
174                 $(1)/usr/lib/pppd/$(PKG_VERSION)/
175         $(INSTALL_DIR) $(1)/lib/network
176         $(INSTALL_BIN) ./files/pppoe.sh $(1)/lib/network/
177 endef
178
179 define Package/ppp-mod-radius/install
180         $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
181         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/radius.so \
182                 $(1)/usr/lib/pppd/$(PKG_VERSION)/
183         $(INSTALL_DIR) $(1)/etc/ppp
184         $(INSTALL_DATA) ./files/etc/ppp/radius.conf $(1)/etc/ppp/
185         $(INSTALL_DIR) $(1)/etc/ppp/radius
186         $(INSTALL_DATA) ./files/etc/ppp/radius/dictionary* \
187                 $(1)/etc/ppp/radius/
188         $(INSTALL_CONF) ./files/etc/ppp/radius/servers \
189                 $(1)/etc/ppp/radius/
190 endef
191
192 define Package/chat/install
193         $(INSTALL_DIR) $(1)/usr/sbin
194         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/chat $(1)/usr/sbin/
195 endef
196
197 define Package/pppdump/install
198         $(INSTALL_DIR) $(1)/usr/sbin
199         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppdump $(1)/usr/sbin/
200 endef
201
202 define Package/pppstats/install
203         $(INSTALL_DIR) $(1)/usr/sbin
204         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppstats $(1)/usr/sbin/
205 endef
206
207 $(eval $(call BuildPackage,ppp))
208 $(eval $(call BuildPackage,ppp-mod-pppoa))
209 $(eval $(call BuildPackage,ppp-mod-pppoe))
210 $(eval $(call BuildPackage,ppp-mod-radius))
211 $(eval $(call BuildPackage,chat))
212 $(eval $(call BuildPackage,pppdump))
213 $(eval $(call BuildPackage,pppstats))