aboutsummaryrefslogtreecommitdiffstats
path: root/obsolete-buildroot/make/ppp.mk
blob: 66b17a69b4e8f35b7c4fa1d710b6357d6ea64384 (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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
## ppp & ppp-radius-plugin

PPP_VERSION := 2.4.2
PPP_RELEASE := 1

PPP_SOURCE:=ppp-$(PPP_VERSION).tar.gz
PPP_SITE:=ftp://ftp.samba.org/pub/ppp
PPP_DIR:=$(BUILD_DIR)/ppp-$(PPP_VERSION)
PPP_CAT:=zcat

PPP_PATCH_DIR := $(SOURCE_DIR)/openwrt/patches/ppp

PPP_BUILD_DIR := $(BUILD_DIR)/ppp_$(PPP_VERSION)-$(PPP_RELEASE)
PPP_IPK_DIR := $(OPENWRT_IPK_DIR)/ppp
PPP_IPK := $(PPP_BUILD_DIR)_$(ARCH).ipk

PPP_RADIUS_PLUGIN_BUILD_DIR := $(BUILD_DIR)/ppp-radius-plugin_$(PPP_VERSION)-$(PPP_RELEASE)
PPP_RADIUS_PLUGIN_IPK_DIR := $(OPENWRT_IPK_DIR)/ppp-radius-plugin
PPP_RADIUS_PLUGIN_IPK := $(PPP_RADIUS_PLUGIN_BUILD_DIR)_$(ARCH).ipk


$(DL_DIR)/$(PPP_SOURCE):
	 $(WGET) -P $(DL_DIR) $(PPP_SITE)/$(PPP_SOURCE)


$(PPP_DIR)/.stamp-unpacked: $(DL_DIR)/$(PPP_SOURCE)
	$(PPP_CAT) $(DL_DIR)/$(PPP_SOURCE) | tar -C $(BUILD_DIR) -xvf -

	touch $(PPP_DIR)/.stamp-unpacked


$(PPP_DIR)/.stamp-patched: $(PPP_DIR)/.stamp-unpacked
	$(SOURCE_DIR)/patch-kernel.sh $(PPP_DIR) $(PPP_PATCH_DIR)

	touch $(PPP_DIR)/.stamp-patched


$(PPP_DIR)/.stamp-configured: $(PPP_DIR)/.stamp-patched
	cd $(PPP_DIR)/pppd/plugins/radius/radiusclient ; \
	rm -rf config.cache ; \
	echo > aclocal.m4; \
	$(TARGET_CONFIGURE_OPTS) \
	ac_cv_func_setvbuf_reversed=no \
	ac_cv_func_uname=no \
	./configure \
	 --target=$(GNU_TARGET_NAME) \
	 --host=$(GNU_TARGET_NAME) \
	 --build=$(GNU_HOST_NAME) \
	 --prefix=/usr \
	 --exec-prefix=/usr \
	 --bindir=/usr/bin \
	 --sbindir=/usr/sbin \
	 --libexecdir=/usr/lib \
	 --sysconfdir=/etc \
	 --datadir=/usr/share \
	 --localstatedir=/var \
	 --mandir=/usr/share/man \
	 --infodir=/usr/share/info \
	 $(DISABLE_NLS) \
	 --disable-shared \
	 --enable-static \

	cd $(PPP_DIR) ; \
	rm -rf config.cache ; \
	$(TARGET_CONFIGURE_OPTS) \
	CFLAGS="$(TARGET_CFLAGS)" \
	./configure \
	 --target=$(GNU_TARGET_NAME) \
	 --host=$(GNU_TARGET_NAME) \
	 --build=$(GNU_HOST_NAME) \
	 --prefix=/usr \
	 --exec-prefix=/usr \
	 --bindir=/usr/bin \
	 --sbindir=/usr/sbin \
	 --libexecdir=/usr/lib \
	 --datadir=/usr/share \
	 --localstatedir=/var \
	 --mandir=/usr/share/man \
	 --infodir=/usr/share/info \
	 --sysconfdir=/etc \
	 $(DISABLE_NLS) \

	touch $(PPP_DIR)/.stamp-configured


$(PPP_DIR)/.stamp-built: $(PPP_DIR)/.stamp-configured
	cd  $(PPP_DIR) ; \
	$(MAKE) \
	 CC=$(TARGET_CC) \
	 COPTS="$(TARGET_CFLAGS)" \
	 all

	touch $(PPP_DIR)/.stamp-built


$(PPP_BUILD_DIR)/CONTROL/control: $(PPP_DIR)/.stamp-built
	rm -rf $(PPP_BUILD_DIR)
	mkdir -p $(PPP_BUILD_DIR)/usr/sbin
	cp -a $(PPP_DIR)/pppd/pppd $(PPP_BUILD_DIR)/usr/sbin/
	$(STRIP) $(PPP_BUILD_DIR)/usr/sbin/*
	cp -a $(PPP_IPK_DIR)/root/* $(PPP_BUILD_DIR)/
	chmod 0755 $(PPP_BUILD_DIR)/etc
	chmod 0755 $(PPP_BUILD_DIR)/etc/ppp
	chmod 0600 $(PPP_BUILD_DIR)/etc/ppp/chap-secrets
	chmod 0644 $(PPP_BUILD_DIR)/etc/ppp/options
	chmod 0755 $(PPP_BUILD_DIR)/etc/ppp/peers
	chmod 0755 $(PPP_BUILD_DIR)/usr
	chmod 0755 $(PPP_BUILD_DIR)/usr/sbin
	chmod 0755 $(PPP_BUILD_DIR)/usr/sbin/*
	cp -a $(PPP_IPK_DIR)/CONTROL $(PPP_BUILD_DIR)/
	perl -pi -e "s/^Vers.*:.*$$/Version: $(PPP_VERSION)-$(PPP_RELEASE)/" $(PPP_BUILD_DIR)/CONTROL/control
	perl -pi -e "s/^Arch.*:.*$$/Architecture: $(ARCH)/" $(PPP_BUILD_DIR)/CONTROL/control

	touch $(PPP_BUILD_DIR)/CONTROL/control


$(PPP_IPK): $(PPP_BUILD_DIR)/CONTROL/control
	cd $(BUILD_DIR); $(IPKG_BUILD) $(PPP_BUILD_DIR)


$(PPP_RADIUS_PLUGIN_BUILD_DIR)/CONTROL/control: $(PPP_DIR)/.stamp-built
	rm -rf $(PPP_RADIUS_PLUGIN_BUILD_DIR)
	mkdir -p $(PPP_RADIUS_PLUGIN_BUILD_DIR)/usr/lib/pppd/$(PPP_VERSION)
	cp -a $(PPP_DIR)/pppd/plugins/radius/radius.so $(PPP_RADIUS_PLUGIN_BUILD_DIR)/usr/lib/pppd/$(PPP_VERSION)/
	$(STRIP) $(PPP_RADIUS_PLUGIN_BUILD_DIR)/usr/lib/pppd/$(PPP_VERSION)/*
	cp -a $(PPP_RADIUS_PLUGIN_IPK_DIR)/root/* $(PPP_RADIUS_PLUGIN_BUILD_DIR)/
	chmod 0755 $(PPP_RADIUS_PLUGIN_BUILD_DIR)/etc
	chmod 0755 $(PPP_RADIUS_PLUGIN_BUILD_DIR)/etc/ppp
	chmod 0644 $(PPP_RADIUS_PLUGIN_BUILD_DIR)/etc/ppp/radius.conf
	chmod 0755 $(PPP_RADIUS_PLUGIN_BUILD_DIR)/etc/ppp/radius
	chmod 0644 $(PPP_RADIUS_PLUGIN_BUILD_DIR)/etc/ppp/radius/dict*
	chmod 0600 $(PPP_RADIUS_PLUGIN_BUILD_DIR)/etc/ppp/radius/servers
	chmod 0755 $(PPP_RADIUS_PLUGIN_BUILD_DIR)/usr
	chmod 0755 $(PPP_RADIUS_PLUGIN_BUILD_DIR)/usr/lib
	chmod 0755 $(PPP_RADIUS_PLUGIN_BUILD_DIR)/usr/lib/pppd
	chmod 0755 $(PPP_RADIUS_PLUGIN_BUILD_DIR)/usr/lib/pppd/$(PPP_VERSION)
	cp -a $(PPP_RADIUS_PLUGIN_IPK_DIR)/CONTROL $(PPP_RADIUS_PLUGIN_BUILD_DIR)/
	perl -pi -e "s/^Vers.*:.*$$/Version: $(PPP_VERSION)-$(PPP_RELEASE)/" $(PPP_RADIUS_PLUGIN_BUILD_DIR)/CONTROL/control
	perl -pi -e "s/^Arch.*:.*$$/Architecture: $(ARCH)/" $(PPP_RADIUS_PLUGIN_BUILD_DIR)/CONTROL/control

	touch $(PPP_RADIUS_PLUGIN_BUILD_DIR)/CONTROL/control


$(PPP_RADIUS_PLUGIN_IPK): $(PPP_RADIUS_PLUGIN_BUILD_DIR)/CONTROL/control
	cd $(BUILD_DIR); $(IPKG_BUILD) $(PPP_RADIUS_PLUGIN_BUILD_DIR)


ppp-ipk: ipkg-utils $(PPP_IPK) $(PPP_RADIUS_PLUGIN_IPK)

ppp-ipk-clean:
	rm -rf $(PPP_IPK) $(PPP_RADIUS_PLUGIN_IPK)
	rm -rf $(PPP_BUILD_DIR) $(PPP_RADIUS_PLUGIN_BUILD_DIR)

ppp-clean:
	cd $(PPP_DIR) ; \
	$(MAKE) clean

ppp-dirclean:
	rm -rf $(PPP_DIR)