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