summaryrefslogtreecommitdiffstats
path: root/openwrt/package/rp-pppoe/Makefile
blob: 1b829d8363707b07b80db4405931d610b8b9f0f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# $Id$

include $(TOPDIR)/rules.mk

PKG_NAME:=rp-pppoe
PKG_VERSION:=3.5
PKG_RELEASE:=1
PKG_MD5SUM:=

PKG_SOURCE_URL:=http://roaringpenguin.com/penguin/pppoe/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_CAT:=zcat

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install

include $(TOPDIR)/package/rules.mk

$(eval $(call PKG_template,PPPOE_CLIENT,pppoe-client,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
$(eval $(call PKG_template,PPPOE_RELAY,pppoe-relay,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
$(eval $(call PKG_template,PPPOE_SERVER,pppoe-server,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
$(eval $(call PKG_template,PPPOE_SNIFF,pppoe-sniff,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))

$(PKG_BUILD_DIR)/.configured:
	(cd $(PKG_BUILD_DIR)/src ; rm -rf config.{cache,status}; \
		$(TARGET_CONFIGURE_OPTS) \
		CFLAGS="$(TARGET_CFLAGS)" \
		ac_cv_func_setvbuf_reversed=no \
		ac_cv_sizeof_unsigned_short=2 \
		ac_cv_sizeof_unsigned_int=4 \
		ac_cv_sizeof_unsigned_long=4 \
		ac_cv_linux_kernel_pppoe=yes \
		ac_cv_pack_bitfields_reversed=yes \
		./configure \
		  --target=$(GNU_TARGET_NAME) \
		  --host=$(GNU_TARGET_NAME) \
		  --build=$(GNU_HOST_NAME) \
		  --program-prefix="" \
		  --program-suffix="" \
		  --prefix=/usr \
		  --exec-prefix=/usr \
		  --bindir=/usr/bin \
		  --datadir=/usr/share \
		  --includedir=/usr/include \
		  --infodir=/usr/share/info \
		  --libdir=/usr/lib \
		  --libexecdir=/usr/lib \
		  --localstatedir=/var \
		  --mandir=/usr/share/man \
		  --sbindir=/usr/sbin \
		  --sysconfdir=/etc \
		  $(DISABLE_LARGEFILE) \
		  $(DISABLE_NLS) \
	)
	touch $@

$(PKG_BUILD_DIR)/.built:
	$(MAKE) -C $(PKG_BUILD_DIR)/src \
		DESTDIR="$(PKG_INSTALL_DIR)" \
		all install
	touch $@

$(IPKG_PPPOE_CLIENT):
	install -d -m0755 $(IDIR_PPPOE_CLIENT)/etc/init.d
	install -m0755 ./files/pppoe-client.init $(IDIR_PPPOE_CLIENT)/etc/init.d/pppoe-client
	install -d -m0755 $(IDIR_PPPOE_CLIENT)/etc/ppp
	install -m0644 $(PKG_INSTALL_DIR)/etc/pppoe.conf $(IDIR_PPPOE_CLIENT)/etc/
	install -d -m0755 $(IDIR_PPPOE_CLIENT)/usr/sbin
	$(CP) $(PKG_INSTALL_DIR)/usr/sbin/pppoe $(IDIR_PPPOE_CLIENT)/usr/sbin/
	$(CP) $(PKG_INSTALL_DIR)/usr/sbin/adsl-* $(IDIR_PPPOE_CLIENT)/usr/sbin/
	$(RSTRIP) $(IDIR_PPPOE_CLIENT)
	$(IPKG_BUILD) $(IDIR_PPPOE_CLIENT) $(PACKAGE_DIR)

$(IPKG_PPPOE_RELAY):
	install -d -m0755 $(IDIR_PPPOE_RELAY)/etc/default
	install -m0755 ./files/pppoe-relay.default $(IDIR_PPPOE_RELAY)/etc/default/pppoe-relay
	install -d -m0755 $(IDIR_PPPOE_RELAY)/etc/init.d
	install -m0755 ./files/pppoe-relay.init $(IDIR_PPPOE_RELAY)/etc/init.d/pppoe-relay
	install -d -m0755 $(IDIR_PPPOE_RELAY)/usr/sbin
	$(CP) $(PKG_INSTALL_DIR)/usr/sbin/pppoe-relay $(IDIR_PPPOE_RELAY)/usr/sbin/
	$(RSTRIP) $(IDIR_PPPOE_RELAY)
	$(IPKG_BUILD) $(IDIR_PPPOE_RELAY) $(PACKAGE_DIR)

$(IPKG_PPPOE_SERVER):
	install -d -m0755 $(IDIR_PPPOE_SERVER)/etc/default
	install -m0755 ./files/pppoe-server.default $(IDIR_PPPOE_SERVER)/etc/default/pppoe-server
	install -d -m0755 $(IDIR_PPPOE_SERVER)/etc/init.d
	install -m0755 ./files/pppoe-server.init $(IDIR_PPPOE_SERVER)/etc/init.d/pppoe-server
	install -d -m0755 $(IDIR_PPPOE_SERVER)/etc/ppp
	install -m0644 $(PKG_INSTALL_DIR)/etc/ppp/pppoe-server-options $(IDIR_PPPOE_SERVER)/etc/ppp/
	install -d -m0755 $(IDIR_PPPOE_SERVER)/usr/sbin
	$(CP) $(PKG_INSTALL_DIR)/usr/sbin/pppoe-server $(IDIR_PPPOE_SERVER)/usr/sbin/
	$(RSTRIP) $(IDIR_PPPOE_SERVER)
	$(IPKG_BUILD) $(IDIR_PPPOE_SERVER) $(PACKAGE_DIR)

$(IPKG_PPPOE_SNIFF):
	install -d -m0755 $(IDIR_PPPOE_SNIFF)/usr/sbin
	$(CP) $(PKG_INSTALL_DIR)/usr/sbin/pppoe-sniff $(IDIR_PPPOE_SNIFF)/usr/sbin/
	$(RSTRIP) $(IDIR_PPPOE_SNIFF)
	$(IPKG_BUILD) $(IDIR_PPPOE_SNIFF) $(PACKAGE_DIR)