summaryrefslogtreecommitdiffstats
path: root/openwrt/package/rp-pppoe/patches/rp-pppoe-3.5-Makefile.patch
blob: 188a0e11cfc67698b1d17a5414dc3f856eb2d222 (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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
diff -ruN rp-pppoe-3.5-orig/src/Makefile.in rp-pppoe-3.5-4/src/Makefile.in
--- rp-pppoe-3.5-orig/src/Makefile.in	2002-07-08 16:38:24.000000000 +0200
+++ rp-pppoe-3.5-4/src/Makefile.in	2005-03-09 16:37:38.000000000 +0100
@@ -62,21 +62,23 @@
 TARGETS=@TARGETS@
 PPPOE_SERVER_LIBS=$(LIC_LIBDIR) $(LIC_LIB)
 
+LIBS="-lc"
+
 all: $(TARGETS)
 	@echo ""
 	@echo "Type 'make install' as root to install the software."
 
 pppoe-sniff: pppoe-sniff.o if.o common.o debug.o
-	@CC@ -o pppoe-sniff pppoe-sniff.o if.o common.o debug.o
+	@CC@ $(CFLAGS) -o pppoe-sniff pppoe-sniff.o if.o common.o debug.o $(LIBS)
 
 pppoe-server: pppoe-server.o if.o debug.o common.o md5.o libevent/libevent.a @PPPOE_SERVER_DEPS@
-	@CC@ -o pppoe-server @RDYNAMIC@ pppoe-server.o if.o debug.o common.o md5.o $(PPPOE_SERVER_LIBS) -Llibevent -levent
+	@CC@ $(CFLAGS) -o pppoe-server @RDYNAMIC@ pppoe-server.o if.o debug.o common.o md5.o $(PPPOE_SERVER_LIBS) -Llibevent -levent $(LIBS)
 
 pppoe: pppoe.o if.o debug.o common.o ppp.o discovery.o
-	@CC@ -o pppoe pppoe.o if.o debug.o common.o ppp.o discovery.o
+	@CC@ $(CFLAGS) -o pppoe pppoe.o if.o debug.o common.o ppp.o discovery.o $(LIBS)
 
 pppoe-relay: relay.o if.o debug.o common.o
-	@CC@ -o pppoe-relay relay.o if.o debug.o common.o
+	@CC@ $(CFLAGS) -o pppoe-relay relay.o if.o debug.o common.o $(LIBS)
 
 pppoe.o: pppoe.c pppoe.h
 	@CC@ $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o pppoe.o pppoe.c
@@ -119,7 +121,7 @@
 	@CC@ '-DRP_VERSION="$(VERSION)"' $(CFLAGS) -I$(PPPD_INCDIR) -c -o plugin/plugin.o -fPIC plugin.c
 
 plugin/libplugin.a: plugin/discovery.o plugin/if.o plugin/common.o plugin/debug.o
-	ar -rc $@ $^
+	$(AR) -rc $@ $^
 
 plugin/discovery.o: discovery.c
 	@CC@ $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o plugin/discovery.o -fPIC discovery.c
@@ -134,78 +136,78 @@
 	@CC@ $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o plugin/common.o -fPIC common.c
 
 install: all
-	-mkdir -p $(RPM_INSTALL_ROOT)$(sbindir)
-	$(install) -m 755 -s pppoe $(RPM_INSTALL_ROOT)$(sbindir)
-	$(install) -m 755 -s pppoe-server $(RPM_INSTALL_ROOT)$(sbindir)
-	if test -x licensed-only/pppoe-server-control ; then $(install) -m 755 -s licensed-only/pppoe-server-control $(RPM_INSTALL_ROOT)$(sbindir); fi
-	if test -x pppoe-relay ; then $(install) -m 755 -s pppoe-relay $(RPM_INSTALL_ROOT)$(sbindir); fi
-	if test -x pppoe-sniff; then $(install) -m 755 -s pppoe-sniff $(RPM_INSTALL_ROOT)$(sbindir); fi
-	$(install) -m 755 ../scripts/adsl-connect $(RPM_INSTALL_ROOT)$(sbindir)
-	$(install) -m 755 ../scripts/adsl-start $(RPM_INSTALL_ROOT)$(sbindir)
-	$(install) -m 755 ../scripts/adsl-status $(RPM_INSTALL_ROOT)$(sbindir)
-	$(install) -m 755 ../scripts/adsl-stop $(RPM_INSTALL_ROOT)$(sbindir)
-	$(install) -m 755 ../scripts/adsl-setup $(RPM_INSTALL_ROOT)$(sbindir)
-	-mkdir -p $(RPM_INSTALL_ROOT)$(docdir)
-	$(install) -m 644 ../doc/CHANGES $(RPM_INSTALL_ROOT)$(docdir)
-	$(install) -m 644 ../doc/KERNEL-MODE-PPPOE $(RPM_INSTALL_ROOT)$(docdir)
-	$(install) -m 644 ../doc/HOW-TO-CONNECT $(RPM_INSTALL_ROOT)$(docdir)
-	$(install) -m 644 ../doc/LICENSE $(RPM_INSTALL_ROOT)$(docdir)
-	$(install) -m 644 ../README $(RPM_INSTALL_ROOT)$(docdir)
-	$(install) -m 644 ../SERVPOET $(RPM_INSTALL_ROOT)$(docdir)
-	$(install) -m 644 ../configs/pap-secrets $(RPM_INSTALL_ROOT)$(docdir)
-	-mkdir -p $(RPM_INSTALL_ROOT)$(mandir)/man8
+	-mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir)
+	$(install) -m 755 pppoe $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir)
+	$(install) -m 755 pppoe-server $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir)
+	if test -x licensed-only/pppoe-server-control ; then $(install) -m 755 licensed-only/pppoe-server-control $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir); fi
+	if test -x pppoe-relay ; then $(install) -m 755 pppoe-relay $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir); fi
+	if test -x pppoe-sniff; then $(install) -m 755 pppoe-sniff $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir); fi
+	$(install) -m 755 ../scripts/adsl-connect $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir)
+	$(install) -m 755 ../scripts/adsl-start $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir)
+	$(install) -m 755 ../scripts/adsl-status $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir)
+	$(install) -m 755 ../scripts/adsl-stop $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir)
+	$(install) -m 755 ../scripts/adsl-setup $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir)
+	-mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)$(docdir)
+	$(install) -m 644 ../doc/CHANGES $(RPM_INSTALL_ROOT)$(DESTDIR)$(docdir)
+	$(install) -m 644 ../doc/KERNEL-MODE-PPPOE $(RPM_INSTALL_ROOT)$(DESTDIR)$(docdir)
+	$(install) -m 644 ../doc/HOW-TO-CONNECT $(RPM_INSTALL_ROOT)$(DESTDIR)$(docdir)
+	$(install) -m 644 ../doc/LICENSE $(RPM_INSTALL_ROOT)$(DESTDIR)$(docdir)
+	$(install) -m 644 ../README $(RPM_INSTALL_ROOT)$(DESTDIR)$(docdir)
+	$(install) -m 644 ../SERVPOET $(RPM_INSTALL_ROOT)$(DESTDIR)$(docdir)
+	$(install) -m 644 ../configs/pap-secrets $(RPM_INSTALL_ROOT)$(DESTDIR)$(docdir)
+	-mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)$(mandir)/man8
 	for i in $(TARGETS) ; do \
 		if test -f ../man/$$i.8 ; then \
