port ppp modules to package/kernel and fix ppp package dependencies
[openwrt/openwrt.git] / openwrt / 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 PKG_BUILDDEP:=libpcap linux-atm
15
16 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
18 PKG_SOURCE_URL:=ftp://ftp.samba.org/pub/ppp/
19 PKG_MD5SUM:=848f6c3cafeb6074ffeb293c3af79b7c
20 PKG_CAT:=zcat
21
22 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/ppp
27 SECTION:=net
28 CATEGORY:=Network
29 MENU:=1
30 DEFAULT:=y
31 DEPENDS:=+kmod-ppp
32 TITLE:=PPP daemon
33 DESCRIPTION:=PPP (Point-to-Point Protocol) daemon
34 URL:=http://ppp.samba.org/
35 endef
36
37 define Package/ppp-mod-pppoa
38 SECTION:=net
39 CATEGORY:=Network
40 DEPENDS:=ppp +linux-atm +kmod-pppoa
41 TITLE:=PPPoA plugin
42 DESCRIPTION:=PPPoA (PPP over ATM) plugin for ppp
43 endef
44
45 define Package/ppp-mod-pppoe
46 SECTION:=net
47 CATEGORY:=Network
48 DEFAULT:=y
49 DEPENDS:=ppp +kmod-pppoe
50 TITLE:=PPPoE plugin
51 DESCRIPTION:=PPPoE (PPP over Ethernet) plugin for ppp
52 endef
53
54 define Package/ppp-mod-radius
55 SECTION:=net
56 CATEGORY:=Network
57 DEPENDS:=ppp
58 TITLE:=RADIUS plugin
59 DESCRIPTION:=RADIUS (Remote Authentication Dial-In User Service) plugin for ppp
60 endef
61
62 define Package/chat
63 SECTION:=net
64 CATEGORY:=Network
65 DEPENDS:=ppp
66 TITLE:=Establish conversation with a modem
67 DESCRIPTION:=Utility to establish conversation with other PPP servers (via a modem)
68 endef
69
70 define Package/pppdump
71 SECTION:=net
72 CATEGORY:=Network
73 DEPENDS:=ppp
74 TITLE:=Read PPP record file
75 DESCRIPTION:=Utility to read PPP record file
76 endef
77
78 define Package/pppstats
79 SECTION:=net
80 CATEGORY:=Network
81 DEPENDS:=ppp
82 TITLE:=Report PPP statistics
83 DESCRIPTION:=Utility to report PPP statistics
84 endef
85
86 define Build/Compile
87 rm -rf $(PKG_INSTALL_DIR)
88 mkdir -p $(PKG_INSTALL_DIR)/usr
89 $(MAKE) -C $(PKG_BUILD_DIR) \
90 CC=$(TARGET_CC) \
91 COPTS="$(TARGET_CFLAGS)" \
92 PRECOMPILED_FILTER=1 \
93 STAGING_DIR="$(STAGING_DIR)" \
94 DESTDIR="$(PKG_INSTALL_DIR)/usr" \
95 all install
96 endef
97
98 define Package/ppp/install
99 install -d -m0755 $(1)/lib/network
100 install -m0755 ./files/ppp.sh $(1)/lib/network/
101 install -d -m0755 $(1)/etc/ppp
102 install -m0600 ./files/etc/ppp/chap-secrets $(1)/etc/ppp/
103 install -m0644 ./files/etc/ppp/filter $(1)/etc/ppp/
104 install -m0755 ./files/etc/ppp/ip-up $(1)/etc/ppp/
105 install -d -m0755 $(1)/etc/ppp/ip-up.d
106 install -m0755 ./files/etc/ppp/ip-down $(1)/etc/ppp/
107 install -d -m0755 $(1)/etc/ppp/ip-down.d
108 install -m0644 ./files/etc/ppp/options $(1)/etc/ppp/
109 ln -sf /tmp/resolv.conf $(1)/etc/ppp/resolv.conf
110 install -d -m0755 $(1)/usr/lib/pppd/$(PKG_VERSION)
111 install -d -m0755 $(1)/usr/sbin
112 install -m0755 $(PKG_INSTALL_DIR)/usr/sbin/pppd $(1)/usr/sbin/
113 endef
114
115 define Package/ppp-mod-pppoa/install
116 install -d -m0755 $(1)/lib/network
117 install -m0755 ./files/pppoa.sh $(1)/lib/network/
118 install -d -m0755 $(1)/usr/lib/pppd/$(PKG_VERSION)
119 install -m0755 $(PKG_INSTALL_DIR)/usr/lib/pppd/$(PKG_VERSION)/pppoatm.so \
120 $(1)/usr/lib/pppd/$(PKG_VERSION)/
121 endef
122
123 define Package/ppp-mod-pppoe/install
124 install -d -m0755 $(1)/lib/network
125 install -m0755 ./files/pppoe.sh $(1)/lib/network/
126 install -d -m0755 $(1)/usr/lib/pppd/$(PKG_VERSION)
127 install -m0755 $(PKG_INSTALL_DIR)/usr/lib/pppd/$(PKG_VERSION)/rp-pppoe.so \
128 $(1)/usr/lib/pppd/$(PKG_VERSION)/
129 endef
130
131 define Package/ppp-mod-radius/install
132 install -d -m0755 $(1)/etc/ppp
133 install -m644 ./files/etc/ppp/radius.conf $(1)/etc/ppp/
134 install -d -m0755 $(1)/etc/ppp/radius
135 install -m644 ./files/etc/ppp/radius/dictionary* \
136 $(1)/etc/ppp/radius/
137 install -m600 ./files/etc/ppp/radius/servers \
138 $(1)/etc/ppp/radius/
139 install -d -m0755 $(1)/usr/lib/pppd/$(PKG_VERSION)
140 install -m0755 $(PKG_INSTALL_DIR)/usr/lib/pppd/$(PKG_VERSION)/radius.so \
141 $(1)/usr/lib/pppd/$(PKG_VERSION)/
142 endef
143
144 define Package/chat/install
145 install -d -m0755 $(1)/usr/sbin
146 install -m0755 $(PKG_INSTALL_DIR)/usr/sbin/chat $(1)/usr/sbin/
147 endef
148
149 define Package/pppdump/install
150 install -d -m0755 $(1)/usr/sbin
151 install -m0755 $(PKG_INSTALL_DIR)/usr/sbin/pppdump $(1)/usr/sbin/
152 endef
153
154 define Package/pppstats/install
155 install -d -m0755 $(1)/usr/sbin
156 install -m0755 $(PKG_INSTALL_DIR)/usr/sbin/pppstats $(1)/usr/sbin/
157 endef
158
159 $(eval $(call BuildPackage,ppp))
160 $(eval $(call BuildPackage,ppp-mod-pppoa))
161 $(eval $(call BuildPackage,ppp-mod-pppoe))
162 $(eval $(call BuildPackage,ppp-mod-radius))
163 $(eval $(call BuildPackage,chat))
164 $(eval $(call BuildPackage,pppdump))
165 $(eval $(call BuildPackage,pppstats))