27b1f42825ad389323a85a0ec2daf60502809f9b
[openwrt/openwrt.git] / package / ppp / Makefile
1 #
2 # Copyright (C) 2006-2011 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.5
13 PKG_RELEASE:=5
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=ftp://ftp.samba.org/pub/ppp/
17 PKG_MD5SUM:=4621bc56167b6953ec4071043fe0ec57
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
20
21 PKG_BUILD_DEPENDS:=libpcap
22
23 PKG_INSTALL:=1
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/ppp/Default
28 SECTION:=net
29 CATEGORY:=Network
30 MAINTAINER:=Jo-Philipp Wich <xm@subsignal.org>
31 URL:=http://ppp.samba.org/
32 endef
33
34 define Package/ppp
35 $(call Package/ppp/Default)
36 DEPENDS:=+kmod-ppp
37 TITLE:=PPP daemon
38 VARIANT:=default
39 endef
40
41 define Package/ppp-multilink
42 $(call Package/ppp/Default)
43 DEPENDS:=+kmod-ppp
44 TITLE:=PPP daemon (with multilink support)
45 VARIANT:=multilink
46 endef
47
48 define Package/ppp/description
49 This package contains the PPP (Point-to-Point Protocol) daemon.
50 endef
51
52 define Package/ppp/conffiles
53 /etc/ppp/chap-secrets
54 /etc/ppp/filter
55 /etc/ppp/ip-down
56 /etc/ppp/ip-up
57 /etc/ppp/ipv6-down
58 /etc/ppp/ipv6-up
59 /etc/ppp/options
60 endef
61
62 define Package/ppp-mod-pppoa
63 $(call Package/ppp/Default)
64 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink) +linux-atm +kmod-pppoa
65 TITLE:=PPPoA plugin
66 endef
67
68 define Package/ppp-mod-pppoa/description
69 This package contains a PPPoA (PPP over ATM) plugin for ppp.
70 endef
71
72 define Package/ppp-mod-pppoe
73 $(call Package/ppp/Default)
74 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink) +kmod-pppoe
75 TITLE:=PPPoE plugin
76 endef
77
78 define Package/ppp-mod-pppoe/description
79 This package contains a PPPoE (PPP over Ethernet) plugin for ppp.
80 endef
81
82 define Package/ppp-mod-radius
83 $(call Package/ppp/Default)
84 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
85 TITLE:=RADIUS plugin
86 endef
87
88 define Package/ppp-mod-radius/description
89 This package contains a RADIUS (Remote Authentication Dial-In User Service)
90 plugin for ppp.
91 endef
92
93 define Package/ppp-mod-radius/conffiles
94 /etc/ppp/radius.conf
95 /etc/ppp/radius/
96 endef
97
98 define Package/ppp-mod-pppol2tp
99 $(call Package/ppp/Default)
100 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink) +kmod-pppol2tp
101 TITLE:=PPPoL2TP plugin
102 endef
103
104 define Package/ppp-mod-pppol2tp/description
105 This package contains a PPPoL2TP (PPP over L2TP) plugin for ppp.
106 endef
107
108 define Package/chat
109 $(call Package/ppp/Default)
110 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
111 TITLE:=Establish conversation with a modem
112 endef
113
114 define Package/chat/description
115 This package contains an utility to establish conversation with other PPP servers
116 (via a modem).
117 endef
118
119 define Package/pppdump
120 $(call Package/ppp/Default)
121 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
122 TITLE:=Read PPP record file
123 endef
124
125 define Package/pppdump/description
126 This package contains an utility to read PPP record file.
127 endef
128
129 define Package/pppstats
130 $(call Package/ppp/Default)
131 DEPENDS:=@(PACKAGE_ppp||PACKAGE_ppp-multilink)
132 TITLE:=Report PPP statistics
133 endef
134
135 define Package/pppstats/description
136 This package contains an utility to report PPP statistics.
137 endef
138
139
140 define Build/Configure
141 $(call Build/Configure/Default,, \
142 UNAME_S="Linux" \
143 UNAME_R="$(LINUX_VERSION)" \
144 UNAME_M="$(ARCH)" \
145 )
146 mkdir -p $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux
147 cp \
148 $(LINUX_DIR)/include/linux/compiler.h \
149 $(LINUX_DIR)/include/linux/atm*.h \
150 $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux/
151 endef
152
153 MAKE_FLAGS += COPTS="$(TARGET_CFLAGS)" \
154 PRECOMPILED_FILTER=1 \
155 STAGING_DIR="$(STAGING_DIR)"
156
157 ifeq ($(BUILD_VARIANT),multilink)
158 MAKE_FLAGS += HAVE_MULTILINK=y
159 else
160 MAKE_FLAGS += HAVE_MULTILINK=
161 endif
162
163
164 define Build/InstallDev
165 $(INSTALL_DIR) $(1)/usr/include
166 $(CP) $(PKG_INSTALL_DIR)/include/pppd $(1)/usr/include/
167 endef
168
169 define Package/ppp/script_install
170 endef
171
172 define Package/ppp/install
173 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
174 $(INSTALL_DIR) $(1)/usr/sbin
175 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppd $(1)/usr/sbin/
176 $(INSTALL_DIR) $(1)/etc/ppp
177 $(INSTALL_CONF) ./files/etc/ppp/chap-secrets $(1)/etc/ppp/
178 $(INSTALL_DATA) ./files/etc/ppp/filter $(1)/etc/ppp/
179 $(INSTALL_DATA) ./files/etc/ppp/options $(1)/etc/ppp/
180 ln -sf /tmp/resolv.conf.ppp $(1)/etc/ppp/resolv.conf
181 $(INSTALL_DIR) $(1)/lib/netifd/proto
182 $(INSTALL_BIN) ./files/ppp.sh $(1)/lib/netifd/proto/
183 $(INSTALL_BIN) ./files/lib/netifd/ppp-up $(1)/lib/netifd/
184 $(INSTALL_BIN) ./files/lib/netifd/ppp-down $(1)/lib/netifd/
185 endef
186 Package/ppp-multilink/install=$(Package/ppp/install)
187
188 define Package/ppp-mod-pppoa/install
189 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
190 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/pppoatm.so \
191 $(1)/usr/lib/pppd/$(PKG_VERSION)/
192 endef
193
194 define Package/ppp-mod-pppoe/install
195 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
196 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/rp-pppoe.so \
197 $(1)/usr/lib/pppd/$(PKG_VERSION)/
198 endef
199
200 define Package/ppp-mod-radius/install
201 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
202 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/radius.so \
203 $(1)/usr/lib/pppd/$(PKG_VERSION)/
204 $(INSTALL_DIR) $(1)/etc/ppp
205 $(INSTALL_DATA) ./files/etc/ppp/radius.conf $(1)/etc/ppp/
206 $(INSTALL_DIR) $(1)/etc/ppp/radius
207 $(INSTALL_DATA) ./files/etc/ppp/radius/dictionary* \
208 $(1)/etc/ppp/radius/
209 $(INSTALL_CONF) ./files/etc/ppp/radius/servers \
210 $(1)/etc/ppp/radius/
211 endef
212
213 define Package/ppp-mod-pppol2tp/install
214 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
215 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/pppol2tp.so \
216 $(1)/usr/lib/pppd/$(PKG_VERSION)/
217 endef
218
219 define Package/chat/install
220 $(INSTALL_DIR) $(1)/usr/sbin
221 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/chat $(1)/usr/sbin/
222 endef
223
224 define Package/pppdump/install
225 $(INSTALL_DIR) $(1)/usr/sbin
226 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppdump $(1)/usr/sbin/
227 endef
228
229 define Package/pppstats/install
230 $(INSTALL_DIR) $(1)/usr/sbin
231 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/pppstats $(1)/usr/sbin/
232 endef
233
234 $(eval $(call BuildPackage,ppp))
235 $(eval $(call BuildPackage,ppp-multilink))
236 $(eval $(call BuildPackage,ppp-mod-pppoa))
237 $(eval $(call BuildPackage,ppp-mod-pppoe))
238 $(eval $(call BuildPackage,ppp-mod-radius))
239 $(eval $(call BuildPackage,ppp-mod-pppol2tp))
240 $(eval $(call BuildPackage,chat))
241 $(eval $(call BuildPackage,pppdump))
242 $(eval $(call BuildPackage,pppstats))