-			$(install) -m 644 ../man/$$i.8 $(RPM_INSTALL_ROOT)$(mandir)/man8 || exit 1; \
+			$(install) -m 644 ../man/$$i.8 $(RPM_INSTALL_ROOT)$(DESTDIR)$(mandir)/man8 || exit 1; \
 		fi; \
 	done
-	$(install) -m 644 ../man/adsl-start.8 $(RPM_INSTALL_ROOT)$(mandir)/man8
-	$(install) -m 644 ../man/adsl-stop.8 $(RPM_INSTALL_ROOT)$(mandir)/man8
-	$(install) -m 644 ../man/adsl-status.8 $(RPM_INSTALL_ROOT)$(mandir)/man8
-	$(install) -m 644 ../man/adsl-connect.8 $(RPM_INSTALL_ROOT)$(mandir)/man8
-	$(install) -m 644 ../man/adsl-setup.8 $(RPM_INSTALL_ROOT)$(mandir)/man8
-	-mkdir -p $(RPM_INSTALL_ROOT)$(mandir)/man5
-	$(install) -m 644 ../man/pppoe.conf.5 $(RPM_INSTALL_ROOT)$(mandir)/man5
-	-mkdir -p $(RPM_INSTALL_ROOT)/etc/ppp
-	-mkdir -p $(RPM_INSTALL_ROOT)$(PLUGIN_DIR)
-	-echo "# Directory created by rp-pppoe for kernel-mode plugin" > $(RPM_INSTALL_ROOT)$(PLUGIN_DIR)/README
-	@if test -r rp-pppoe.so; then $(install) -m 755 rp-pppoe.so $(RPM_INSTALL_ROOT)$(PLUGIN_DIR); fi
-	@for i in pppoe.conf firewall-standalone firewall-masq ; do \
-		if [ ! -f $(RPM_INSTALL_ROOT)/etc/ppp/$$i ] ; then \
-			$(install) -m 644 ../configs/$$i $(RPM_INSTALL_ROOT)/etc/ppp ; \
+	$(install) -m 644 ../man/adsl-start.8 $(RPM_INSTALL_ROOT)$(DESTDIR)$(mandir)/man8
+	$(install) -m 644 ../man/adsl-stop.8 $(RPM_INSTALL_ROOT)$(DESTDIR)$(mandir)/man8
+	$(install) -m 644 ../man/adsl-status.8 $(RPM_INSTALL_ROOT)$(DESTDIR)$(mandir)/man8
+	$(install) -m 644 ../man/adsl-connect.8 $(RPM_INSTALL_ROOT)$(DESTDIR)$(mandir)/man8
+	$(install) -m 644 ../man/adsl-setup.8 $(RPM_INSTALL_ROOT)$(DESTDIR)$(mandir)/man8
+	-mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)$(mandir)/man5
+	$(install) -m 644 ../man/pppoe.conf.5 $(RPM_INSTALL_ROOT)$(DESTDIR)$(mandir)/man5
+	-mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/ppp
+	-mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)$(PLUGIN_DIR)
+	-echo "# Directory created by rp-pppoe for kernel-mode plugin" > $(RPM_INSTALL_ROOT)$(DESTDIR)$(PLUGIN_DIR)/README
+	@if test -r rp-pppoe.so; then $(install) -m 755 rp-pppoe.so $(RPM_INSTALL_ROOT)$(DESTDIR)$(PLUGIN_DIR); fi
+	@for i in pppoe.conf; do \
+		if [ ! -f $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/$$i ] ; then \
+			$(install) -m 644 ../configs/$$i $(RPM_INSTALL_ROOT)$(DESTDIR)/etc ; \
 		else \
