summaryrefslogtreecommitdiff
path: root/ebtables/ebtables-2.0.6/installnonroot.patch
blob: 0211e623646899f91c0754c666f3b1b63496cf4b (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

#
# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
#

--- ebtables-v2.0.6/Makefile~installnonroot	2003-11-02 12:22:56.000000000 -0600
+++ ebtables-v2.0.6/Makefile	2004-06-03 13:34:17.000000000 -0500
@@ -7,6 +7,7 @@
 MANDIR?=/usr/local/man
 CFLAGS:=-Wall -Wunused
 CC:=gcc
+INSTALLOWN=$(if $(filter 0,$(shell id -u)),-o root -g root)
 
 ifeq ($(shell uname -m),sparc64)
 CFLAGS+=-DEBT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32
@@ -46,15 +47,15 @@
 
 $(MANDIR)/man8/ebtables.8: ebtables.8
 	mkdir -p $(@D)
-	install -m 0644 -o root -g root $< $@
+	install -m 0644 $(INSTALLOWN) $< $@
 
 $(ETHERTYPESFILE): ethertypes
 	mkdir -p $(@D)
-	install -m 0644 -o root -g root $< $@
+	install -m 0644 $(INSTALLOWN) $< $@
 
 .PHONY: exec
 exec: ebtables
-	install -m 0755 -o root -g root $< $(BINFILE)
+	install -m 0755 $(INSTALLOWN) $< $(BINFILE)
 
 .PHONY: install
 install: $(MANDIR)/man8/ebtables.8 $(ETHERTYPESFILE) exec
@@ -70,16 +71,16 @@
 .PHONY: release
 release:
 	mkdir -p include/linux/netfilter_bridge
-	install -m 0644 -o root -g root \
+	install -m 0644 $(INSTALLOWN) \
 		$(KERNEL_INCLUDES)/linux/netfilter_bridge.h include/linux/
 # To keep possible compile error complaints about undefined ETH_P_8021Q
 # off my back
-	install -m 0644 -o root -g root \
+	install -m 0644 $(INSTALLOWN) \
 		$(KERNEL_INCLUDES)/linux/if_ether.h include/linux/
-	install -m 0644 -o root -g root \
+	install -m 0644 $(INSTALLOWN) \
 		$(KERNEL_INCLUDES)/linux/netfilter_bridge/*.h \
 		include/linux/netfilter_bridge/
-	install -m 0644 -o root -g root \
+	install -m 0644 $(INSTALLOWN) \
 		include/ebtables.h include/linux/netfilter_bridge/
 	make clean
 	touch *