1 # Note: GNUmakefile is built automatically from GNUmakefile.in
3 # $Id: GNUmakefile.in,v 1.254 2017/01/12 14:19:02 fabiankeil Exp $
5 # Written by and Copyright (C) 2001-2017 members of the
6 # Privoxy team. https://www.privoxy.org/
8 # Based on the Internet Junkbuster originally written
9 # by and Copyright (C) 1997 Anonymous Coders and
10 # Junkbusters Corporation. http://www.junkbusters.com
12 # This program is free software; you can redistribute it
13 # and/or modify it under the terms of the GNU General
14 # Public License as published by the Free Software
15 # Foundation; either version 2 of the License, or (at
16 # your option) any later version.
18 # This program is distributed in the hope that it will
19 # be useful, but WITHOUT ANY WARRANTY; without even the
20 # implied warranty of MERCHANTABILITY or FITNESS FOR A
21 # PARTICULAR PURPOSE. See the GNU General Public
22 # License for more details.
24 # The GNU General Public License should be included with
25 # this file. If not, you can view it at
26 # http://www.gnu.org/copyleft/gpl.html
27 # or write to the Free Software Foundation, Inc., 59
28 # Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 #############################################################################
32 # Set make command correctly
33 #############################################################################
36 #############################################################################
37 # Version number (for RPM)
38 #############################################################################
40 VERSION_MAJOR = @VERSION_MAJOR@
41 VERSION_MINOR = @VERSION_MINOR@
42 VERSION_POINT = @VERSION_POINT@
43 CODE_STATUS = @CODE_STATUS@
44 VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_POINT)
45 SNAPVERSION = $(VERSION)-$(shell date "+%Y%m%d")
48 #############################################################################
49 # "make install" directories and variables
50 #############################################################################
56 datarootdir = @datarootdir@
58 exec_prefix = @exec_prefix@
59 CONF_BASE = @sysconfdir@
62 MAN_DEST = $(MAN_DIR)/man1
64 SHARE_DEST = @datadir@
65 DOC_DEST = $(SHARE_DEST)/doc/privoxy
66 VAR_DEST = @localstatedir@
67 LOGS_DEST = $(VAR_DEST)/log/privoxy
68 PIDS_DEST = $(VAR_DEST)/run
70 # if $prefix = /usr/local then the default CONFDEST change from
71 # CONF_DEST = $(CONF_BASE) to CONF_DEST = $(CONF_BASE)/privoxy
72 # by the target rule CONF_DEST
74 # also if the $prefix is /usr/local and there is no
75 # $(SHARE_DEST)/doc, it checks for $prefix/doc and installs there
76 # instead in this situation
78 # finally if $prefix=/usr/local and VAR_DEST=$prefix/var it
79 # changes this to /var for storing the logs and pidfile
81 # used in source dir only, the install goes to $share_dest/doc/privoxy
82 DOK_WEB = doc/webserver/
84 # Install usage should be compatible with install-sh.
88 # Support files, docs, etc.
92 # Files daemon writes to.
94 INSTALL_P = -m $(BIN_MODE)
95 INSTALL_T = -m $(RA_MODE)
96 INSTALL_D = -m $(DIR_MODE) -d
97 INSTALL_R = -m $(RWD_MODE)
99 # install options for superuser install
100 #INSTALL_S = -g @GROUP@ -o @USER@
102 #############################################################################
104 #############################################################################
106 PROGRAM = privoxy@EXEEXT@
111 # id -u is not universal. FIXME: need to set from configure. Breaks on
119 MKDIR = ./mkinstalldirs
133 W3M_DUMP = env -u LANG LC_ALL=C @W3M@ -dump
134 W3M_DUMP_UTF8 = @W3M@ -dump
137 DB = $(JADEBIN) $(JADECAT) -ihtml -t sgml -D.. -d ldp.dsl\#html
139 MAN2HTML = @MAN2HTML@
140 G2H_CMD = groff -mandoc -Thtml
144 DOC_TMP = $(DOC_DIR)/tmp
145 DOC_STATUS = @DOC_STATUS@
146 TIDY = tidy -modify -indent -wrap 78 --tidy-mark no
149 # Program to do LF->CRLF
150 DOSFILTER = $(PERL) -p -e 's/\n/\r\n/'
151 CVSROOT = :pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa
152 #TMPDIR := $(shell mktemp -d /tmp/$(PROGRAM).XXXXXX)
153 # If your SF user name differs from your local one,
154 # change this to "ssh -l sf-username"
156 WWW_ROOT = /home/project-web/ijbswa
157 # SourceForge login name used by the 'sf-shell' target (optional)
158 SOURCE_FORGE_NAME = ''
160 #############################################################################
161 # Setup for make distribution for now.
162 #############################################################################
164 TAR_ARCH = /tmp/privoxy-$(VERSION).tar.gz
165 GEN_DIST_TAR_NAME = privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS).tar
167 #############################################################################
168 # We include these files in our distributions
169 #############################################################################
170 CONFIGS = config trust default.action match-all.action \
171 user.action default.filter user.filter \
172 regression-tests.action
174 # take care that no CVS .cvsignore or other crappy files
176 # and escape every '#' in the find. doh.
177 CONFIG_FILES = $(CONFIGS) \
178 `find templates/ -type f | grep -v "CVS" | grep -v "\.\#" | grep -v ".*~" | grep -v ".cvsignore" | grep -v "TAGS" | sort`
180 DOC_FILES = AUTHORS LICENSE README ChangeLog INSTALL \
181 `find doc/webserver/ -name "*.html" | grep -v "\(webserver\|team\)\/index\.html" | sort` \
182 `find doc/webserver/ -name "*.css" | sort` \
185 #############################################################################
186 # Filenames and libraries
187 #############################################################################
189 C_SRC = actions.c cgi.c cgiedit.c cgisimple.c deanimate.c encode.c \
190 errlog.c filters.c gateway.c jbsockets.c jcc.c \
191 list.c loadcfg.c loaders.c miscutil.c parsers.c ssplit.c \
194 C_OBJS = $(C_SRC:.c=.@OBJEXT@)
195 C_HDRS = $(C_SRC:.c=.h) project.h actionlist.h
197 CLIENT_TAG_SRC = @FEATURE_CLIENT_TAGS_ONLY@client-tags.c
198 CLIENT_TAG_OBJS = @FEATURE_CLIENT_TAGS_ONLY@client-tags.@OBJEXT@
200 FUZZ_SRC = @FUZZ_ONLY@fuzz.c
201 FUZZ_OBJS = @FUZZ_ONLY@fuzz.@OBJEXT@
203 W32_SRC = @WIN_ONLY@w32log.c w32taskbar.c win32.c w32svrapi.c
204 W32_FILES = @WIN_ONLY@w32.res
205 W32_OBJS = @WIN_ONLY@$(W32_SRC:.c=.@OBJEXT@) $(W32_FILES)
206 W32_HDRS = @WIN_ONLY@w32log.h w32taskbar.h win32.h w32res.h w32svrapi.h
207 W32_LIB = @WIN_ONLY@-lwsock32 -lcomctl32
208 W32_INIS = @WIN_ONLY@config.txt trust.txt
210 PCRS_SRC = @STATIC_PCRS_ONLY@pcrs.c
211 PCRS_OBJS = @STATIC_PCRS_ONLY@$(PCRS_SRC:.c=.@OBJEXT@)
212 PCRS_HDRS = @STATIC_PCRS_ONLY@$(PCRS_SRC:.c=.h)
214 PCRE_SRC = @STATIC_PCRE_ONLY@pcre/get.c pcre/maketables.c pcre/study.c pcre/pcre.c
215 PCRE_OBJS = @STATIC_PCRE_ONLY@$(PCRE_SRC:.c=.@OBJEXT@)
216 PCRE_HDRS = @STATIC_PCRE_ONLY@pcre/config.h pcre/chartables.c pcre/internal.h pcre/pcre.h
218 # No REGEX (maybe because dynamically linked pcreposix):
220 @STATIC_PCRE_ONLY@REGEX_SRC = pcre/pcreposix.c
222 REGEX_OBJS = $(REGEX_SRC:.c=.@OBJEXT@)
223 REGEX_HDRS = $(REGEX_SRC:.c=.h)
225 # Dependencies introduced by #include "project.h".
226 PROJECT_H_DEPS = project.h $(REGEX_HDRS) $(PCRS_HDRS) @STATIC_PCRE_ONLY@pcre/pcre.h
228 # Socket libraries for platforms that need them explicitly defined
229 SOCKET_LIB = @SOCKET_LIB@
231 # PThreads library, if needed.
232 PTHREAD_LIB = @PTHREAD_ONLY@@PTHREAD_LIB@
234 SRCS = $(C_SRC) $(CLIENT_TAG_SRC) $(FUZZ_SRC) $(W32_SRC) $(PCRS_SRC) $(PCRE_SRC) $(REGEX_SRC)
235 OBJS = $(C_OBJS) $(CLIENT_TAG_OBJS) $(FUZZ_OBJS) $(W32_OBJS) $(PCRS_OBJS) $(PCRE_OBJS) $(REGEX_OBJS)
236 HDRS = $(C_HDRS) $(W32_HDRS) $(PCRS_HDRS) $(PCRE_OBJS) $(REGEX_HDRS)
237 LIBS = @LIBS@ $(W32_LIB) $(SOCKET_LIB) $(PTHREAD_LIB)
240 #############################################################################
242 #############################################################################
244 # The flag "-mno-win32" can be used by Cygwin to emulate a un?x type build.
245 # The flag "-mwindows -mno-cygwin" will cause Cygwin to use MingW32 for a
247 # The flag "-pthread" is required if using Pthreads under Linux (and
248 # possibly other OSs).
249 SPECIAL_CFLAGS = @SPECIAL_CFLAGS@
251 # Add your flags here
254 CFLAGS = @CFLAGS@ @CPPFLAGS@ $(OTHER_CFLAGS) $(SPECIAL_CFLAGS) -Wall \
255 @STATIC_PCRE_ONLY@ -Ipcre
257 LDFLAGS = @LDFLAGS@ $(DEBUG_CFLAGS) $(SPECIAL_CFLAGS)
260 #############################################################################
263 # There should NOT be any targets above this line.
264 #############################################################################
265 all: $(PROGRAM) default.action
268 #############################################################################
270 #############################################################################
271 .PHONY: all inifiles \
272 win-dist tarball-dist dok webserver clean clobber tags \
273 install CONF_DEST LOG_DEST \
274 PID_DEST check_doc install-strip uninstall GROUP_T
276 #############################################################################
277 # Define this explicitly because Solaris is broken!
278 #############################################################################
280 $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
283 #############################################################################
284 # Strip master copy comments from default.action:
285 #############################################################################
286 default.action: default.action.master
287 $(GREP) -v '^#MASTER#' default.action.master > $@
288 #############################################################################
290 #############################################################################
292 inifiles: $(W32_INIS)
295 $(SED) -e 's!\trustfile trust!trustfile trust.txt!' \
296 -e 's!\logfile logfile!logfile privoxy.log!' \
297 -e 's!#Win32-only: !!' \
300 # LF to CRLF in default.action
301 $(DOSFILTER) <default.action >default.action.txt && mv default.action.txt default.action
302 # LF to CRLF in default.filter
303 $(DOSFILTER) <default.filter >default.filter.txt && mv default.filter.txt default.filter
306 $(DOSFILTER) < $< > $@
308 #############################################################################
310 #############################################################################
312 @if [ -d CVS ]; then \
313 $(ECHO) "***************************************************"; \
315 $(ECHO) "*** WARNING ***"; \
317 $(ECHO) "*** The presence of a CVS subdirectory suggests ***"; \
318 $(ECHO) "*** that you are trying to build a distribution ***"; \
319 $(ECHO) "*** package based on a checked out, not an ***"; \
320 $(ECHO) "*** exported copy of the source tree. Please ***"; \
321 $(ECHO) "*** see \"Releasing a new version\" in the ***"; \
322 $(ECHO) "*** developer manual. ***"; \
324 $(ECHO) "***************************************************"; \
325 $(ECHO) "Type \"yes i am sure\" if you are sure that you"; \
326 $(ECHO) -n "really want to proceed: "; \
328 if [ "$$answer" != "yes i am sure" ]; then exit 1; fi \
332 #############################################################################
333 # create tar.gz from CVS:
334 # This make-target is usually called through 'create-archive'. If you
335 # run 'make create-snapshot' without setting SNAPVERSION, you'll get a
336 # tar.gz with the current date in the name.
337 # The main usage is to run it as follows (Red Hat example):
338 # make SNAPVERSION=1.6x create-snapshot
339 # This creates a tar.gz.
340 #############################################################################
342 @tag=`cvs -d $(CVSROOT) status Makefile | awk ' /Sticky Tag/ { print $$3 } '` 2> /dev/null; \
343 [ x"$$tag" = x"(none)" ] && tag=HEAD; \
344 echo "*** Creating package from $$tag!"; \
345 TMPDIR=$(shell mktemp -d /tmp/$(PROGRAM).XXXXXX); \
346 cd $$TMPDIR ; cvs -Q -d $(CVSROOT) export -r $$tag current || echo "Um... export aborted."; \
347 cd $$TMPDIR/current; \
348 $(TAR) --exclude ".cvsignore" --exclude "CVS" \
349 -czf /tmp/$(PROGRAM)-$(VERSION).tar.gz .; \
351 @echo "Resulting file is /tmp/$(PROGRAM)-$(VERSION).tar.gz"
354 #############################################################################
355 # looks at the version of Makefile and exports a corresponding source-tree
356 # example: if the Makefile has the sticky tag v_2_9_13, you'll get
357 # privoxy-*-2.4.13.tar.gz.
358 #############################################################################
360 make SNAPVERSION=$(SNAPVERSION) create-snapshot
362 #############################################################################
363 # generic distribution
364 #############################################################################
367 @$(ECHO) "You have run autoconf && autoheader && ./configure right?"
370 $(STRIP_PROG) $(PROGRAM)
371 $(LN) -s `pwd` ../privoxy-$(VERSION)-$(CODE_STATUS)
373 (cd .. && $(TAR) --exclude "PACKAGERS" -cvhf $(GEN_DIST_TAR_NAME) privoxy-$(VERSION)-$(CODE_STATUS)/$(PROGRAM))
375 for foo in $(CONFIG_FILES); do \
376 (cd .. && $(TAR) --exclude "PACKAGERS" -uvhf $(GEN_DIST_TAR_NAME) privoxy-$(VERSION)-$(CODE_STATUS)/$$foo;) \
379 for foo in $(DOC_FILES); do \
380 (cd .. && $(TAR) --exclude "PACKAGERS" -uvhf $(GEN_DIST_TAR_NAME) privoxy-$(VERSION)-$(CODE_STATUS)/$$foo;) \
383 (cd .. && $(TAR) -uvhf $(GEN_DIST_TAR_NAME) privoxy-$(VERSION)-$(CODE_STATUS)/tools)
384 # and zip the archive
385 $(RM) ../privoxy-$(VERSION)-$(CODE_STATUS)
386 $(GZIP_PROG) ../$(GEN_DIST_TAR_NAME)
387 @$(ECHO) Distribution with binary created.
389 # anonymously ncftps the package to sourceforge
391 ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming ../$(GEN_DIST_TAR_NAME).gz
392 @$(ECHO) -------------------------------------------------------
394 @$(ECHO) https://sourceforge.net/project/admin/editpackages.php?group_id=11118
395 @$(ECHO) ... and release the files.
396 @$(ECHO) -------------------------------------------------------
400 $(RM) ../$(GEN_DIST_TAR_NAME)*
402 #############################################################################
403 # Tarball distribution: No CVS dirs, dotfiles, debian build dir,
404 # (FIXME:) only parts of the static / generated docs mix in doc/webserver
405 #############################################################################
407 tarball-dist: dist-check clean clobber
408 $(LN) -s `pwd` ../privoxy-$(VERSION)-$(CODE_STATUS)
410 for i in `find . -type f -a -not \( -path "*/CVS*" -o -name ".*" \
411 -o -path "*/debian/*" -o -path "*/actions/*" -o -name "*.php" -o \
412 -name "PACKAGERS" -o -path "*.git/*" \) | sort`; do \
413 files="$$files privoxy-$(VERSION)-$(CODE_STATUS)/$$i"; \
415 cd .. && $(TAR) -cvhf privoxy-$(VERSION)-$(CODE_STATUS)-src.tar $$files ; \
417 # and zip the archive
418 $(RM) ../privoxy-$(VERSION)-$(CODE_STATUS)
419 $(GZIP_PROG) ../privoxy-$(VERSION)-$(CODE_STATUS)-src.tar
420 @$(ECHO) Tarball distribution created.
422 # anonymously ncftps the tarball to sourceforge
424 ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming ../privoxy-$(VERSION)-$(CODE_STATUS)-src.tar.gz
425 @$(ECHO) -------------------------------------------------------
427 @$(ECHO) https://sourceforge.net/project/admin/editpackages.php?group_id=11118
428 @$(ECHO) ... and release the files.
429 @$(ECHO) -------------------------------------------------------
432 $(RM) ../privoxy-$(VERSION)-$(CODE_STATUS)-src.tar.gz
434 #############################################################################
438 # converts doc/source/*.sgml into html and man pages
440 #############################################################################
444 $(RM) doc/webserver/developer-manual/*.html
445 $(RM) -r doc/source/developer-manual
446 mkdir -p doc/source/developer-manual
447 cd doc/source/developer-manual && $(DB) ../developer-manual.sgml && cd .. && cp developer-manual/*.html ../webserver/developer-manual/
451 $(RM) doc/webserver/user-manual/*.html
452 $(RM) -r doc/source/user-manual/
453 mkdir -p doc/source/user-manual
454 cd doc/source/user-manual && $(DB) -iuser-man ../user-manual.sgml && cd .. && cp user-manual/*.html ../webserver/user-manual/
455 # FIXME: temp fix so same stylesheet gets in more than one place so it works
456 # for all doc set-ups, including the 'user manual' config option in local
457 # system where it MUST be in same directory as html.
458 $(PERL) -pi.bak -e 's/<\/head/\n<LINK REL=\"STYLESHEET\" TYPE=\"text\/css\" HREF=\"p_doc.css\">\n<\/head/i' doc/webserver/user-manual/*html && \
459 rm doc/webserver/user-manual/*html.bak
463 $(RM) doc/webserver/faq/*.html
464 $(RM) -r doc/source/faq
465 mkdir -p doc/source/faq
466 cd doc/source/faq && $(DB) ../faq.sgml && cd .. && cp faq/*.html ../webserver/faq/
468 # man page, one variation. Try to use the next target, just 'make man'.
470 $(RM) doc/man/* doc/webserver/man-page/*.html
471 echo MAN2HTML is $(MAN2HTML)
472 @if [ $(MAN2HTML) != "false" ]; then \
473 $(ECHO) "<html><head><title>Privoxy Man page</title><link rel=\"stylesheet\" type=\"text/css\" href=\"../p_web.css\"></head><body><H2>NAME</H2>" > doc/webserver/man-page/privoxy-man-page.html; \
474 man ./$(MAN_PAGE) | $(MAN2HTML) -bare >> doc/webserver/man-page/privoxy-man-page.html; \
475 $(ECHO) "</body></html>" >> doc/webserver/man-page/privoxy-man-page.html; \
477 $(MAKE) groff2html; \
480 # Build man page from sgml. This requires the SGMLSpm perl module.
481 # See CPAN, or your favorite perl repository. This is the preferred
482 # target for man page generation!
484 mkdir -p doc/source/temp && cd doc/source/temp && $(RM) * ;\
485 nsgmls ../privoxy-man-page.sgml | sgmlspl ../../../utils/docbook2man/docbook2man-spec.pl &&\
486 perl -pi.bak -e 's/ <URL:.*>//; s/\[ /\[/g' $(MAN_PAGE) ;\
487 perl -pi.bak -e "s/\[ /\[/g;s/á/\\\\['a]/g;s/é/\\\\['e]/g" $(MAN_PAGE); \
488 perl -pi.bak -e "s/ö/\\\\[:o]/g" $(MAN_PAGE); \
489 perl -pi.bak -e 's/([ {])-([a-z])/$$1\\-$$2/g' $(MAN_PAGE); \
490 perl -pi.bak -e 's/ --([a-z])/ \\-\\-$$1/g' $(MAN_PAGE); \
491 perl -pi.bak -e 's/\\fB--/\\fB\\-\\-/g' $(MAN_PAGE); \
492 $(DB) ../privoxy-man-page.sgml && $(MV) -f $(MAN_PAGE) ../../../$(MAN_PAGE)
494 # For those with man2html ala RH7s.
496 mkdir -p doc/webserver/man-page
497 @if [ $(MAN2HTML) != "false" ]; then \
498 $(MAN2HTML) $(MAN_PAGE) |grep -v "^Content-type" > tmp.html; \
499 $(PERL) -pi.bak -e 's/<A .*Contents<\/A>//; s/<A .*man2html<\/A>/man2html/' tmp.html; \
500 $(PERL) -pi.bak -e 's/(<\/HEAD>)/<LINK REL=\"STYLESHEET\" TYPE=\"text\/css\" HREF=\"..\/p_doc.css\"><\/HEAD>/' tmp.html; \
501 $(PERL) -pi.bak -e 's/(<A.*),(">)/$$1$$2/g' tmp.html; \
502 $(PERL) -pi.bak -e 's,\.">,">,g' tmp.html; \
503 $(PERL) -pi.bak -e "s/\['a\]/\á/g;s/\['e\]/\é/g" tmp.html; \
504 $(SED) -e 's/
\a//g' tmp.html > doc/webserver/man-page/privoxy-man-page.html && $(RM) tmp.*; \
506 $(MAKE) groff2html; \
509 # Otherwise we get plain groff conversion.
511 $(G2H_CMD) ./$(MAN_PAGE) | $(SED) -e 's@</head>@<link REL="STYLESHEET" TYPE="text/css" HREF="../p_doc.css"></head>@' > doc/webserver/man-page/privoxy-man-page.html
514 # readme page and INSTALL file
515 dok-readme: dok-release
516 cd doc/source && $(DB)-notoc -V nochunks readme.sgml > tmp.html &&\
517 $(W3M_DUMP) tmp.html > ../../README ;\
518 $(DB)-notoc -V nochunks install.sgml > tmp.html &&\
519 $(W3M_DUMP) tmp.html > ../../INSTALL ;\
522 # index.sgml is used to create both the Home Page, and a local index
523 # for documentation, etc.
525 # index.html for webserver:
527 cd doc/source/webserver && $(DB)-notoc -ip-homepage -V nochunks index.sgml > ../../webserver/index.html
528 $(PERL) -pi.bak -e 's/..\/p_doc.css/p_doc.css/;\
529 s/<\/HEAD/\n<meta name=\"description\" content=\"Privoxy helps users to protect their privacy.\"><\/HEAD/;\
532 s@(<SUB)@<p style="text-align: center">\1@; s@(</SUB)@\1></p@;\
533 s@ChameleonJohn@<br><a href="http://www.chameleonjohn.com/"><img align="middle"\
534 src="images/sponsors/chameleonjohn.png" alt="ChameleonJohn Coupons"></a><br>\n\
535 <a title="Privoxy FAQ: How to become a sponsor" href="/faq/general.html#SPONSOR">Sponsor FAQ</a>@' \
536 doc/webserver/index.html && $(RM) doc/webserver/*.bak
538 # privoxy-index.html for local documentation:
540 cd doc/source/webserver && $(DB)-notoc -ip-index -V nochunks index.sgml > ../../webserver/privoxy-index.html
541 $(PERL) -pi.bak -e 's/..\/p_doc.css/p_doc.css/;\
542 s/<\/HEAD/\n<meta name=\"description\" content=\"Privoxy helps users to protect their privacy.\"><\/HEAD/;\
545 doc/webserver/privoxy-index.html && $(RM) doc/webserver/*.bak
547 # Main documentation target.
548 dok: dok-release dok-devel dok-user dok-faq dok-readme dok-webserver dok-authors dok-index
549 @$(ECHO) Documentation created.
553 cd doc/source && $(DB) -V nochunks authors.sgml > tmp.html && $(W3M_DUMP_UTF8) \
554 tmp.html > ../../AUTHORS && $(RM) tmp.html
556 # Set doc entities for VERSION and CODE_STATUS in sgml docs. Toggle content
557 # exceptions accordingly. This needs to go before any doc building (doh).
559 @$(ECHO) Setting doc version and status to $(VERSION), $(CODE_STATUS)
560 @$(PERL) -pi.bak -e 's/<!entity +p-version.*>/<!entity p-version "$(VERSION)">/;\
561 s/<!entity +p-status.*>/<!entity p-status "$(CODE_STATUS)">/' \
562 doc/source/*sgml doc/source/*/*sgml
563 $(RM) -r doc/source/*bak doc/source/*/*bak
564 @if [ $(CODE_STATUS) = "stable" ]; then \
565 $(ECHO) Setting docs to stable $(VERSION); \
566 $(PERL) -pi.bak -e 's/<!entity +% +p-stable.*>/<!entity % p-stable "INCLUDE">/;\
567 s/<!entity +% +p-not-stable.*>/<!entity % p-not-stable "IGNORE">/' \
568 doc/source/*sgml doc/source/*/*sgml; \
570 $(ECHO) Setting docs to not stable $(VERSION); \
571 $(PERL) -pi.bak -e 's/<!entity +% +p-stable.*>/<!entity % p-stable "IGNORE">/; \
572 s/<!entity +% +p-not-stable.*>/<!entity % p-not-stable "INCLUDE">/' \
573 doc/source/*sgml doc/source/*/*sgml; \
575 $(RM) -r doc/source/*bak doc/source/*/*bak;
577 # The main Privoxy config file, generated from sgml sources.
578 # NOTE: This will require some hand editing.
579 config-file: dok-release generate-config-file
581 $(RM) config.bak config.html
582 @$(ECHO) "****************************************************"
583 @$(ECHO) "The config file has been optimistically updated"
584 @$(ECHO) "Now -- you may need to hand edit the results!"
585 @$(ECHO) "In particular, check the Debug levels, the"
586 @$(ECHO) "permit-access, forward & socks examples and the"
587 @$(ECHO) "various user-manual examples, which all"
588 @$(ECHO) "might have gotten hammered."
589 @$(ECHO) "****************************************************"
591 generate-config-file:
592 cd doc/source && $(DB)-notoc -iconfig-file -V nochunks config.sgml > ../../config.html
593 $(W3M_DUMP) -cols 67 config.html > config
594 $(PERL) -i.bak utils/prepare-configfile.pl config
596 #############################################################################
600 # moves documentation to webserver
602 #############################################################################
604 @sf_name=$(SOURCE_FORGE_NAME); \
605 [ -n "$${sf_name}" ] || read -p "Enter SourceForge username: " sf_name || exit 1; \
606 echo "Opening shell for $${sf_name} ..."; \
607 ssh -t $${sf_name},ijbswa@shell.sourceforge.net create
609 webserver: clean-editor-files
610 @$(ECHO) -------------------------------------------------------
611 @$(ECHO) You will need to "create" a SF shell first:
612 @$(ECHO) ssh -t SF-USER-ID,ijbswa@shell.sourceforge.net create
613 @$(ECHO) Please make sure your documentation files are up to date.
614 @$(ECHO) Note that this command updates the home page and copys
615 @$(ECHO) all stuff to the webserver, it will not remove obsolete documents.
616 @$(ECHO) Note that a botched upload can result in the documentation
617 @$(ECHO) on the website becoming unreachable! Also the CSS files
618 @$(ECHO) currently seem to end up at the wrong place.
619 @$(ECHO) -------------------------------------------------------
621 @$(ECHO) Replacing the user-manual symlink
622 @$(SSH) shell.sourceforge.net "cd $(WWW_ROOT)/htdocs && rm user-manual \
623 && mkdir -p $(VERSION)/user-manual && ln -s $(VERSION)/user-manual user-manual"
625 @$(ECHO) Uploading html
627 upload=`find . -type f -a -not \( -path "*/CVS*" -o -path "*/results*" \)`; \
628 $(TAR) cf - $$upload | $(SSH) shell.sourceforge.net 'cd $(WWW_ROOT)/htdocs/; tar xvm 2>&1 | grep -v timestamp'
630 @$(ECHO) Fixing permissions
631 @$(SSH) shell.sourceforge.net 'chmod -R 775 $(WWW_ROOT)/htdocs 2>/dev/null; true'
632 @$(SSH) shell.sourceforge.net 'find $(WWW_ROOT)/htdocs/ -type f | xargs chmod 664 2>/dev/null; true'
635 @$(ECHO) Updating the actions on the webserver ...
636 @$(RSYNC) doc/webserver/actions/*.php shell.sourceforge.net:$(WWW_ROOT)/htdocs/actions
637 @$(ECHO) Enforcing reasonable permissions ...
638 @$(SSH) shell.sourceforge.net 'find $(WWW_ROOT)/htdocs/actions/ -type f | xargs chmod 664 2>/dev/null'
641 @$(ECHO) Updating the FAQ on the webserver ...
642 @$(RSYNC) doc/webserver/faq/*.html shell.sourceforge.net:$(WWW_ROOT)/htdocs/faq
643 @$(ECHO) Enforcing reasonable permissions ...
644 @$(SSH) shell.sourceforge.net 'find $(WWW_ROOT)/htdocs/faq/ -type f | xargs chmod 664 2>/dev/null'
647 @$(ECHO) Updating the user manual on the webserver (do not use in case of version changes) ...
648 @$(RSYNC) doc/webserver/user-manual/*.html shell.sourceforge.net:$(WWW_ROOT)/htdocs/user-manual/
649 @$(ECHO) Enforcing reasonable permissions ...
650 @$(SSH) shell.sourceforge.net 'find $(WWW_ROOT)/htdocs/user-manual/ -type f | xargs chmod 664 2>/dev/null'
652 #############################################################################
654 # Try to clean up the generated HTML files.
656 # The files are such a mess that some of them require two tidy runs in a
657 # row as the first one aborts prematurely. The vanilla tidy output renders
658 # poorly because it contains a bit too much whitespace, so we additionally
659 # run the files through perl to fix this again.
661 #############################################################################
663 for html_file in `find doc/webserver -name "*.html"`; do \
664 $(TIDY) $$html_file || $(TIDY) $$html_file; \
665 $(PERL) -i'' -e 's@^\s*<br>\s*$$@@; s@ +$$@@;' -n -p $$html_file; \
669 #############################################################################
670 # Source file dependencies
671 #############################################################################
673 actions.@OBJEXT@: actions.c actions.h config.h $(PROJECT_H_DEPS) errlog.h filters.h jcc.h list.h loaders.h miscutil.h actionlist.h ssplit.h
674 cgi.@OBJEXT@: cgi.c cgi.h config.h $(PROJECT_H_DEPS) cgiedit.h cgisimple.h jbsockets.h list.h pcrs.h encode.h ssplit.h jcc.h filters.h actions.h errlog.h miscutil.h
675 cgiedit.@OBJEXT@: cgiedit.c cgiedit.h config.h $(PROJECT_H_DEPS) cgi.h list.h pcrs.h encode.h ssplit.h jcc.h filters.h actionlist.h actions.h errlog.h miscutil.h
676 cgisimple.@OBJEXT@: cgisimple.c cgisimple.h config.h $(PROJECT_H_DEPS) cgi.h list.h pcrs.h encode.h ssplit.h jcc.h filters.h actions.h errlog.h miscutil.h urlmatch.h
677 deanimate.@OBJEXT@: deanimate.c deanimate.h config.h $(PROJECT_H_DEPS)
678 encode.@OBJEXT@: encode.c encode.h config.h
679 errlog.@OBJEXT@: errlog.c errlog.h config.h $(PROJECT_H_DEPS) @WIN_ONLY@w32log.h
680 filters.@OBJEXT@: filters.c filters.h config.h $(PROJECT_H_DEPS) errlog.h encode.h gateway.h jbsockets.h jcc.h loadcfg.h parsers.h ssplit.h cgi.h deanimate.h urlmatch.h @WIN_ONLY@win32.h
681 gateway.@OBJEXT@: gateway.c gateway.h config.h $(PROJECT_H_DEPS) errlog.h jbsockets.h jcc.h loadcfg.h
682 jbsockets.@OBJEXT@: jbsockets.c jbsockets.h config.h $(PROJECT_H_DEPS) filters.h
683 jcc.@OBJEXT@: jcc.c jcc.h config.h $(PROJECT_H_DEPS) errlog.h filters.h gateway.h jbsockets.h loadcfg.h loaders.h miscutil.h parsers.h @WIN_ONLY@w32log.h win32.h w32svrapi.h cgi.h
684 list.@OBJEXT@: list.c list.h config.h $(PROJECT_H_DEPS) list.h miscutil.h
685 loadcfg.@OBJEXT@: loadcfg.c loadcfg.h config.h $(PROJECT_H_DEPS) errlog.h filters.h gateway.h jbsockets.h jcc.h loaders.h miscutil.h parsers.h @WIN_ONLY@w32log.h win32.h
686 loaders.@OBJEXT@: loaders.c loaders.h config.h $(PROJECT_H_DEPS) errlog.h encode.h filters.h gateway.h jcc.h loadcfg.h miscutil.h parsers.h ssplit.h
687 miscutil.@OBJEXT@: miscutil.c miscutil.h config.h
688 parsers.@OBJEXT@: parsers.c parsers.h config.h $(PROJECT_H_DEPS) errlog.h filters.h jbsockets.h jcc.h loadcfg.h loaders.h miscutil.h ssplit.h
689 ssplit.@OBJEXT@: ssplit.c ssplit.h config.h miscutil.h
690 urlmatch.@OBJEXT@: urlmatch.c urlmatch.h config.h $(PROJECT_H_DEPS) errlog.h miscutil.h ssplit.h
693 gnu_regex.@OBJEXT@: gnu_regex.c gnu_regex.h config.h
696 pcrs.@OBJEXT@: pcrs.c pcrs.h config.h @STATIC_PCRE_ONLY@pcre/pcre.h
699 pcre/get.@OBJEXT@: pcre/get.c pcre/config.h pcre/internal.h pcre/pcre.h
700 pcre/maketables.@OBJEXT@: pcre/maketables.c pcre/config.h pcre/internal.h pcre/pcre.h
701 pcre/pcre.@OBJEXT@: pcre/pcre.c pcre/config.h pcre/internal.h pcre/pcre.h pcre/chartables.c
702 pcre/pcreposix.@OBJEXT@: pcre/pcreposix.c pcre/config.h pcre/internal.h pcre/pcre.h pcre/pcreposix.h
703 pcre/study.@OBJEXT@: pcre/study.c pcre/config.h pcre/internal.h pcre/pcre.h
705 # An auxiliary program makes the PCRE default character table source
707 pcre/chartables.c: pcre/dftables@EXEEXT@
708 pcre/dftables@EXEEXT@ >pcre/chartables.c
710 pcre/dftables@EXEEXT@: pcre/dftables.c pcre/maketables.c pcre/pcre.h pcre/internal.h pcre/config.h
711 $(CC) -o pcre/dftables@EXEEXT@ $(CFLAGS) pcre/dftables.c
714 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
715 w32taskbar.@OBJEXT@: w32taskbar.c config.h w32log.h w32taskbar.h
716 win32.@OBJEXT@: win32.c config.h jcc.h loadcfg.h pcre/pcre.h pcre/pcreposix.h pcrs.h project.h w32log.h win32.h w32svrapi.h
718 w32.res: w32.rc w32res.h icons/radar-01.ico icons/radar-02.ico icons/radar-03.ico icons/radar-04.ico icons/radar-05.ico icons/radar-06.ico icons/radar-07.ico icons/radar-08.ico icons/idle.ico icons/privoxy.ico config.h
719 windres -D__MINGW32__=0.2 -O coff -i $< -o $@
722 @AMIGAOS_ONLY@OBJS += amiga.o
723 @AMIGAOS_ONLY@ifeq ($(shell $(CC) -dumpmachine), m68k-amigaos)
724 @AMIGAOS_ONLY@CFLAGS += -D__AMIGAVERSION__=\"$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_POINT)\" -D__AMIGADATE__=\"`date +%d.%m.%Y`\" -W -m68020 -noixemul -fbaserel -msmall-code
725 @AMIGAOS_ONLY@LDFLAGS += -m68020 -noixemul -fbaserel
726 @AMIGAOS_ONLY@LIBS = -lm /gg/lib/libb/libm020/libnix/swapstack.o
728 @AMIGAOS_ONLY@CFLAGS += -D__AMIGAVERSION__=\"$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_POINT)\" -D__AMIGADATE__=\"`date +%d.%m.%Y`\" -Wextra -D__USE_INLINE__ -D__NO_INTUITION_RJ_MACROS
730 @AMIGAOS_ONLY@amiga.o: amiga.c amiga.h config.h
733 $(PROGRAM): $(OBJS) $(W32_FILES)
734 $(LD) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
737 $(RM) a.out $(OBJS) $(W32_FILES) $(W32_INIS) $(PROGRAM) default.action \
738 config.base config.tmp \
739 `find . \( -name TAGS -o -name tags \) -a -not -path "./.git/*"` \
740 `find . -name "*.orig" -a -not -name rc.privoxy.orig -a -not -path "./.git/*"`
743 $(RM) `find . -name "*~"`
744 $(RM) `find . -name "#*#"` # Emacs backup files
745 $(RM) `find . -name ".\#*"`
747 clobber: clean-editor-files
748 $(RM) GNUmakefile configure config.h.in config.h config.cache config.status config.log logfile \
749 privoxy.log core *.tar.gz *.tar privoxy-cl.spec doc/source/ldp.dsl config.new
750 $(RM) -r autom4te.cache
753 # FIXME: What is all this?
755 $(RM) cscope.* *.pdb *.lib *.exp
759 tags: $(SRCS) $(HDRS)
760 etags $(SRCS) $(HDRS)
762 CONF_DEST:=$(shell if [ "$(prefix)" = "/usr/local" ] && [ "$(CONF_BASE)" = "$(prefix)/etc" ];then \
763 $(ECHO) "$(CONF_BASE)/privoxy";\
765 $(ECHO) "$(CONF_BASE)";\
768 LOG_DEST:=$(shell if [ "$(prefix)" = "/usr/local" ] && [ "$(LOGS_DEST)" = "$(prefix)/var/log/privoxy" ];then \
769 $(ECHO) "/var/log/privoxy" ;\
771 $(ECHO) "$(LOGS_DEST)";\
774 PID_DEST:=$(shell if [ "$(prefix)" = "/usr/local" ] && [ "$(PIDS_DEST)" = "$(prefix)/var/run" ];then \
775 $(ECHO) "/var/run" ;\
777 $(ECHO) "$(PIDS_DEST)";\
780 check_doc:=$(shell if [ ! -d "$(SHARE_DEST)/doc" ] && [ "$(prefix)" = "/usr/local" ] && [ -d "$(prefix)/doc" ];then \
786 # If USER is specified but no GROUP, assume there is a GROUP of same name.
787 GROUP_T:=$(shell if [ x$(GROUP) = x ] && [ x$(USER) != x ];then \
794 $(MAKE) install STRIP=-s
796 # FIXME: Test USER and GROUP on Slack to make sure this works as
799 # FIXME: id handling needs help, probably via configure, since 'id -u' is not
800 # universally reliable (eg Solaris). Group handling could be better.
801 # Perhaps the whole user/group validation should be done here, and simplified.
802 PROGRAM_V = Privoxy $(VERSION) $(CODE_STATUS)
803 install: CONF_DEST LOG_DEST PID_DEST check_doc GROUP_T
804 @# Quick test for valid USER.
805 @if [ -n "$(USER)" ]; then \
806 $(ID) $(USER) >/dev/null || exit 1;\
808 @# Test for valid group. FIXME. USER does not have to belong to GROUP
809 @# for file ownership purposes.
810 # if [ -n "$(GROUP_T)" ] && [ -n "$(USER)" ] && ! $(GROUPS) $(USER) | $(GREP) "\<$(GROUP_T)\>" >/dev/null; then \
811 # $(ECHO) Group $(GROUP_T) for User $(USER) is invalid && exit 1 ;\
814 @$(ECHO) "Creating directories, and preparing $(PROGRAM_V) installation"
815 $(CHMOD) $(DIR_MODE) $(MKDIR)
816 @$(MKDIR) $(DESTDIR)$(SBIN_DEST) $(DESTDIR)$(prefix) $(DESTDIR)$(CONF_DEST) \
817 $(DESTDIR)$(CONF_DEST)/templates $(DESTDIR)$(SHARE_DEST) \
818 $(DESTDIR)$(LOG_DEST) $(DESTDIR)$(PID_DEST)
819 @# Install the executable binary, strip if invoked as install-strip
820 @test -n "$(STRIP)" &&\
821 $(ECHO) Installing $(PROGRAM) stripped executable to $(SBIN_DEST) ||\
822 $(ECHO) Installing $(PROGRAM) executable to $(DESTDIR)$(SBIN_DEST)
823 $(INSTALL) $(INSTALL_P) $(STRIP) $(PROGRAM) $(DESTDIR)$(SBIN_DEST)
825 @# Install the DOCS and man page. install-sh only does one file at a time.
826 @# FIXME: only handles jpegs.
827 -@if [ $(check_doc) = 0 ]; then \
830 DOC=$(prefix)/doc/privoxy ;\
832 $(MKDIR) $(DESTDIR)$$DOC $(DESTDIR)$$DOC/user-manual $(DESTDIR)$$DOC/faq $(DESTDIR)$$DOC/developer-manual \
833 $(DESTDIR)$$DOC/man-page $(DESTDIR)$$DOC/images $(DESTDIR)$(MAN_DEST) ;\
834 if [ -d "$(DOK_WEB)" ]; then \
835 $(ECHO) Installing FAQ, Manual, and other docs to $(DESTDIR)$$DOC;\
836 for i in user-manual developer-manual faq; do \
837 for ii in $(DOK_WEB)/$$i/*html; do \
838 $(INSTALL) $(INSTALL_T) $$ii $(DESTDIR)$$DOC/$$i;\
841 for i in $(DOK_WEB)/user-manual/*jpg; do \
842 $(INSTALL) $(INSTALL_T) $$i $(DESTDIR)$$DOC/user-manual;\
844 $(INSTALL) $(INSTALL_T) $(DOK_WEB)/man-page/*html $(DESTDIR)$$DOC/man-page;\
845 $(INSTALL) $(INSTALL_T) $(DOK_WEB)/privoxy-index.html $(DESTDIR)$$DOC/index.html;\
846 $(INSTALL) $(INSTALL_T) AUTHORS $(DESTDIR)$$DOC;\
847 $(INSTALL) $(INSTALL_T) LICENSE $(DESTDIR)$$DOC;\
848 $(INSTALL) $(INSTALL_T) README $(DESTDIR)$$DOC;\
849 $(INSTALL) $(INSTALL_T) ChangeLog $(DESTDIR)$$DOC;\
850 $(INSTALL) $(INSTALL_T) $(DOK_WEB)/p_doc.css $(DESTDIR)$$DOC;\
851 $(INSTALL) $(INSTALL_T) $(DOK_WEB)/p_doc.css $(DESTDIR)$$DOC/user-manual;\
853 @# Not all platforms support gzipped man pages.
854 @$(ECHO) Installing man page to $(DESTDIR)$(MAN_DEST)/$(MAN_PAGE)
855 -$(INSTALL) $(INSTALL_T) $(MAN_PAGE) $(DESTDIR)$(MAN_DEST)/$(MAN_PAGE)
857 @# Change the config file default directories according to the configured ones
858 @$(ECHO) Rewriting config for this installation
859 @if [ -f config.base ] ; then \
860 $(CAT) config >config~ ;\
861 $(MV) config.base config ;\
863 $(SED) 's+^confdir \.+confdir $(CONF_DEST)+' config | \
864 $(SED) 's+^logdir \.+logdir $(LOG_DEST)+' >config.tmp
865 -@if [ $(check_doc) = 0 ]; then \
866 $(SED) 's+^#\?user-manual .*+user-manual $(DOC_DEST)/user-manual/+' config.tmp >config.updated ;\
868 $(SED) 's+^#\?user-manual .*+user-manual $(prefix)/doc/privoxy/user-manual/+' config.tmp >config.updated ;\
870 $(MV) config config.base
871 $(MV) config.updated config
873 @# Install the config support files. Test for root install, and abort
874 @# if there is no privoxy user, and no other user was enabled during
875 @# configure. Later, install init script if appropriate.
876 @$(ECHO) Installing templates to $(DESTDIR)$(CONF_DEST)/templates
877 @for i in `find templates -type f`; do \
878 $(INSTALL) $(INSTALL_T) $$i $(DESTDIR)$(CONF_DEST)/templates ;\
881 @# FIXME: group/user validation is overly convoluted.
882 @# If superuser install ... we require a minimum of group ownership
883 @# of those files the daemon writes to, to be non-root owned.
884 @if [ "`$(ID) |sed 's/(.*//' |sed 's/.*=//'`" = "0" ] ;then\
885 if [ x$(USER) = x ] || [ $(USER) = root ]; then \
886 if [ x$(GROUP) = x ] || [ $(GROUP) = root ]; then \
887 if [ "`$(ID) privoxy`" ] && \
888 $(GROUPS) privoxy | $(SED) 's/^.*://' |$(GREP) "\<privoxy\>" >/dev/null; then \
889 $(ECHO) "Warning: Setting group owner to privoxy";\
892 $(ECHO) "******************************************************************" ;\
893 $(ECHO) " WARNING! WARNING! installing config files as root!" ;\
894 $(ECHO) " It is strongly recommended to run $(PROGRAM) as a non-root user," ;\
895 $(ECHO) " and to install the config files as that user and/or group!" ;\
896 $(ECHO) " Please read INSTALL, and create a privoxy user and group!" ;\
897 $(ECHO) "*******************************************************************" ;\
903 INSTALL_CONF="$(INSTALL_R) -g $$GROUP_T " ;\
905 $(ECHO) "Superuser install, installing config files as $(USER):$(GROUP_T)" ;\
906 INSTALL_CONF="$(INSTALL_R) -o $(USER) -g $(GROUP_T)" ;\
907 GROUP_T=$(GROUP_T) ;\
910 if [ ! "`id $(USER)`" = "`id`" ] ;then \
911 $(ECHO) "** WARNING ** current install user different from configured user!!" ;\
912 $(ECHO) "Edit may fail." ;\
914 INSTALL_CONF="$(INSTALL_R)" ;\
916 $(ECHO) Installing configuration files to $(DESTDIR)$(CONF_DEST);\
917 for i in $(CONFIGS); do \
918 if [ "$$i" = "default.action" ] || [ "$$i" = "default.filter" ] ; then \
919 $(RM) $(DESTDIR)$(CONF_DEST)/$$i ;\
920 $(ECHO) Installing fresh $$i;\
921 $(INSTALL) $$INSTALL_CONF $$i $(DESTDIR)$(CONF_DEST) || exit 1;\
922 elif [ -s "$(CONF_DEST)/$$i" ]; then \
923 $(ECHO) Installing $$i as $$i.new ;\
924 $(INSTALL) $$INSTALL_CONF $$i $(DESTDIR)$(CONF_DEST)/$$i.new || exit 1;\
927 $(INSTALL) $$INSTALL_CONF $$i $(DESTDIR)$(CONF_DEST) || exit 1;\
930 if [ -n "$$NEW" ]; then \
931 $(CHMOD) $(RWD_MODE) $(DESTDIR)$(CONF_DEST)/*.new || exit 1 ;\
932 $(ECHO) "Warning: Older config files are preserved. Check new versions for changes!" ;\
934 [ ! -f $(DESTDIR)$(LOG_DEST)/logfile ] && $(ECHO) Creating logfiles in $(DESTDIR)$(LOG_DEST) || \
935 $(ECHO) Checking logfiles in $(DESTDIR)$(LOG_DEST) ;\
936 $(TOUCH) $(DESTDIR)$(LOG_DEST)/logfile || exit 1 ;\
937 if [ x$$USER != x ]; then \
938 $(CHOWN) $$USER $(DESTDIR)$(LOG_DEST)/logfile || \
939 $(ECHO) "** WARNING ** current install user different from configured user. Logging may fail!!" ;\
941 if [ x$$GROUP_T != x ]; then \
942 $(CHGRP) $$GROUP_T $(DESTDIR)$(LOG_DEST)/logfile || \
943 $(ECHO) "** WARNING ** current install user different from configured user. Logging may fail!!" ;\
945 $(CHMOD) $(RWD_MODE) $(DESTDIR)$(LOG_DEST)/logfile || exit 1 ;\
946 if [ "$(prefix)" = "/usr/local" ] || [ "$(prefix)" = "/usr" ]; then \
947 if [ -f /etc/slackware-version ] && [ -d /etc/rc.d/ ] && [ -w /etc/rc.d/ ] ; then \
948 $(SED) 's+%PROGRAM%+$(PROGRAM)+' slackware/rc.privoxy.orig | \
949 $(SED) 's+%SBIN_DEST%+$(SBIN_DEST)+' | \
950 $(SED) 's+%CONF_DEST%+$(CONF_DEST)+' | \
951 $(SED) 's+%USER%+$(USER)+' | \
952 $(SED) 's+%GROUP%+$(GROUP_T)+' >slackware/rc.privoxy ;\
953 $(INSTALL) $(INSTALL_P) slackware/rc.privoxy $(DESTDIR)/etc/rc.d/ ;\
954 $(ECHO) "Installing for Slackware." ;\
955 $(ECHO) "Dont forget to add the rc.privoxy to rc.local if you want it started at every boot" ;\
956 elif [ -d $(DESTDIR)/etc/init.d ] && [ -w $(DESTDIR)/etc/init.d ] ; then \
957 $(ECHO) "Installing generic init script to $(DESTDIR)/etc/init.d/privoxy" ;\
958 $(ECHO) "Please check that the PATHs are correct, and edit if needed." ;\
959 $(INSTALL) $(INSTALL_P) privoxy-generic.init $(DESTDIR)/etc/init.d/privoxy ;\
962 $(ECHO) "No init script installed, install it manually if needed" ;\
964 $(RM) config.base config.tmp
966 @$(ECHO) "$(PROGRAM_V) installation succeeded!"
967 @$(ECHO) "The Privoxy configuration files have been installed in $(DESTDIR)$(CONF_DEST)"
969 # rmdir is used as a precaution since it will not remove non-empty
970 # directories. RH init script creates lock file and pid file.
971 uninstall: CONF_DEST LOG_DEST PID_DEST check_doc
972 @$(ECHO) Starting Privoxy uninstallation
973 @# KILL privoxy if running
974 @# XXX: the chkconfig line may need a DESTDIR prefix.
975 -@test -f $(DESTDIR)$(PID_DEST)/privoxy.pid && $(ECHO) Stopping $(PROGRAM) &&\
976 $(KILL) `$(CAT) $(DESTDIR)$(PID_DEST)/privoxy.pid` || :
977 -@test -f $(DESTDIR)/var/run/privoxy.pid && $(ECHO) Stopping $(PROGRAM) &&\
978 $(KILL) `$(CAT) $(DESTDIR)/var/run/privoxy.pid ` || :
981 @$(ECHO) Removing $(PROGRAM) binary
982 $(RM) $(DESTDIR)$(SBIN_DEST)/$(PROGRAM) $(SBIN_DEST)/$(PROGRAM)~
984 @# config files and dir, and maybe old install backups
985 -@if [ -d $(DESTDIR)$(CONF_DEST) ]; then \
986 $(ECHO) Saving $(PROGRAM) config files to $(DESTDIR)/tmp/$(PROGRAM)-save ;\
987 $(MKDIR) $(DESTDIR)/tmp/$(PROGRAM)-save ;\
988 cd $(DESTDIR)$(CONF_DEST) ;\
989 for i in $(DESTDIR)$(CONFIGS); do \
990 [ -f $$i ] && $(CP) $$i $(DESTDIR)/tmp/$(PROGRAM)-save ;\
993 @$(ECHO) Removing $(PROGRAM) config files
994 -@for i in $(DESTDIR)$(CONFIGS); do \
995 test -f $(CONF_DEST)/$$i && $(ECHO) Removing $$i ;\
996 $(RM) $(DESTDIR)$(CONF_DEST)/$$i $(DESTDIR)$(CONF_DEST)/$$i~ $(DESTDIR)$(CONF_DEST)/$$i.new ;\
998 -@test -d $(DESTDIR)$(CONF_DEST)/templates && $(RM) -r $(DESTDIR)$(CONF_DEST)/templates &&\
999 $(ECHO) "Removing $(DESTDIR)$(CONF_DEST)/templates/*"
1001 @# man page and docs
1002 @$(ECHO) Removing $(PROGRAM) docs
1003 -$(RM) $(DESTDIR)$(MAN_DEST)/$(MAN_PAGE)*
1004 -$(RM) -r $(DESTDIR)$(DOC_DEST) || $(RM) -r $(DESTDIR)$(prefix)/doc/privoxy
1007 @$(ECHO) Removing $(PROGRAM) logs
1008 -$(RM) $(DESTDIR)$(LOG_DEST)/logfile $(DESTDIR)$(PID_DEST)/privoxy.pid
1010 @# Final clean up of unused directories. Special handling of CONF and LOG
1012 @$(ECHO) Removing $(PROGRAM) directories
1013 @for i in $(DESTDIR)$(LOG_DEST) $(DESTDIR)$(CONF_DEST); do \
1014 if test -d $$i; then \
1015 $(ECHO) Removing $$i ;\
1016 $(RMDIR) $$i || $(ECHO) "$$i is not empty, not removed" ;\
1019 @if [ ! "$(prefix)" = "/usr/local" ] ;then \
1020 for i in $(DESTDIR)$(MAN_DEST) $(DESTDIR)$(MAN_DIR) $(DESTDIR)$(SHARE_DEST)/doc \
1021 $(DESTDIR)$(SHARE_DEST) $(DESTDIR)$(SBIN_DEST); do \
1022 if test -d $$i; then \
1023 $(ECHO) Removing $$i ;\
1024 $(RMDIR) $$i || $(ECHO) "$$i is not empty, not removed" ;\
1027 if test $(LOG_DEST) != /var/log/privoxy && test -d $(DESTDIR)$(prefix)/var/log; then \
1028 $(ECHO) Removing $(DESTDIR)$(prefix)/var/log ;\
1029 $(RMDIR) $(DESTDIR)$(prefix)/var/log || $(ECHO) "$(DESTDIR)$(prefix)/var/log is not empty, not removed";\
1031 if test $(PID_DEST) != /var/run && test -d $(DESTDIR)$(prefix)/var/run; then \
1032 $(ECHO) Removing $(DESTDIR)$(prefix)/var/run ;\
1033 $(RMDIR) $(DESTDIR)$(prefix)/var/run || $(ECHO) "$(DESTDIR)$(prefix)/var/run is not empty, not removed";\
1035 if test $(prefix)/var != /var && test -d $(DESTDIR)$(prefix)/var; then \
1036 $(ECHO) Removing $(DESTDIR)$(prefix)/var ;\
1037 $(RMDIR) $(DESTDIR)$(prefix)/var || $(ECHO) "$(DESTDIR)$(prefix)/var is not empty, not removed" ;\
1039 if test $(prefix) != / && test $(prefix) != /usr && test -d $(DESTDIR)$(prefix); then \
1040 $(ECHO) Removing $(DESTDIR)$(prefix) ;\
1041 $(ECHO) Removing installation directory $(DESTDIR)$(prefix) ;\
1042 $(RMDIR) $(DESTDIR)$(prefix) || $(ECHO) "$(DESTDIR)$(prefix) is not empty, not removed" ;\
1047 @if [ "$(prefix)" = "/usr/local" ] || [ "$(prefix)" = "/usr" ]; then \
1048 $(ECHO) Removing $(PROGRAM) init script ;\
1049 if [ -f $(DESTDIR)/etc/slackware-version ] && \
1050 [ -d $(DESTDIR)/etc/rc.d/ ] && [ -w $(DESTDIR)/etc/rc.d/ ] ; then \
1051 $(RM) $(DESTDIR)/etc/rc.d/rc.privoxy ;\
1052 elif [ -d $(DESTDIR)/etc/init.d ] && [ -w $(DESTDIR)/etc/init.d ] ; then \
1053 $(RM) $(DESTDIR)/etc/init.d/privoxy ;\
1055 $(ECHO) "Unable to remove privoxy init script, not installed or permission denied" ;\
1058 @$(ECHO) Privoxy uninstalled, bye
1061 @perl -e 'print pack "C*", (31,139,8,8,153,63,226,60,2,3,99,111,102,102,101,' \
1062 -e '101,0,109,143,205,13,192,32,8,133,239,78,241,110,234,1,28,160,171,' \
1063 -e '152,208,53,26,117,247,22,165,73,137,125,9,1,62,126,2,128,169,5,243,' \
1064 -e '143,13,139,49,164,65,100,149,152,102,73,141,88,73,178,116,205,100,' \
1065 -e '69,253,36,102,81,49,83,236,19,225,171,131,214,172,163,73,4,168,123,' \
1066 -e '115,71,126,247,122,94,128,178,227,95,154,12,86,215,122,197,249,146,' \
1067 -e '187,54,220,125,193,51,228,11,1,0,0);' | zcat