-			echo "NOT overwriting existing $(RPM_INSTALL_ROOT)/etc/ppp/$$i" ;\
-			$(install) -m 644 ../configs/$$i $(RPM_INSTALL_ROOT)/etc/ppp/$$i-$(VERSION) ;\
+			echo "NOT overwriting existing $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/$$i" ;\
+			$(install) -m 644 ../configs/$$i $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/$$i-$(VERSION) ;\
 		fi ;\
 	done
-	@if [ ! -f $(RPM_INSTALL_ROOT)$(PPPOESERVER_PPPD_OPTIONS) ] ; then \
-		$(install) -m 644 ../configs/pppoe-server-options $(RPM_INSTALL_ROOT)$(PPPOESERVER_PPPD_OPTIONS) ; \
+	@if [ ! -f $(RPM_INSTALL_ROOT)$(DESTDIR)$(PPPOESERVER_PPPD_OPTIONS) ] ; then \
+		$(install) -m 644 ../configs/pppoe-server-options $(RPM_INSTALL_ROOT)$(DESTDIR)$(PPPOESERVER_PPPD_OPTIONS) ; \
 	else \
-		echo "NOT overwriting existing $(RPM_INSTALL_ROOT)$(PPPOESERVER_PPPD_OPTIONS)"; \
-		$(install) -m 644 ../configs/pppoe-server-options $(RPM_INSTALL_ROOT)$(PPPOESERVER_PPPD_OPTIONS)-example ; \
+		echo "NOT overwriting existing $(RPM_INSTALL_ROOT)$(DESTDIR)$(PPPOESERVER_PPPD_OPTIONS)"; \
+		$(install) -m 644 ../configs/pppoe-server-options $(RPM_INSTALL_ROOT)$(DESTDIR)$(PPPOESERVER_PPPD_OPTIONS)-example ; \
 	fi
 	@if [ -f /etc/redhat-release ] ; then \
-		echo "Looks like a Red Hat system; installing $(RPM_INSTALL_ROOT)/etc/rc.d/init.d/adsl" ; \
-		mkdir -p $(RPM_INSTALL_ROOT)/etc/rc.d/init.d ;\
-		$(install) -m 755 ../scripts/adsl-init $(RPM_INSTALL_ROOT)/etc/rc.d/init.d/adsl ; \
+		echo "Looks like a Red Hat system; installing $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/rc.d/init.d/adsl" ; \
+		mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/rc.d/init.d ;\
+		$(install) -m 755 ../scripts/adsl-init $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/rc.d/init.d/adsl ; \
 	fi
 	@if [ -f /etc/turbolinux-release ] ; then \
