4293f1d2798b95f6247246ed36295ca5817f3c54
[openwrt/staging/mkresin.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_DEPENDS:=libpcap linux-atm
21
22 include $(INCLUDE_DIR)/package.mk
23 include $(INCLUDE_DIR)/kernel.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 DESCRIPTION:=\
36 This package contains the PPP (Point-to-Point Protocol) daemon.
37 MENU:=1
38 endef
39
40 define Package/ppp-mod-pppoa
41 $(call Package/ppp/Default)
42 DEPENDS:=ppp +linux-atm +kmod-pppoa
43 TITLE:=PPPoA plugin
44 DESCRIPTION:=\
45 This package contains a PPPoA (PPP over ATM) plugin for ppp.
46 endef
47
48 define Package/ppp-mod-pppoe
49 $(call Package/ppp/Default)
50 DEPENDS:=ppp +kmod-pppoe
51 TITLE:=PPPoE plugin
52 DESCRIPTION:=\
53 This package contains a PPPoE (PPP over Ethernet) plugin for ppp.
54 endef
55
56 define Package/ppp-mod-radius
57 $(call Package/ppp/Default)
58 DEPENDS:=ppp
59 TITLE:=RADIUS plugin
60 DESCRIPTION:=\
61 This package contains a RADIUS (Remote Authentication Dial-In User \\\
62 Service) plugin for ppp.
63 endef
64
65 define Package/chat
66 $(call Package/ppp/Default)
67 DEPENDS:=ppp
68 TITLE:=Establish conversation with a modem
69 DESCRIPTION:=\
70 This package contains an utility to establish conversation with other \\\
71 PPP servers (via a modem).
72 endef
73
74 define Package/pppdump
75 $(call Package/ppp/Default)
76 DEPENDS:=ppp
77 TITLE:=Read PPP record file
78 DESCRIPTION:=\
79 This package contains an utility to read PPP record file.
80 endef
81
82 define Package/pppstats
83 $(call Package/ppp/Default)
84 DEPENDS:=ppp
85 TITLE:=Report PPP statistics
86 DESCRIPTION:=\
87 This package contains an utility to report PPP statistics.
88 endef
89
90 define Build/Configure
91 $(call Build/Configure/Default,, \
92 UNAME_S="Linux" \
93 UNAME_R="$(LINUX_VERSION)" \
94 UNAME_M="$(ARCH)" \
95 )
96 endef
97
98 define Build/Compile
99 rm -rf $(PKG_INSTALL_DIR)
100 mkdir -p $(PKG_INSTALL_DIR)/usr
101 $(MAKE) -C $(PKG_BUILD_DIR) \
102 $(TARGET_CONFIGURE_OPTS) \
103 COPTS="$(TARGET_CFLAGS)" \
104 PRECOMPILED_FILTER=1 \
105 STAGING_DIR="$(STAGING_DIR)" \
106 DESTDIR="$(PKG_INSTALL_DIR)/usr" \
107 all install
108 endef
109
110 define Package/ppp/install
111 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
112 $(INSTALL_DIR) $(1)/usr/sbin
113 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/pppd $(1)/usr/sbin/
114 $(INSTALL_DIR) $(1)/lib/network
115 $(INSTALL_BIN) ./files/ppp.sh $(1)/lib/network/
116 $(INSTALL_DIR) $(1)/etc/ppp
117 $(INSTALL_CONF) ./files/etc/ppp/chap-secrets $(1)/etc/ppp/
118 $(INSTALL_DATA) ./files/etc/ppp/filter $(1)/etc/ppp/
119 $(INSTALL_BIN) ./files/etc/ppp/ip-up $(1)/etc/ppp/
120 $(INSTALL_DIR) $(1)/etc/ppp/ip-up.d
121 $(INSTALL_BIN) ./files/etc/ppp/ip-down $(1)/etc/ppp/
122 $(INSTALL_DIR) $(1)/etc/ppp/ip-down.d
123 $(INSTALL_DATA) ./files/etc/ppp/options $(1)/etc/ppp/
124 ln -sf /tmp/resolv.conf.auto $(1)/etc/ppp/resolv.conf
125 endef
126
127 define Package/ppp-mod-pppoa/install
128 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
129 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/pppd/$(PKG_VERSION)/pppoatm.so \
130 $(1)/usr/lib/pppd/$(PKG_VERSION)/
131 $(INSTALL_DIR) $(1)/lib/network
132 $(INSTALL_BIN) ./files/pppoa.sh $(1)/lib/network/
133 endef
134
135 define Package/ppp-mod-pppoe/install
136 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
137 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/pppd/$(PKG_VERSION)/rp-pppoe.so \
138 $(1)/usr/lib/pppd/$(PKG_VERSION)/
139 $(INSTALL_DIR) $(1)/lib/network
140 $(INSTALL_BIN) ./files/pppoe.sh $(1)/lib/network/
141 endef
142
143 define Package/ppp-mod-radius/install
144 $(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
145 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/pppd/$(PKG_VERSION)/radius.so \
146 $(1)/usr/lib/pppd/$(PKG_VERSION)/
147 $(INSTALL_DIR) $(1)/etc/ppp
148 $(INSTALL_DATA) ./files/etc/ppp/radius.conf $(1)/etc/ppp/
149 $(INSTALL_DIR) $(1)/etc/ppp/radius
150 $(INSTALL_DATA) ./files/etc/ppp/radius/dictionary* \
151 $(1)/etc/ppp/radius/
152 $(INSTALL_CONF) ./files/etc/ppp/radius/servers \
153 $(1)/etc/ppp/radius/
154 endef
155
156 define Package/chat/install
157 $(INSTALL_DIR) $(1)/usr/sbin
158 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/chat $(1)/usr/sbin/
159 endef
160
161 define Package/pppdump/install
162 $(INSTALL_DIR) $(1)/usr/sbin
163 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/pppdump $(1)/usr/sbin/
164 endef
165
166 define Package/pppstats/install
167 $(INSTALL_DIR) $(1)/usr/sbin
168 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/pppstats $(1)/usr/sbin/
169 endef
170
171 $(eval $(call BuildPackage,ppp))
172 $(eval $(call BuildPackage,ppp-mod-pppoa))
173 $(eval $(call BuildPackage,ppp-mod-pppoe))
174 $(eval $(call BuildPackage,ppp-mod-radius))
175 $(eval $(call BuildPackage,chat))
176 $(eval $(call BuildPackage,pppdump))
177 $(eval $(call BuildPackage,pppstats))