+ # Install the DOCS and man page
+ -if [ $(check_doc) = 0 ]; then \
+ DOC=$(DOC_DEST) ;\
+ else \
+ DOC=$(prefix)/doc/privoxy ;\
+ fi;\
+ $(INSTALL) $(INSTALL_D) $$DOC ;\
+ $(INSTALL) $(INSTALL_D) $$DOC/user-manual ;\
+ $(INSTALL) $(INSTALL_D) $$DOC/faq ;\
+ $(INSTALL) $(INSTALL_D) $$DOC/developer-manual ;\
+ $(INSTALL) $(INSTALL_D) $$DOC/man-page ;\
+ $(INSTALL) $(INSTALL_D) $$DOC/images ;\
+ if [ -d "$(DOK_WEB)" ]; then \
+ $(ECHO) Installing FAQ, Manual, and other docs to $$DOC;\
+ $(INSTALL) $(INSTALL_T) $(DOK_WEB)/user-manual/*html $$DOC/user-manual;\
+ $(INSTALL) $(INSTALL_T) $(DOK_WEB)/faq/*html $$DOC/faq;\
+ $(INSTALL) $(INSTALL_T) $(DOK_WEB)/man-page/*html $$DOC/man-page;\
+ $(INSTALL) $(INSTALL_T) $(DOK_WEB)/developer-manual/*html $$DOC/developer-manual;\
+ $(INSTALL) $(INSTALL_T) $(DOK_WEB)/images/*jpg $$DOC/images;\
+ $(INSTALL) $(INSTALL_T) $(DOK_WEB)/p_doc.css $$DOC;\
+ $(INSTALL) $(INSTALL_T) $(DOK_WEB)/privoxy-index.html $$DOC/index.html;\
+ $(INSTALL) $(INSTALL_T) AUTHORS $$DOC;\
+ $(INSTALL) $(INSTALL_T) LICENSE $$DOC;\
+ $(INSTALL) $(INSTALL_T) README $$DOC;\
+ $(INSTALL) $(INSTALL_T) ChangeLog $$DOC;\
+ fi
+ $(ECHO) Installing man page to $(MAN_DEST)/privoxy.1.gz
+ -$(GZIP_PROG) -c privoxy.1 > $(MAN_DEST)/privoxy.1.gz
+
+ # Change the config file default directories according to the configured ones
+ $(ECHO) Rewriting config
+ if [ -f config.base ] ; then \
+ $(CAT) config >config~ ;\
+ $(MV) config.base config ;\
+ fi
+ $(SED) 's+confdir .+confdir $(CONF_DEST)+' config | \
+ $(SED) 's+logdir .+logdir $(LOG_DEST)+' >config.updated
+ $(MV) config config.base
+ $(MV) config.updated config
+
+ # Install the config support files. Test for root install, and abort
+ # if there is no privoxy user, and no other user was enabled during
+ # configure.
+ $(ECHO) Installing templates to $(CONF_DEST)/templates
+ $(INSTALL) $(INSTALL_T) `find templates -type f` $(CONF_DEST)/templates
+ if [ "`id |sed 's/(.*//' |sed 's/.*=//'`" = "0" ] ;then\
+ if [ x$(USER) = x ]; then \
+ if [ "`id privoxy`" ]; then \
+ $(ECHO) "Setting user and group to privoxy";\
+ INSTALL_CONF="$(INSTALL_T) -b -g privoxy -o privoxy" ;\
+ else \
+ $(ECHO) "******************************************************************" ;\
+ $(ECHO) " WARNING! WARNING! installing config files as root!" ;\
+ $(ECHO) " It is strongly recommended to run $(PROGRAM) as non-root user," ;\
+ $(ECHO) " and to install the config files as that user!" ;\
+ $(ECHO) " Please read INSTALL, and create a privoxy user!" ;\
+ $(ECHO) "*******************************************************************" ;\
+ exit 1 ;\
+ fi ;\
+ else \
+ $(ECHO) "Superuser install, installing config files as $(USER):$(GROUP_T)" ;\
+ INSTALL_CONF="$(INSTALL_T) -b -o $(USER) -g $(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_T) -b " ;\
+ fi ;\
+ $(ECHO) Installing config files to $(CONF_DEST);\
+ $(INSTALL) $$INSTALL_CONF config default.action default.filter standard.action $(CONF_DEST) ;\
+ if [ ! -s "$(CONF_DEST)/user.action" ] ; then \
+ $(INSTALL) $$INSTALL_CONF user.action $(CONF_DEST) ;\
+ fi ;\
+ if [ ! -s "$(CONF_DEST)/trust" ] ; then \
+ $(INSTALL) $$INSTALL_CONF trust $(CONF_DEST) ;\
+ fi ;\
+
+ # Set up the logfiles, mode 0640 for privacy reasons
+ $(ECHO) Creating logfiles in $(LOG_DEST)
+ $(TOUCH) $(LOG_DEST)/logfile $(LOG_DEST)/jarfile
+ if [ x$(USER) != x ]; then \
+ $(CHOWN) $(USER):$(GROUP_T) $(LOG_DEST)/logfile $(LOG_DEST)/jarfile || \
+ $(ECHO) "** WARNING ** current install user different from configured user. Logging may fail!!" ;\
+ fi ;\
+ $(CHMOD) 0640 $(LOG_DEST)/logfile $(LOG_DEST)/jarfile
+
+ # Install the init and logrotate scripts. Test for Slackware and Red Hat only.
+ # Install if dest is writable.
+ 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 /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" ;\
+ $(INSTALL) $(INSTALL_P) privoxy.init /etc/rc.d/init.d/privoxy ;\
+ $(MKDIR) /etc/logrotate.d/ ;\
+ $(INSTALL) $(INSTALL_P) privoxy.logrotate /etc/logrotate.d/privoxy ;\
+ elif [ -d /etc/init.d ] && [ -w /etc/init.d ] ; then \
+ $(ECHO) "Installing generic init script to /etc/init.d/privoxy" ;\
+ $(INSTALL) $(INSTALL_P) privoxy-generic.init /etc/init.d/privoxy ;\
+ else \
+ $(ECHO) "No init script installed, install it manually if needed" ;\
+ fi
+ # mmmmm, good.
+ @$(ECHO) "Privoxy installation succeeded!"
+ @$(ECHO) "The Privoxy configuration files have been installed in $(CONF_DEST)"
+
+uninstall: CONF_DEST LOG_DEST PID_DEST check_doc
+ $(ECHO) Starting Privoxy uninstallation
+ # KILL privoxy if running
+ -@ test -f $(PID_DEST)/privoxy.pid && $(ECHO) Stopping $(PROGRAM) &&\
+ $(KILL) `$(CAT) $(PID_DEST)/privoxy.pid`
+ -@ test -f /var/run/privoxy.pid && $(ECHO) Stopping $(PROGRAM) &&\
+ $(KILL) `$(CAT) /var/run/privoxy.pid `
+
+ # Program binary
+ $(ECHO) Removing $(PROGRAM) binary
+ $(RM) $(SBIN_DEST)/$(PROGRAM) $(SBIN_DEST)/$(PROGRAM)~
+
+ # config files and dir and maybe old install backups
+ $(ECHO) Removing $(PROGRAM) config files
+ $(RM) $(CONF_DEST)/config $(CONF_DEST)/default.action $(CONF_DEST)/default.filter \
+ $(CONF_DEST)/trust $(CONF_DEST)/standard.action $(CONF_DEST)/user.action \
+ $(CONF_DEST)/config~ $(CONF_DEST)/default.action~ $(CONF_DEST)/default.filter~ \
+ $(CONF_DEST)/trust~ $(CONF_DEST)/standard.action~ $(CONF_DEST)/user.action~
+ $(RM) -r $(CONF_DEST)/templates
+
+ # man page and docs
+ $(ECHO) Removing $(PROGRAM) docs
+ -$(RM) $(MAN_DEST)/privoxy.1.gz
+ -$(RM) -r $(DOC_DEST) || $(RM) -r $(prefix)/doc/privoxy
+
+ # Log and jarfile and pidfile
+ $(ECHO) Removing $(PROGRAM) logs
+ -$(RM) $(LOG_DEST)/logfile $(PID_DEST)/privoxy.pid $(LOG_DEST)/jarfile
+
+ # Final clean up of unused directories. Special handling of CONF and LOG
+ # destinations.
+ $(ECHO) Removing $(PROGRAM) directories
+ $(RMDIR) $(LOG_DEST) || $(ECHO) "$(LOG_DEST) is not empty, not removed" ;\
+ $(RMDIR) $(CONF_DEST) || $(ECHO) "$(CONF_DEST) is not empty, not removed" ;\
+ if [ ! "$(prefix)" = "/usr/local" ] ;then \
+ $(RMDIR) $(MAN_DEST) || $(ECHO) "$(MAN_DEST) is not empty, not removed" ;\
+ $(RMDIR) $(MAN_DIR) || $(ECHO) "$(MAN_DIR) is not empty, not removed" ;\
+ $(RMDIR) $(SHARE_DEST)/doc || $(ECHO) "$(SHARE_DEST)/doc is not empty, not removed" ;\
+ $(RMDIR) $(SHARE_DEST) || $(ECHO) "$(SHARE_DEST) is not empty, not removed" ;\
+ $(RMDIR) $(SBIN_DEST) || $(ECHO) "$(SBIN_DEST) is not empty, not removed" ;\
+ if test $(LOG_DEST) != /var/log/privoxy ; then \
+ $(RMDIR) $(prefix)/var/log || $(ECHO) "$(prefix)/var/log is not empty, not removed";\
+ fi ;\
+ if test $(PID_DEST) != /var/run ;then \
+ $(RMDIR) $(prefix)/var/run || $(ECHO) "$(prefix)/var/run is not empty, not removed";\
+ fi ;\
+ if test -d $(prefix)/var ; then \
+ $(RMDIR) $(prefix)/var || $(ECHO) "$(prefix)/var is not empty, not removed" ;\
+ fi ;\
+ $(RMDIR) $(prefix) || $(ECHO) "$(prefix) is not empty, not removed" ;\
+ fi
+
+ # init scripts and logrotate
+ $(ECHO) Removing $(PROGRAM) init script
+ if [ -f /etc/slackware-version ] && [ -d /etc/rc.d/ ] && [ -w /etc/rc.d/ ] ; then \
+ $(RM) /etc/rc.d/rc.privoxy ;\
+ elif [ -f /etc/redhat-release ] && [ -d /etc/rc.d/init.d/ ] && [ -w /etc/rc.d/init.d/ ] ; then \
+ $(RM) /etc/rc.d/init.d/privoxy /etc/logrotate.d/privoxy;\
+ elif [ -d /etc/init.d ] && [ -w /etc/init.d ] ; then \
+ $(RM) /etc/init.d/privoxy ;\
+ else \
+ $(ECHO) "Unable to remove privoxy init script, not installed or permission denied" ;\
+ fi
+ $(ECHO) Privoxy uninstalled, bye
+
+coffee:
+ @perl -e 'print pack "C*", (31,139,8,8,153,63,226,60,2,3,99,111,102,102,101,101,0,109,143,205,13,192,32,8,133,\
+ 239,78,241,110,234,1,28,160,171,152,208,53,26,117,247,22,165,73,137,125,9,1,62,126,2,128,169,5,243,143,\
+ 13,139,49,164,65,100,149,152,102,73,141,88,73,178,116,205,100,69,253,36,102,81,49,83,236,19,225,171,131,\
+ 214,172,163,73,4,168,123,115,71,126,247,122,94,128,178,227,95,154,12,86,215,122,197,249,146,187,54,220,125,\
+ 193,51,228,11,1,0,0);'|zcat