-		echo "Looks like a TurboLinux system; installing $(RPM_INSTALL_ROOT)/etc/rc.d/init.d/adsl" ; \
-		mkdir -p $(RPM_INSTALL_ROOT)/etc/rc.d/init.d ;\
-		$(install) -m 755 ../scripts/adsl-init-turbolinux $(RPM_INSTALL_ROOT)/etc/rc.d/init.d/adsl ; \
+		echo "Looks like a TurboLinux system; installing $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/rc.d/init.d/adsl" ; \
+		mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/rc.d/init.d ;\
+		$(install) -m 755 ../scripts/adsl-init-turbolinux $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/rc.d/init.d/adsl ; \
 	fi
 	@if [ -f /etc/SuSE-release ] ; then \
-		echo "Looks like a SuSE Linux system; installing $(RPM_INSTALL_ROOT)/etc/rc.d/init.d/adsl" ; \
-		mkdir -p $(RPM_INSTALL_ROOT)/etc/rc.d/init.d ;\
-		$(install) -m 755 ../scripts/adsl-init-suse $(RPM_INSTALL_ROOT)/etc/rc.d/init.d/adsl ; \
+		echo "Looks like a SuSE Linux system; installing $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/rc.d/init.d/adsl" ; \
+		mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/rc.d/init.d ;\
+		$(install) -m 755 ../scripts/adsl-init-suse $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/rc.d/init.d/adsl ; \
 	fi
 
 	# L2TP
 	@if [ -f l2tp/handlers/sync-pppd.so ] ; then \
-		mkdir -p $(RPM_INSTALL_ROOT)/usr/lib/l2tp/plugins ; \
-		$(install) -m 755 l2tp/handlers/sync-pppd.so $(RPM_INSTALL_ROOT)/usr/lib/l2tp/plugins ; \
-		mkdir -p $(RPM_INSTALL_ROOT)/etc/l2tp ; \
-		$(install) -m 600 l2tp/l2tp.conf $(RPM_INSTALL_ROOT)/etc/l2tp/l2tp.conf.example ; \
+		mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)/usr/lib/l2tp/plugins ; \
+		$(install) -m 755 l2tp/handlers/sync-pppd.so $(RPM_INSTALL_ROOT)$(DESTDIR)/usr/lib/l2tp/plugins ; \
+		mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/l2tp ; \
+		$(install) -m 600 l2tp/l2tp.conf $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/l2tp/l2tp.conf.example ; \
 	fi
 	@echo ""
 	@echo "Type 'adsl-setup' to configure the software."
@@ -288,7 +290,7 @@
 	cd .. && rpm -ba servpoet.spec
 
 clean:
-	rm -f *.o pppoe pppoe-sniff pppoe-server core rp-pppoe.so plugin/*.o plugin/libplugin.a *~
+	rm -f *.o pppoe pppoe-relay pppoe-sniff pppoe-server core rp-pppoe.so plugin/*.o plugin/libplugin.a *~
 	test -f licensed-only/Makefile && $(MAKE) -C licensed-only clean || true
 	test -f libevent/Makefile && $(MAKE) -C libevent clean || true
 	test -f l2tp/Makefile && $(MAKE) -C l2tp clean || true
diff -ruN rp-pppoe-3.5-orig/src/libevent/Makefile.in rp-pppoe-3.5-4/src/libevent/Makefile.in
--- rp-pppoe-3.5-orig/src/libevent/Makefile.in	2002-07-08 16:38:24.000000000 +0200
+++ rp-pppoe-3.5-4/src/libevent/Makefile.in	2005-03-09 16:37:38.000000000 +0100
@@ -18,24 +18,24 @@
 
 libevent.a: $(OBJS)
 	rm -f libevent.a
-	ar -cq libevent.a $(OBJS)
+	$(AR) r libevent.a $(OBJS)
 	@RANLIB@ libevent.a
 
 event.o: event.c $(HDRS)
-	gcc $(CFLAGS) -c -o event.o event.c
+	@CC@ $(CFLAGS) -c -o event.o event.c
 
 hash.o: hash.c $(HDRS)
-	gcc $(CFLAGS) -c -o hash.o hash.c
+	@CC@ $(CFLAGS) -c -o hash.o hash.c
 
 event_sig.o: event_sig.c $(HDRS)
-	gcc $(CFLAGS) -c -o event_sig.o event_sig.c
+	@CC@ $(CFLAGS) -c -o event_sig.o event_sig.c
 
 event_tcp.o: event_tcp.c $(HDRS)
-	gcc $(CFLAGS) -c -o event_tcp.o event_tcp.c
+	@CC@ $(CFLAGS) -c -o event_tcp.o event_tcp.c
 
 clean: FORCE
 	rm -f *.a *.o *~
 
 FORCE:
 
-.phony: FORCE
\ No newline at end of file
+.phony: FORCE