patch-GNUmakefile_in 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. $Id$
  2. --- privoxy-3.0.12-stable.orig/GNUmakefile.in 2009-02-28 09:28:14.000000000 +0100
  3. +++ privoxy-3.0.12-stable/GNUmakefile.in 2009-04-17 17:47:06.241568604 +0200
  4. @@ -51,10 +51,6 @@ SNAPVERSION = $(RPM_VERSION)-$(shell d
  5. # "make install" directories and variables
  6. #############################################################################
  7. -#User Group paras
  8. -USER = @USER@
  9. -GROUP = @GROUP@
  10. -
  11. datarootdir = @datarootdir@
  12. prefix = @prefix@
  13. exec_prefix = @exec_prefix@
  14. @@ -97,8 +93,6 @@ INSTALL_T = -m $(RA_MODE)
  15. INSTALL_D = -m $(DIR_MODE) -d
  16. INSTALL_R = -m $(RWD_MODE)
  17. -# install options for superuser install
  18. -#INSTALL_S = -g @GROUP@ -o @USER@
  19. #############################################################################
  20. # Build tools
  21. @@ -939,7 +933,7 @@ pcre/chartables.c: pcre/dftables@EXEEX
  22. pcre/dftables@EXEEXT@ >pcre/chartables.c
  23. pcre/dftables@EXEEXT@: pcre/dftables.c pcre/maketables.c pcre/pcre.h pcre/internal.h pcre/config.h
  24. - $(CC) -o pcre/dftables@EXEEXT@ $(CFLAGS) pcre/dftables.c
  25. + $(HOSTCC) -o pcre/dftables@EXEEXT@ $(HOSTCFLAGS) pcre/dftables.c
  26. # Win32
  27. 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
  28. @@ -1011,13 +1005,6 @@ check_doc:=$(shell if [ ! -d "$(SHARE_DE
  29. $(ECHO) "0";\
  30. fi)
  31. -# If USER is specified but no GROUP, assume there is a GROUP of same name.
  32. -GROUP_T:=$(shell if [ x$(GROUP) = x ] && [ x$(USER) != x ];then \
  33. - $(ECHO) "$(USER)" ;\
  34. - else\
  35. - $(ECHO) "$(GROUP)";\
  36. - fi)
  37. -
  38. install-strip:
  39. $(MAKE) install STRIP=-s
  40. @@ -1028,16 +1015,7 @@ install-strip:
  41. # universally reliable (eg Solaris). Group handling could be better.
  42. # Perhaps the whole user/group validation should be done here, and simplified.
  43. PROGRAM_V = Privoxy $(VERSION) $(CODE_STATUS)
  44. -install: CONF_DEST LOG_DEST PID_DEST check_doc GROUP_T
  45. - @# Quick test for valid USER.
  46. - @if [ -n "$(USER)" ]; then \
  47. - $(ID) $(USER) >/dev/null || exit 1;\
  48. - fi
  49. - @# Test for valid group. FIXME. USER does not have to belong to GROUP
  50. - @# for file ownership purposes.
  51. -# if [ -n "$(GROUP_T)" ] && [ -n "$(USER)" ] && ! $(GROUPS) $(USER) | $(GREP) "\<$(GROUP_T)\>" >/dev/null; then \
  52. -# $(ECHO) Group $(GROUP_T) for User $(USER) is invalid && exit 1 ;\
  53. -# fi
  54. +install: CONF_DEST LOG_DEST PID_DEST check_doc
  55. @$(ECHO) "Creating directories, and preparing $(PROGRAM_V) installation"
  56. $(CHMOD) $(DIR_MODE) $(MKDIR)
  57. @@ -1106,41 +1084,7 @@ install: CONF_DEST LOG_DEST PID_DEST che
  58. $(INSTALL) $(INSTALL_T) $$i $(DESTDIR)$(CONF_DEST)/templates ;\
  59. done
  60. - @# FIXME: group/user validation is overly convoluted.
  61. - @# If superuser install ... we require a minimum of group ownership
  62. - @# of those files the daemon writes to, to be non-root owned.
  63. - @if [ "`$(ID) |sed 's/(.*//' |sed 's/.*=//'`" = "0" ] ;then\
  64. - if [ x$(USER) = x ] || [ $(USER) = root ]; then \
  65. - if [ x$(GROUP) = x ] || [ $(GROUP) = root ]; then \
  66. - if [ "`$(ID) privoxy`" ] && \
  67. - $(GROUPS) privoxy | $(SED) 's/^.*://' |$(GREP) "\<privoxy\>" >/dev/null; then \
  68. - $(ECHO) "Warning: Setting group owner to privoxy";\
  69. - GROUP_T=privoxy ;\
  70. - else \
  71. - $(ECHO) "******************************************************************" ;\
  72. - $(ECHO) " WARNING! WARNING! installing config files as root!" ;\
  73. - $(ECHO) " It is strongly recommended to run $(PROGRAM) as a non-root user," ;\
  74. - $(ECHO) " and to install the config files as that user and/or group!" ;\
  75. - $(ECHO) " Please read INSTALL, and create a privoxy user and group!" ;\
  76. - $(ECHO) "*******************************************************************" ;\
  77. - exit 1 ;\
  78. - fi ;\
  79. - else \
  80. - GROUP_T=$(GROUP) ;\
  81. - fi ;\
  82. - INSTALL_CONF="$(INSTALL_R) -g $$GROUP_T " ;\
  83. - else \
  84. - $(ECHO) "Superuser install, installing config files as $(USER):$(GROUP_T)" ;\
  85. - INSTALL_CONF="$(INSTALL_R) -o $(USER) -g $(GROUP_T)" ;\
  86. - GROUP_T=$(GROUP_T) ;\
  87. - fi ;\
  88. - else \
  89. - if [ ! "`id $(USER)`" = "`id`" ] ;then \
  90. - $(ECHO) "** WARNING ** current install user different from configured user!!" ;\
  91. - $(ECHO) "Edit may fail." ;\
  92. - fi ;\
  93. - INSTALL_CONF="$(INSTALL_R)" ;\
  94. - fi ;\
  95. + INSTALL_CONF="$(INSTALL_R)" ;\
  96. $(ECHO) Installing configuration files to $(DESTDIR)$(CONF_DEST);\
  97. for i in $(CONFIGS); do \
  98. if [ "$$i" = "default.action" ] || [ "$$i" = "default.filter" ] ; then \
  99. @@ -1162,44 +1106,7 @@ install: CONF_DEST LOG_DEST PID_DEST che
  100. [ ! -f $(DESTDIR)$(LOG_DEST)/logfile ] && $(ECHO) Creating logfiles in $(DESTDIR)$(LOG_DEST) || \
  101. $(ECHO) Checking logfiles in $(DESTDIR)$(LOG_DEST) ;\
  102. $(TOUCH) $(DESTDIR)$(LOG_DEST)/logfile || exit 1 ;\
  103. - if [ x$$USER != x ]; then \
  104. - $(CHOWN) $$USER $(DESTDIR)$(LOG_DEST)/logfile || \
  105. - $(ECHO) "** WARNING ** current install user different from configured user. Logging may fail!!" ;\
  106. - fi ;\
  107. - if [ x$$GROUP_T != x ]; then \
  108. - $(CHGRP) $$GROUP_T $(DESTDIR)$(LOG_DEST)/logfile || \
  109. - $(ECHO) "** WARNING ** current install user different from configured user. Logging may fail!!" ;\
  110. - fi ;\
  111. - $(CHMOD) $(RWD_MODE) $(DESTDIR)$(LOG_DEST)/logfile || exit 1 ;\
  112. - if [ "$(prefix)" = "/usr/local" ] || [ "$(prefix)" = "/usr" ]; then \
  113. - if [ -f /etc/slackware-version ] && [ -d /etc/rc.d/ ] && [ -w /etc/rc.d/ ] ; then \
  114. - $(SED) 's+%PROGRAM%+$(PROGRAM)+' slackware/rc.privoxy.orig | \
  115. - $(SED) 's+%SBIN_DEST%+$(SBIN_DEST)+' | \
  116. - $(SED) 's+%CONF_DEST%+$(CONF_DEST)+' | \
  117. - $(SED) 's+%USER%+$(USER)+' | \
  118. - $(SED) 's+%GROUP%+$(GROUP_T)+' >slackware/rc.privoxy ;\
  119. - $(INSTALL) $(INSTALL_P) slackware/rc.privoxy $(DESTDIR)/etc/rc.d/ ;\
  120. - $(ECHO) "Installing for Slackware." ;\
  121. - $(ECHO) "Dont forget to add the rc.privoxy to rc.local if you want it started at every boot" ;\
  122. - elif [ -f /etc/redhat-release ] && [ -d /etc/rc.d/init.d/ ] && [ -w /etc/rc.d/init.d/ ] ; then \
  123. - $(ECHO) "Installing init script to /etc/rc.d/init.d/privoxy" ;\
  124. - $(SED) 's,^PRIVOXY_BIN=.*,PRIVOXY_BIN="/usr/local/sbin/$(PROGRAM)",' privoxy.init |\
  125. - $(SED) 's,^PRIVOXY_CONF=.*,PRIVOXY_CONF="$(CONF_DEST)/config",' |\
  126. - $(SED) "s,^PRIVOXY_USER=.*,PRIVOXY_USER=$$USER," > init.tmp ;\
  127. - $(INSTALL) $(INSTALL_P) init.tmp $(DESTDIR)/etc/rc.d/init.d/privoxy && $(RM) init.tmp;\
  128. - $(MKDIR) $(DESTDIR)/etc/logrotate.d/ ;\
  129. - $(ECHO) "Installing logrotate script to $(DESTDIR)/etc/logrotate.d/" ;\
  130. - $(INSTALL) -m 0644 privoxy.logrotate $(DESTDIR)/etc/logrotate.d/privoxy ;\
  131. - elif [ -d $(DESTDIR)/etc/init.d ] && [ -w $(DESTDIR)/etc/init.d ] ; then \
  132. - $(ECHO) "Installing generic init script to $(DESTDIR)/etc/init.d/privoxy" ;\
  133. - $(ECHO) "Please check that the PATHs are correct, and edit if needed." ;\
  134. - $(INSTALL) $(INSTALL_P) privoxy-generic.init $(DESTDIR)/etc/init.d/privoxy ;\
  135. - fi ;\
  136. - else \
  137. - $(ECHO) "No init script installed, install it manually if needed" ;\
  138. - fi
  139. - $(RM) config.base config.tmp
  140. - @# mmmmm, good.
  141. + $(CHMOD) $(RWD_MODE) $(DESTDIR)$(LOG_DEST)/logfile || exit 1 ;
  142. @$(ECHO) "$(PROGRAM_V) installation succeeded!"
  143. @$(ECHO) "The Privoxy configuration files have been installed in $(DESTDIR)$(CONF_DEST)"