1a45af82f27658fd789e9c0b6dba685252c686db
[openwrt/svn-archive/archive.git] / net / rp-pppoe / 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:=rp-pppoe
12 PKG_VERSION:=3.5
13 PKG_RELEASE:=1
14 PKG_MD5SUM:=97972f8f8f6a3ab9b7070333a6a29c4b
15
16 PKG_SOURCE_URL:=http://roaringpenguin.com/penguin/pppoe/
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
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 include $(INCLUDE_DIR)/package.mk
24
25 define Package/rp-pppoe
26 SECTION:=net
27 CATEGORY:=Network
28 DEPENDS:=+ppp
29 SUBMENU:=Roaring Penguin PPPoE (PPP over Ethernet) implementation
30 TITLE:=Roaring Penguin PPPoE (PPP over Ethernet) implementation
31 endef
32
33 define Package/rp-pppoe-client
34 $(call Package/rp-pppoe)
35 TITLE:=PPPoE (PPP over Ethernet) client
36 endef
37
38 define Package/rp-pppoe-relay
39 $(call Package/rp-pppoe)
40 TITLE:=PPPoE (PPP over Ethernet) relay
41 endef
42
43 define Package/rp-pppoe-server
44 $(call Package/rp-pppoe)
45 TITLE:=PPPoE (PPP over Ethernet) server
46 endef
47
48 define Package/rp-pppoe-sniff
49 $(call Package/rp-pppoe)
50 TITLE:=PPPoE (PPP over Ethernet) sniffer
51 endef
52
53 define Build/Configure
54 (cd $(PKG_BUILD_DIR)/src ; rm -rf config.{cache,status}; \
55 $(TARGET_CONFIGURE_OPTS) \
56 CFLAGS="$(TARGET_CFLAGS)" \
57 ./configure \
58 --target=$(GNU_TARGET_NAME) \
59 --host=$(GNU_TARGET_NAME) \
60 --build=$(GNU_HOST_NAME) \
61 --program-prefix="" \
62 --program-suffix="" \
63 --prefix=/usr \
64 --exec-prefix=/usr \
65 --bindir=/usr/bin \
66 --datadir=/usr/share \
67 --includedir=/usr/include \
68 --infodir=/usr/share/info \
69 --libdir=/usr/lib \
70 --libexecdir=/usr/lib \
71 --localstatedir=/var \
72 --mandir=/usr/share/man \
73 --sbindir=/usr/sbin \
74 --sysconfdir=/etc \
75 $(DISABLE_LARGEFILE) \
76 $(DISABLE_NLS) \
77 )
78 endef
79
80 define Build/Compile
81 $(MAKE) -C $(PKG_BUILD_DIR)/src \
82 DESTDIR="$(PKG_INSTALL_DIR)" \
83 all install
84 endef
85
86 define Package/rp-pppoe-client/install
87 install -d -m0755 $(1)/etc/init.d
88 install -m0755 ./files/pppoe-client.init $(1)/etc/init.d/pppoe-client
89 install -d -m0755 $(1)/etc/ppp
90 install -m0644 $(PKG_INSTALL_DIR)/etc/pppoe.conf $(1)/etc/
91 install -d -m0755 $(1)/usr/sbin
92 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/pppoe $(1)/usr/sbin/
93 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/adsl-* $(1)/usr/sbin/
94 endef
95
96 define Package/rp-pppoe-relay/install
97 install -d -m0755 $(1)/etc/default
98 install -m0755 ./files/pppoe-relay.default $(1)/etc/default/pppoe-relay
99 install -d -m0755 $(1)/etc/init.d
100 install -m0755 ./files/pppoe-relay.init $(1)/etc/init.d/pppoe-relay
101 install -d -m0755 $(1)/usr/sbin
102 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/pppoe-relay $(1)/usr/sbin/
103 endef
104
105 define Package/rp-pppoe-server/install
106 install -d -m0755 $(1)/etc/default
107 install -m0755 ./files/pppoe-server.default $(1)/etc/default/pppoe-server
108 install -d -m0755 $(1)/etc/init.d
109 install -m0755 ./files/pppoe-server.init $(1)/etc/init.d/pppoe-server
110 install -d -m0755 $(1)/etc/ppp
111 install -m0644 $(PKG_INSTALL_DIR)/etc/ppp/pppoe-server-options $(1)/etc/ppp/
112 install -d -m0755 $(1)/usr/sbin
113 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/pppoe-server $(1)/usr/sbin/
114 endef
115
116 define Package/rp-pppoe-sniff/install
117 install -d -m0755 $(1)/usr/sbin
118 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/pppoe-sniff $(1)/usr/sbin/
119 endef
120
121 $(eval $(call BuildPackage,rp-pppoe-client))
122 $(eval $(call BuildPackage,rp-pppoe-relay))
123 $(eval $(call BuildPackage,rp-pppoe-server))
124 $(eval $(call BuildPackage,rp-pppoe-sniff))
125