summaryrefslogtreecommitdiff
path: root/package/privoxy/patches/patch-GNUmakefile_in
blob: ad40c6013b04cb3f396acca135da910200321b7a (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
$Id$
--- privoxy-3.0.12-stable.orig/GNUmakefile.in	2009-02-28 09:28:14.000000000 +0100
+++ privoxy-3.0.12-stable/GNUmakefile.in	2009-04-17 17:47:06.241568604 +0200
@@ -51,10 +51,6 @@ SNAPVERSION   = $(RPM_VERSION)-$(shell d
 # "make install" directories and variables
 #############################################################################
 
-#User Group paras
-USER         = @USER@
-GROUP	   = @GROUP@
-
 datarootdir  = @datarootdir@
 prefix       = @prefix@
 exec_prefix  = @exec_prefix@
@@ -97,8 +93,6 @@ INSTALL_T  = -m $(RA_MODE)
 INSTALL_D  = -m $(DIR_MODE) -d
 INSTALL_R  = -m $(RWD_MODE)
 
-# install options for superuser install
-#INSTALL_S  = -g @GROUP@ -o @USER@ 
 
 #############################################################################
 # Build tools
@@ -939,7 +933,7 @@ pcre/chartables.c:   pcre/dftables@EXEEX
 		pcre/dftables@EXEEXT@ >pcre/chartables.c
 
 pcre/dftables@EXEEXT@:       pcre/dftables.c pcre/maketables.c pcre/pcre.h pcre/internal.h pcre/config.h
-		$(CC) -o pcre/dftables@EXEEXT@ $(CFLAGS) pcre/dftables.c
+		$(HOSTCC) -o pcre/dftables@EXEEXT@ $(HOSTCFLAGS) pcre/dftables.c
 
 # Win32
 w32log.@OBJEXT@: w32log.c errlog.h config.h jcc.h loadcfg.h miscutil.h pcre/pcre.h pcre/pcreposix.h pcrs.h project.h w32log.h w32taskbar.h win32.h
@@ -1011,13 +1005,6 @@ check_doc:=$(shell if [ ! -d "$(SHARE_DE
 		 $(ECHO) "0";\
 	 fi)
 
-# If USER is specified but no GROUP, assume there is a GROUP of same name.
-GROUP_T:=$(shell if [ x$(GROUP) = x ] && [ x$(USER) != x ];then \
-		$(ECHO) "$(USER)" ;\
-	 else\
-		 $(ECHO) "$(GROUP)";\
-	 fi)
-
 install-strip:
 	$(MAKE) install STRIP=-s
 
@@ -1028,16 +1015,7 @@ install-strip:
 # universally reliable (eg Solaris). Group handling could be better. 
 # Perhaps the whole user/group validation should be done here, and simplified.
 PROGRAM_V = Privoxy $(VERSION) $(CODE_STATUS)
-install: CONF_DEST LOG_DEST PID_DEST check_doc GROUP_T
-	@# Quick test for valid USER.
-	@if [ -n "$(USER)" ]; then \
-		$(ID) $(USER) >/dev/null || exit 1;\
-	fi
-	@# Test for valid group. FIXME. USER does not have to belong to GROUP 
-	@# for file ownership purposes.
-# 	if [ -n "$(GROUP_T)" ] && [ -n "$(USER)" ] && ! $(GROUPS) $(USER) | $(GREP) "\<$(GROUP_T)\>" >/dev/null; then \
-# 		$(ECHO) Group $(GROUP_T) for User $(USER) is invalid && exit 1 ;\
-# 	fi
+install: CONF_DEST LOG_DEST PID_DEST check_doc
 
 	@$(ECHO) "Creating directories, and preparing $(PROGRAM_V) installation"
 	$(CHMOD) $(DIR_MODE) $(MKDIR)
@@ -1106,41 +1084,7 @@ install: CONF_DEST LOG_DEST PID_DEST che
 		$(INSTALL) $(INSTALL_T) $$i $(DESTDIR)$(CONF_DEST)/templates ;\
 	done
 
-	@# FIXME: group/user validation is overly convoluted.
-	@# If superuser install ... we require a minimum of group ownership
-	@# of those files the daemon writes to, to be non-root owned.
-	@if [ "`$(ID) |sed 's/(.*//' |sed 's/.*=//'`" = "0" ] ;then\
-		if [ x$(USER) = x ] || [ $(USER) = root ]; then \
-			if [ x$(GROUP) = x ] || [ $(GROUP) = root ]; then \
-				if [ "`$(ID) privoxy`" ] && \
-					$(GROUPS) privoxy | $(SED) 's/^.*://' |$(GREP) "\<privoxy\>" >/dev/null; then \
-					$(ECHO) "Warning: Setting group owner to privoxy";\
-					GROUP_T=privoxy ;\
-				else \
-					$(ECHO)  "******************************************************************" ;\
-					$(ECHO)  " WARNING! WARNING! installing config files as root!" ;\
-					$(ECHO)  " It is strongly recommended to run $(PROGRAM) as a non-root user," ;\
-					$(ECHO)  " and to install the config files as that user and/or group!" ;\
-					$(ECHO)  " Please read INSTALL, and create a privoxy user and group!" ;\
-					$(ECHO)  "*******************************************************************" ;\
-					exit 1 ;\
-				fi ;\
-			else \
-				GROUP_T=$(GROUP) ;\
-			fi ;\
-			INSTALL_CONF="$(INSTALL_R) -g $$GROUP_T " ;\
-		else \
-			$(ECHO) "Superuser install, installing config files as $(USER):$(GROUP_T)" ;\
-			INSTALL_CONF="$(INSTALL_R) -o $(USER) -g $(GROUP_T)" ;\
-			GROUP_T=$(GROUP_T) ;\
-		fi ;\
-	else \
-		if [ ! "`id $(USER)`" = "`id`" ] ;then \
-			$(ECHO) "** WARNING ** current install user different from configured user!!" ;\
-			$(ECHO) "Edit may fail." ;\
-		fi ;\
-		INSTALL_CONF="$(INSTALL_R)" ;\
-	fi ;\
+	INSTALL_CONF="$(INSTALL_R)" ;\
 	$(ECHO) Installing configuration files to $(DESTDIR)$(CONF_DEST);\
 	for i in $(CONFIGS); do \
 		if [ "$$i" = "default.action" ] || [ "$$i" = "default.filter" ] ; then \
@@ -1162,44 +1106,7 @@ install: CONF_DEST LOG_DEST PID_DEST che
 	[ ! -f $(DESTDIR)$(LOG_DEST)/logfile ] && $(ECHO) Creating logfiles in $(DESTDIR)$(LOG_DEST) || \
 		$(ECHO) Checking logfiles in $(DESTDIR)$(LOG_DEST) ;\
 		$(TOUCH) $(DESTDIR)$(LOG_DEST)/logfile || exit 1 ;\
-	if [ x$$USER != x ]; then \
-		$(CHOWN) $$USER $(DESTDIR)$(LOG_DEST)/logfile || \
-		$(ECHO) "** WARNING ** current install user different from configured user. Logging may fail!!" ;\
-	fi ;\
-	if [ x$$GROUP_T != x ]; then \
-		$(CHGRP) $$GROUP_T $(DESTDIR)$(LOG_DEST)/logfile || \
-		$(ECHO) "** WARNING ** current install user different from configured user. Logging may fail!!" ;\
-	fi ;\
-	$(CHMOD) $(RWD_MODE) $(DESTDIR)$(LOG_DEST)/logfile || exit 1 ;\
-	if [ "$(prefix)" = "/usr/local" ] || [ "$(prefix)" = "/usr" ]; then \
-		if [ -f /etc/slackware-version ] && [ -d /etc/rc.d/ ] && [ -w /etc/rc.d/ ] ; then \
-               $(SED) 's+%PROGRAM%+$(PROGRAM)+' slackware/rc.privoxy.orig | \
-               $(SED) 's+%SBIN_DEST%+$(SBIN_DEST)+' | \
-               $(SED) 's+%CONF_DEST%+$(CONF_DEST)+' | \
-               $(SED) 's+%USER%+$(USER)+' | \
-               $(SED) 's+%GROUP%+$(GROUP_T)+' >slackware/rc.privoxy ;\
-			$(INSTALL) $(INSTALL_P) slackware/rc.privoxy $(DESTDIR)/etc/rc.d/ ;\
-               $(ECHO) "Installing for Slackware." ;\
-               $(ECHO) "Dont forget to add the rc.privoxy to rc.local if you want it started at every boot" ;\
-		elif [ -f /etc/redhat-release ] && [ -d /etc/rc.d/init.d/ ] && [ -w /etc/rc.d/init.d/ ] ; then \
-               $(ECHO) "Installing init script to /etc/rc.d/init.d/privoxy" ;\
-			$(SED) 's,^PRIVOXY_BIN=.*,PRIVOXY_BIN="/usr/local/sbin/$(PROGRAM)",' privoxy.init |\
-			$(SED) 's,^PRIVOXY_CONF=.*,PRIVOXY_CONF="$(CONF_DEST)/config",' |\
-			$(SED) "s,^PRIVOXY_USER=.*,PRIVOXY_USER=$$USER," > init.tmp ;\
-			$(INSTALL) $(INSTALL_P) init.tmp $(DESTDIR)/etc/rc.d/init.d/privoxy && $(RM) init.tmp;\
-			$(MKDIR) $(DESTDIR)/etc/logrotate.d/ ;\
-			$(ECHO) "Installing logrotate script to $(DESTDIR)/etc/logrotate.d/" ;\
-			$(INSTALL) -m 0644 privoxy.logrotate $(DESTDIR)/etc/logrotate.d/privoxy ;\
-		elif [ -d $(DESTDIR)/etc/init.d ] && [ -w $(DESTDIR)/etc/init.d ] ; then \
-			$(ECHO) "Installing generic init script to $(DESTDIR)/etc/init.d/privoxy" ;\
-			$(ECHO) "Please check that the PATHs are correct, and edit if needed." ;\
-			$(INSTALL) $(INSTALL_P) privoxy-generic.init $(DESTDIR)/etc/init.d/privoxy ;\
-		fi ;\
-	else \
-		$(ECHO) "No init script installed, install it manually if needed" ;\
-	fi
-	$(RM) config.base config.tmp
-	@# mmmmm, good.
+	$(CHMOD) $(RWD_MODE) $(DESTDIR)$(LOG_DEST)/logfile || exit 1 ;
 	@$(ECHO) "$(PROGRAM_V) installation succeeded!"
 	@$(ECHO) "The Privoxy configuration files have been installed in $(DESTDIR)$(CONF_DEST)"