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