$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)"
 
