1 # Note: Makefile is built automatically from Makefile.in
3 # $Id: GNUmakefile.in,v 1.190 2010/11/14 11:26:26 fabiankeil Exp $
5 # Written by and Copyright (C) 2001-2010 members of the
6 # Privoxy team. http://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
63 SHARE_DEST = @datadir@
64 DOC_DEST = $(SHARE_DEST)/doc/privoxy
65 VAR_DEST = @localstatedir@
66 LOGS_DEST = $(VAR_DEST)/log/privoxy
67 PIDS_DEST = $(VAR_DEST)/run
69 # if $prefix = /usr/local then the default CONFDEST change from
70 # CONF_DEST = $(CONF_BASE) to CONF_DEST = $(CONF_BASE)/privoxy
71 # by the target rule CONF_DEST
73 # also if the $prefix is /usr/local and there is no
74 # $(SHARE_DEST)/doc, it checks for $prefix/doc and installs there
75 # instead in this situation
77 # finally if $prefix=/usr/local and VAR_DEST=$prefix/var it
78 # changes this to /var for storing the logs and pidfile
80 # used in source dir only, the install goes to $share_dest/doc/privoxy
81 DOK_WEB = doc/webserver/
83 # Install usage should be compatible with install-sh.
87 # Support files, docs, etc.
91 # Files daemon writes to.
93 INSTALL_P = -m $(BIN_MODE)
94 INSTALL_T = -m $(RA_MODE)
95 INSTALL_D = -m $(DIR_MODE) -d
96 INSTALL_R = -m $(RWD_MODE)
98 # install options for superuser install
99 #INSTALL_S = -g @GROUP@ -o @USER@
101 #############################################################################
103 #############################################################################
105 PROGRAM = privoxy@EXEEXT@
110 # id -u is not universal. FIXME: need to set from configure. Breaks on
118 MKDIR = ./mkinstalldirs
132 WDUMP = @WDUMP@ -dump
135 DB = $(JADEBIN) $(JADECAT) -ihtml -t sgml -D.. -d ldp.dsl\#html
137 MAN2HTML = @MAN2HTML@
138 G2H_CMD = groff -mandoc -Thtml
142 DOC_TMP = $(DOC_DIR)/tmp
143 DOC_STATUS = @DOC_STATUS@
145 # Program to do LF->CRLF
147 # The sed version should be the most portable, but it doesn't for for me,
148 # the other two do. FIXME.
150 #DOSFILTER = $(SED) -e $$'s,$$,\r,'
151 #DOSFILTER = gawk -v ORS='\r\n' '{print $0;}'
152 DOSFILTER = $(PERL) -p -e 's/\n/\r\n/'
153 CVSROOT = :pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa
154 #TMPDIR := $(shell mktemp -d /tmp/$(PROGRAM).XXXXXX)
155 # If your SF user name differs from your local one,
156 # change this to "ssh -l sf-username"
159 #############################################################################
160 # Setup for make distribution for now.
161 #############################################################################
163 TAR_ARCH = /tmp/privoxy-$(VERSION).tar.gz
165 #############################################################################
166 # We include these files in our distributions
167 #############################################################################
168 CONFIGS = config trust default.action match-all.action user.action default.filter user.filter
169 # take care that no CVS .cvsignore or other crappy files
171 # and escape every '#' in the find. doh.
172 CONFIG_FILES = $(CONFIGS) \
173 `find templates/ -type f | grep -v "CVS" | grep -v "\.\#" | grep -v ".*~" | grep -v ".cvsignore" | grep -v "TAGS"`
175 DOC_FILES = AUTHORS LICENSE README ChangeLog INSTALL \
176 `find doc/webserver/ -name "*.html" | grep -v "\(webserver\|team\)\/index\.html"` \
177 `find doc/webserver/ -name "*.css"` \
180 #############################################################################
181 # Filenames and libraries
182 #############################################################################
184 C_SRC = actions.c cgi.c cgiedit.c cgisimple.c deanimate.c encode.c \
185 errlog.c filters.c gateway.c jbsockets.c jcc.c \
186 list.c loadcfg.c loaders.c miscutil.c parsers.c ssplit.c \
189 C_OBJS = $(C_SRC:.c=.@OBJEXT@)
190 C_HDRS = $(C_SRC:.c=.h) project.h actionlist.h
192 W32_SRC = @WIN_ONLY@w32log.c w32taskbar.c win32.c w32svrapi.c
193 W32_FILES = @WIN_ONLY@w32.res
194 W32_OBJS = @WIN_ONLY@$(W32_SRC:.c=.@OBJEXT@) $(W32_FILES)
195 W32_HDRS = @WIN_ONLY@w32log.h w32taskbar.h win32.h w32res.h w32svrapi.h
196 W32_LIB = @WIN_ONLY@-lwsock32 -lcomctl32
197 W32_INIS = @WIN_ONLY@config.txt trust.txt
199 PCRS_SRC = @STATIC_PCRS_ONLY@pcrs.c
200 PCRS_OBJS = @STATIC_PCRS_ONLY@$(PCRS_SRC:.c=.@OBJEXT@)
201 PCRS_HDRS = @STATIC_PCRS_ONLY@$(PCRS_SRC:.c=.h)
203 PCRE_SRC = @STATIC_PCRE_ONLY@pcre/get.c pcre/maketables.c pcre/study.c pcre/pcre.c
204 PCRE_OBJS = @STATIC_PCRE_ONLY@$(PCRE_SRC:.c=.@OBJEXT@)
205 PCRE_HDRS = @STATIC_PCRE_ONLY@pcre/config.h pcre/chartables.c pcre/internal.h pcre/pcre.h
207 # No REGEX (maybe because dynamically linked pcreposix):
209 @STATIC_PCRE_ONLY@REGEX_SRC = pcre/pcreposix.c
211 REGEX_OBJS = $(REGEX_SRC:.c=.@OBJEXT@)
212 REGEX_HDRS = $(REGEX_SRC:.c=.h)
214 # Dependencies introduced by #include "project.h".
215 PROJECT_H_DEPS = project.h $(REGEX_HDRS) $(PCRS_HDRS) @STATIC_PCRE_ONLY@pcre/pcre.h
217 # Socket libraries for platforms that need them explicitly defined
218 SOCKET_LIB = @SOCKET_LIB@
220 # PThreads library, if needed.
221 PTHREAD_LIB = @PTHREAD_ONLY@@PTHREAD_LIB@
223 SRCS = $(C_SRC) $(W32_SRC) $(PCRS_SRC) $(PCRE_SRC) $(REGEX_SRC)
224 OBJS = $(C_OBJS) $(W32_OBJS) $(PCRS_OBJS) $(PCRE_OBJS) $(REGEX_OBJS)
225 HDRS = $(C_HDRS) $(W32_HDRS) $(PCRS_HDRS) $(PCRE_OBJS) $(REGEX_HDRS)
226 LIBS = @LIBS@ $(W32_LIB) $(SOCKET_LIB) $(PTHREAD_LIB)
229 #############################################################################
231 #############################################################################
233 # The flag "-mno-win32" can be used by Cygwin to emulate a un?x type build.
234 # The flag "-mwindows -mno-cygwin" will cause Cygwin to use MingW32 for a
236 # The flag "-pthread" is required if using Pthreads under Linux (and
237 # possibly other OSs).
238 SPECIAL_CFLAGS = @SPECIAL_CFLAGS@
240 # Add your flags here
243 CFLAGS = @CFLAGS@ @CPPFLAGS@ $(OTHER_CFLAGS) $(SPECIAL_CFLAGS) -Wall \
244 @STATIC_PCRE_ONLY@ -Ipcre
246 LDFLAGS = @LDFLAGS@ $(DEBUG_CFLAGS) $(SPECIAL_CFLAGS)
249 #############################################################################
252 # There should NOT be any targets above this line.
253 #############################################################################
254 all: $(PROGRAM) default.action
257 #############################################################################
259 #############################################################################
260 .PHONY: all inifiles solaris-dist \
261 win-dist tarball-dist dok webserver clean clobber tags \
262 install CONF_DEST LOG_DEST \
263 PID_DEST check_doc install-strip uninstall GROUP_T
265 #############################################################################
266 # Define this explicitly because Solaris is broken!
267 #############################################################################
269 $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
272 #############################################################################
273 # Strip master copy comments from default.action:
274 #############################################################################
275 default.action: default.action.master
276 $(GREP) -v '^#MASTER#' $< > $@
278 #############################################################################
280 #############################################################################
282 inifiles: $(W32_INIS)
285 $(SED) -e 's!\trustfile trust!trustfile trust.txt!' \
286 -e 's!\logfile logfile!logfile privoxy.log!' \
287 -e 's!#Win32-only: !!' \
290 # LF to CRLF in default.action
291 $(DOSFILTER) <default.action >default.action.txt && mv default.action.txt default.action
292 # LF to CRLF in default.filter
293 $(DOSFILTER) <default.filter >default.filter.txt && mv default.filter.txt default.filter
296 $(DOSFILTER) < $< > $@
298 #############################################################################
300 #############################################################################
302 @if [ -d CVS ]; then \
303 $(ECHO) "***************************************************"; \
305 $(ECHO) "*** WARNING ***"; \
307 $(ECHO) "*** The presence of a CVS subdirectory suggests ***"; \
308 $(ECHO) "*** that you are trying to build a distribution ***"; \
309 $(ECHO) "*** package based on a checked out, not an ***"; \
310 $(ECHO) "*** exported copy of the source tree. Please ***"; \
311 $(ECHO) "*** see \"Releasing a new version\" in the ***"; \
312 $(ECHO) "*** developer manual. ***"; \
314 $(ECHO) "***************************************************"; \
315 $(ECHO) "Type \"yes i am sure\" if you are sure that you"; \
316 $(ECHO) -n "really want to proceed: "; \
318 if [ "$$answer" != "yes i am sure" ]; then exit 1; fi \
322 #############################################################################
323 # create tar.gz from CVS:
324 # This make-target is usually called through 'create-archive'. If you
325 # run 'make create-snapshot' without setting SNAPVERSION, you'll get a
326 # tar.gz with the current date in the name and as a releasenumber in the
327 # spec-file. But the main usage is to run it as follows (Red Hat example):
328 # make SNAPVERSION=1.6x create-snapshot
329 # This creates a tar.gz.
330 #############################################################################
332 @tag=`cvs -d $(CVSROOT) status Makefile | awk ' /Sticky Tag/ { print $$3 } '` 2> /dev/null; \
333 [ x"$$tag" = x"(none)" ] && tag=HEAD; \
334 echo "*** Creating package from $$tag!"; \
335 TMPDIR=$(shell mktemp -d /tmp/$(PROGRAM).XXXXXX); \
336 cd $$TMPDIR ; cvs -Q -d $(CVSROOT) export -r $$tag current || echo "Um... export aborted."; \
337 cd $$TMPDIR/current; \
338 $(TAR) --exclude ".cvsignore" --exclude "CVS" \
339 -czf /tmp/$(PROGRAM)-$(VERSION).tar.gz .; \
341 @echo "Resulting file is /tmp/$(PROGRAM)-$(VERSION).tar.gz"
344 #############################################################################
345 # looks at the version of Makefile and exports a corresponding source-tree
346 # example: if the Makefile has the sticky tag v_2_9_13, you'll get
347 # privoxy-*-2.4.13.tar.gz.
348 #############################################################################
350 make SNAPVERSION=$(SNAPVERSION) create-snapshot
352 #############################################################################
353 # generic distribution
354 #############################################################################
357 @$(ECHO) "You have run autoconf && autoheader && ./configure right?"
360 $(STRIP_PROG) $(PROGRAM)
361 $(LN) -s current ../privoxy-$(VERSION)-$(CODE_STATUS)
363 (cd .. && $(TAR) -cvhf --exclude "PACKAGERS" privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar privoxy-$(VERSION)-$(CODE_STATUS)/$(PROGRAM))
365 for foo in $(CONFIG_FILES); do \
366 (cd .. && $(TAR) -uvhf --exclude "PACKAGERS" privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar privoxy-$(VERSION)-$(CODE_STATUS)/$$foo;) \
369 for foo in $(DOC_FILES); do \
370 (cd .. && $(TAR) -uvhf --exclude "PACKAGERS" privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar privoxy-$(VERSION)-$(CODE_STATUS)/$$foo;) \
372 # and zip the archive
373 $(RM) ../privoxy-$(VERSION)-$(CODE_STATUS)
374 $(GZIP_PROG) ../privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar
375 @$(ECHO) Distribution with binary created.
377 # anonymously ncftps the package to sourceforge
379 ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming ../privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar.gz
380 @$(ECHO) -------------------------------------------------------
382 @$(ECHO) https://sourceforge.net/project/admin/editpackages.php?group_id=11118
383 @$(ECHO) ... and release the files.
384 @$(ECHO) -------------------------------------------------------
388 $(RM) privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar*
390 #############################################################################
391 # Tarball distribution: No CVS dirs, dotfiles, debian build dir,
392 # (FIXME:) only parts of the static / generated docs mix in doc/webserver
393 #############################################################################
395 tarball-dist: dist-check clean clobber
396 $(LN) -s current ../privoxy-$(VERSION)-$(CODE_STATUS)
398 for i in `find . -type f -a -not \( -path "*/CVS*" -o -name ".*" \
399 -o -path "*/debian/*" -o -path "*/actions/*" -o -name "*.php" -o \
400 -name "PACKAGERS" \)`; do \
401 files="$$files privoxy-$(VERSION)-$(CODE_STATUS)/$$i"; \
403 cd .. && $(TAR) -cvhf privoxy-$(VERSION)-$(CODE_STATUS)-src.tar $$files ; \
405 # and zip the archive
406 $(RM) ../privoxy-$(VERSION)-$(CODE_STATUS)
407 $(GZIP_PROG) ../privoxy-$(VERSION)-$(CODE_STATUS)-src.tar
408 @$(ECHO) Tarball distribution created.
410 # anonymously ncftps the tarball to sourceforge
412 ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming ../privoxy-$(VERSION)-$(CODE_STATUS)-src.tar.gz
413 @$(ECHO) -------------------------------------------------------
415 @$(ECHO) https://sourceforge.net/project/admin/editpackages.php?group_id=11118
416 @$(ECHO) ... and release the files.
417 @$(ECHO) -------------------------------------------------------
420 $(RM) ../privoxy-$(VERSION)-$(CODE_STATUS)-src.tar.gz
422 #############################################################################
426 # converts doc/source/*.sgml into html and man pages
428 #############################################################################
432 $(RM) doc/webserver/developer-manual/*.html
433 $(RM) -r doc/source/developer-manual
434 mkdir -p doc/source/developer-manual
435 cd doc/source/developer-manual && $(DB) ../developer-manual.sgml && cd .. && cp developer-manual/*.html ../webserver/developer-manual/
439 $(RM) doc/webserver/user-manual/*.html
440 $(RM) -r doc/source/user-manual/
441 mkdir -p doc/source/user-manual
442 cd doc/source/user-manual && $(DB) -iuser-man ../user-manual.sgml && cd .. && cp user-manual/*.html ../webserver/user-manual/
443 # FIXME: temp fix so same stylesheet gets in more than one place so it works
444 # for all doc set-ups, including the 'user manual' config option in local
445 # system where it MUST be in same directory as html.
446 $(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
450 $(RM) doc/webserver/faq/*.html
451 $(RM) -r doc/source/faq
452 mkdir -p doc/source/faq
453 cd doc/source/faq && $(DB) ../faq.sgml && cd .. && cp faq/*.html ../webserver/faq/
455 # man page, one variation. Try to use the next target, just 'make man'.
457 $(RM) doc/man/* doc/webserver/man-page/*.html
458 ifneq ($(MAN2HTML),false)
459 $(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
460 man ./privoxy.1 | $(MAN2HTML) -bare >> doc/webserver/man-page/privoxy-man-page.html
461 $(ECHO) "</body></html>" >> doc/webserver/man-page/privoxy-man-page.html
466 # Build man page from sgml. This requires the SGMLSpm perl module.
467 # See CPAN, or your favorite perl repository. This is the preferred
468 # target for man page generation!
470 mkdir -p doc/source/temp && cd doc/source/temp && $(RM) * ;\
471 nsgmls ../privoxy-man-page.sgml | sgmlspl ../../../utils/docbook2man/docbook2man-spec.pl &&\
472 perl -pi.bak -e 's/ <URL:.*>//; s/\[ /\[/g' privoxy.1 ;\
473 perl -pi.bak -e "s/\[ /\[/g;s/á/\\\\['a]/g;s/é/\\\\['e]/g" privoxy.1; \
474 perl -pi.bak -e "s/ö/\\\\[:o]/g" privoxy.1; \
475 perl -pi.bak -e 's/([ {])-([a-z])/$$1\\-$$2/g' privoxy.1; \
476 perl -pi.bak -e 's/ --([a-z])/ \\-\\-$$1/g' privoxy.1; \
477 perl -pi.bak -e 's/\\fB--/\\fB\\-\\-/g' privoxy.1; \
478 $(DB) ../privoxy-man-page.sgml && $(MV) -f privoxy.1 ../../../privoxy.1
480 # For those with man2html ala RH7s.
482 mkdir -p doc/webserver/man-page
483 ifneq ($(MAN2HTML),false)
484 $(MAN2HTML) privoxy.1 |grep -v "^Content-type" > tmp.html
485 $(PERL) -pi.bak -e 's/<A .*Contents<\/A>//; s/<A .*man2html<\/A>/man2html/' tmp.html
486 $(PERL) -pi.bak -e 's/(<\/HEAD>)/<LINK REL=\"STYLESHEET\" TYPE=\"text\/css\" HREF=\"..\/p_doc.css\"><\/HEAD>/' tmp.html
487 # Twice because my version of man2html is pulling in commas and periods in URLs.
488 $(PERL) -pi.bak -e 's/(<A.*),(">)/$$1$$2/g' tmp.html
489 $(PERL) -pi.bak -e 's,\.">,">,g' tmp.html
490 $(PERL) -pi.bak -e "s/\['a\]/\á/g;s/\['e\]/\é/g" tmp.html
491 # Get rid of spurious
\a from conversion. (How to do this with perl?)
492 $(SED) -e 's/
\a//g' tmp.html > doc/webserver/man-page/privoxy-man-page.html && $(RM) tmp.*
498 # Otherwise we get plain groff conversion.
500 $(G2H_CMD) ./privoxy.1 | $(SED) -e 's@</head>@<link REL="STYLESHEET" TYPE="text/css" HREF="../p_doc.css"></head>@' > doc/webserver/man-page/privoxy-man-page.html
503 # readme page and INSTALL file
504 dok-readme: dok-release
505 cd doc/source && $(DB)-notoc -V nochunks readme.sgml > tmp.html &&\
506 env -u LANG $(WDUMP) tmp.html > ../../README ;\
507 $(DB)-notoc -V nochunks install.sgml > tmp.html &&\
508 env -u LANG $(WDUMP) tmp.html > ../../INSTALL ;\
511 # index.sgml is used to create both the Home Page, and a local index
512 # for documentation, etc.
514 # index.html for webserver:
516 cd doc/source/webserver && $(DB)-notoc -ip-homepage -V nochunks index.sgml > ../../webserver/index.html
517 $(PERL) -pi.bak -e 's/..\/p_doc.css/p_doc.css/;\
518 s/<\/HEAD/\n<meta name=\"description\" content=\"Privoxy helps users to protect their privacy.\"><\/HEAD/;\
519 s/<\/HEAD/\n<meta name="MSSmartTagsPreventParsing" content="TRUE"><\/HEAD/;\
522 doc/webserver/index.html && $(RM) doc/webserver/*.bak
524 # privoxy-index.html for local documentation:
526 cd doc/source/webserver && $(DB)-notoc -ip-index -V nochunks index.sgml > ../../webserver/privoxy-index.html
527 $(PERL) -pi.bak -e 's/..\/p_doc.css/p_doc.css/;\
528 s/<\/HEAD/\n<meta name=\"description\" content=\"Privoxy helps users to protect their privacy.\"><\/HEAD/;\
529 s/<\/HEAD/\n<meta name="MSSmartTagsPreventParsing" content="TRUE"><\/HEAD/;\
532 doc/webserver/privoxy-index.html && $(RM) doc/webserver/*.bak
534 # Main documentation target.
535 dok: dok-release dok-devel dok-user dok-faq dok-readme dok-webserver dok-authors dok-index
536 @$(ECHO) Documentation created.
540 cd doc/source && $(DB) -V nochunks authors.sgml > tmp.html && env -u LANG $(WDUMP) \
541 tmp.html > ../../AUTHORS && $(RM) tmp.html
543 # Set doc entities for VERSION and CODE_STATUS in sgml docs. Toggle content
544 # exceptions accordingly. This needs to go before any doc building (doh).
546 @$(ECHO) Setting doc version and status to $(VERSION), $(CODE_STATUS)
547 @$(PERL) -pi.bak -e 's/<!entity +p-version.*>/<!entity p-version "$(VERSION)">/;\
548 s/<!entity +p-status.*>/<!entity p-status "$(CODE_STATUS)">/' \
549 doc/source/*sgml doc/source/*/*sgml
550 $(RM) -r doc/source/*bak doc/source/*/*bak
551 ifeq ($(CODE_STATUS),stable)
552 @$(ECHO) Setting docs to stable $(VERSION)
553 @$(PERL) -pi.bak -e 's/<!entity +% +p-stable.*>/<!entity % p-stable "INCLUDE">/;\
554 s/<!entity +% +p-not-stable.*>/<!entity % p-not-stable "IGNORE">/' \
555 doc/source/*sgml doc/source/*/*sgml
556 $(RM) -r doc/source/*bak doc/source/*/*bak
558 @$(ECHO) Setting docs to not stable $(VERSION)
559 @$(PERL) -pi.bak -e 's/<!entity +% +p-stable.*>/<!entity % p-stable "IGNORE">/;\
560 s/<!entity +% +p-not-stable.*>/<!entity % p-not-stable "INCLUDE">/' \
561 doc/source/*sgml doc/source/*/*sgml
562 $(RM) -r doc/source/*bak doc/source/*/*bak
565 # Create release announcement in text and html, with short and long versions.
566 # This is a standalone target, and must be invoked directly.
567 # announce: dok-release
568 # mkdir -p $(DOC_TMP)
569 # cd $(DOC_TMP) && cp -f ../announce.sgml . && $(DB) -iannounce-big announce.sgml &&\
570 # mv -f index.html announce.html && $(WDUMP) announce.html > announce.txt
571 # cd $(DOC_TMP) && $(DB) announce.sgml &&\
572 # mv -f index.html announce-mini.html && $(WDUMP) announce-mini.html > announce-mini.txt &&\
573 # mv -f *html *txt ../../..
576 # The main Privoxy config file, generated from sgml sources.
577 # NOTE: This will require some hand editing. The new file is outputted
578 # as config.new so that problem sections can be compared to previous
579 # version. This is hardcored to w3m for html/text conversion. Also,
580 # requires the shell util 'fmt'.
581 config-file: dok-release
582 cd doc/source && $(DB)-notoc -iconfig-file -V nochunks config.sgml > __tmp.html &&\
583 env -u LANG w3m -dump __tmp.html | fmt -w 70 > ../../config.new && $(RM) -r __tmp.*
584 $(PERL) -i.bak utils/prepare-configfile.pl config.new
587 @$(ECHO) "****************************************************"
588 @$(ECHO) "The output file is config.new."
589 @$(ECHO) "Now -- you need to hand edit the results!!!"
590 @$(ECHO) "In particular, check the Debug levels, the"
591 @$(ECHO) "permit-access, forward & socks examples and the"
592 @$(ECHO) "various user-manual examples, which all"
593 @$(ECHO) "probably got hammered."
594 @$(ECHO) "****************************************************"
596 # config file, alternate version using lynx (perl stuff unfinished). Lynx
597 # does not do so good a job.
599 cd doc/source && $(ECHO) -e ".h2 JUSTIFY\\nJUSTIFY:FALSE" > __tmp.lynx_cfg &&\
600 $(DB)-notoc -iconfig-file -V nochunks config.sgml > __tmp.html &&\
601 lynx -cfg=__tmp.lynx_cfg -width=78 -dump __tmp.html > ../../config.new && $(RM) -r __tmp.*
602 $(PERL) -pi -e 's/^( )//;\
603 s/:$\/:\n/' config.new
605 #############################################################################
609 # moves dokumentation to webserver
611 #############################################################################
613 @$(ECHO) -------------------------------------------------------
614 @$(ECHO) You will need to "create" a SF shell first:
615 @$(ECHO) ssh -t SF-USER-ID,ijbswa@shell.sourceforge.net create
616 @$(ECHO) Please make sure your documentation files are up to date.
617 @$(ECHO) Note that this command updates the home page and scps
618 @$(ECHO) all stuff to the webserver, it will not remove obsolete documents.
619 @$(ECHO) -------------------------------------------------------
621 @$(ECHO) Replacing the user-manual symlink
622 @$(SSH) shell.sourceforge.net "cd /home/groups/i/ij/ijbswa/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 /home/groups/i/ij/ijbswa/htdocs/; tar xvm 2>&1 | grep -v timestamp'
630 @$(ECHO) Fixing permissions
631 @$(SSH) shell.sourceforge.net 'chmod -R 775 /home/groups/i/ij/ijbswa/htdocs 2>/dev/null; true'
632 @$(SSH) shell.sourceforge.net 'find /home/groups/i/ij/ijbswa/htdocs/ -type f | xargs chmod 664 2>/dev/null; true'
636 @cd doc/webserver/actions; \
637 upload=`find . -type f -a -not \( -path "*/CVS*" -o -path "*/results*" \)`; \
638 $(TAR) cf - $$upload | $(SSH) ijbswa.sourceforge.net 'cd /home/groups/i/ij/ijbswa/htdocs/actions; tar xvm'
640 @$(ECHO) Fixing permissions
641 @$(SSH) ijbswa.sourceforge.net 'find /home/groups/i/ij/ijbswa/htdocs/actions/ -type f | xargs chmod 664 2>/dev/null'
642 @$(SSH) ijbswa.sourceforge.net 'chmod 666 /home/groups/i/ij/ijbswa/htdocs/actions/results/actions-feedback.txt 2>/dev/null'
646 tar --exclude ".cvsignore" --exclude "CVS" --exclude "source" --exclude ".htaccess" \
647 --exclude "obsolete" --exclude "actions" --exclude "*.zip" --exclude "robots.txt"\
648 doc/* INSTALL LICENSE AUTHORS README \
650 $(ECHO) "Uploading doc package ..." ;\
651 scp $(DOC_FILE) ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/docs/
652 @$(SSH) ijbswa.sourceforge.net 'chmod 775 /home/groups/i/ij/ijbswa/htdocs/docs/*gz 2>/dev/null; true'
657 $(WGET) http://www.privoxy.org/docs/$(DOC_FILE) ;\
658 $(TAR) -zxvf $(DOC_FILE)
661 #############################################################################
662 # Source file dependencies
663 #############################################################################
665 actions.@OBJEXT@: actions.c actions.h config.h $(PROJECT_H_DEPS) errlog.h jcc.h list.h loaders.h miscutil.h actionlist.h ssplit.h
666 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
667 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
668 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
669 deanimate.@OBJEXT@: deanimate.c deanimate.h config.h $(PROJECT_H_DEPS)
670 encode.@OBJEXT@: encode.c encode.h config.h
671 errlog.@OBJEXT@: errlog.c errlog.h config.h $(PROJECT_H_DEPS) @WIN_ONLY@w32log.h
672 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
673 gateway.@OBJEXT@: gateway.c gateway.h config.h $(PROJECT_H_DEPS) errlog.h jbsockets.h jcc.h loadcfg.h
674 jbsockets.@OBJEXT@: jbsockets.c jbsockets.h config.h $(PROJECT_H_DEPS) filters.h
675 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
676 list.@OBJEXT@: list.c list.h config.h $(PROJECT_H_DEPS) list.h miscutil.h
677 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
678 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
679 miscutil.@OBJEXT@: miscutil.c miscutil.h config.h
680 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
681 ssplit.@OBJEXT@: ssplit.c ssplit.h config.h miscutil.h
682 urlmatch.@OBJEXT@: urlmatch.c urlmatch.h config.h $(PROJECT_H_DEPS) errlog.h miscutil.h ssplit.h
685 gnu_regex.@OBJEXT@: gnu_regex.c gnu_regex.h config.h
688 pcrs.@OBJEXT@: pcrs.c pcrs.h config.h @STATIC_PCRE_ONLY@pcre/pcre.h
691 pcre/get.@OBJEXT@: pcre/get.c pcre/config.h pcre/internal.h pcre/pcre.h
692 pcre/maketables.@OBJEXT@: pcre/maketables.c pcre/config.h pcre/internal.h pcre/pcre.h
693 pcre/pcre.@OBJEXT@: pcre/pcre.c pcre/config.h pcre/internal.h pcre/pcre.h pcre/chartables.c
694 pcre/pcreposix.@OBJEXT@: pcre/pcreposix.c pcre/config.h pcre/internal.h pcre/pcre.h pcre/pcreposix.h
695 pcre/study.@OBJEXT@: pcre/study.c pcre/config.h pcre/internal.h pcre/pcre.h
697 # An auxiliary program makes the PCRE default character table source
699 pcre/chartables.c: pcre/dftables@EXEEXT@
700 pcre/dftables@EXEEXT@ >pcre/chartables.c
702 pcre/dftables@EXEEXT@: pcre/dftables.c pcre/maketables.c pcre/pcre.h pcre/internal.h pcre/config.h
703 $(CC) -o pcre/dftables@EXEEXT@ $(CFLAGS) pcre/dftables.c
706 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
707 w32taskbar.@OBJEXT@: w32taskbar.c config.h w32log.h w32taskbar.h
708 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
710 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
711 windres -D__MINGW32__=0.2 -O coff -i $< -o $@
714 @AMIGAOS_ONLY@OBJS += amiga.o
715 @AMIGAOS_ONLY@ifeq ($(shell $(CC) -dumpmachine), m68k-amigaos)
716 @AMIGAOS_ONLY@CFLAGS += -D__AMIGAVERSION__=\"$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_POINT)\" -D__AMIGADATE__=\"`date +%d.%m.%Y`\" -W -m68020 -noixemul -fbaserel -msmall-code
717 @AMIGAOS_ONLY@LDFLAGS += -m68020 -noixemul -fbaserel
718 @AMIGAOS_ONLY@LIBS = -lm /gg/lib/libb/libm020/libnix/swapstack.o
720 @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
722 @AMIGAOS_ONLY@amiga.o: amiga.c amiga.h config.h
725 $(PROGRAM): $(OBJS) $(W32_FILES)
726 $(LD) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
729 $(RM) a.out $(OBJS) $(W32_FILES) $(W32_INIS) $(PROGRAM) default.action \
730 `find . -name TAGS -o -name tags | $(GREP) -v .git` config.base config.tmp
733 $(RM) `find . -name "*~"`
734 $(RM) `find . -name "#*#"` # Emacs backup files
735 $(RM) `find . -name ".\#*"`
738 $(RM) GNUmakefile configure config.h.in config.h config.cache config.status config.log logfile \
739 privoxy.log core *.tar.gz *.tar privoxy-cl.spec doc/source/ldp.dsl config.new
740 $(RM) -r autom4te.cache
743 # FIXME: What is all this?
745 $(RM) cscope.* *.pdb *.lib *.exp
749 tags: $(SRCS) $(HDRS)
750 etags $(SRCS) $(HDRS)
752 CONF_DEST:=$(shell if [ "$(prefix)" = "/usr/local" ] && [ "$(CONF_BASE)" = "$(prefix)/etc" ];then \
753 $(ECHO) "$(CONF_BASE)/privoxy";\
755 $(ECHO) "$(CONF_BASE)";\
758 LOG_DEST:=$(shell if [ "$(prefix)" = "/usr/local" ] && [ "$(LOGS_DEST)" = "$(prefix)/var/log/privoxy" ];then \
759 $(ECHO) "/var/log/privoxy" ;\
761 $(ECHO) "$(LOGS_DEST)";\
764 PID_DEST:=$(shell if [ "$(prefix)" = "/usr/local" ] && [ "$(PIDS_DEST)" = "$(prefix)/var/run" ];then \
765 $(ECHO) "/var/run" ;\
767 $(ECHO) "$(PIDS_DEST)";\
770 check_doc:=$(shell if [ ! -d "$(SHARE_DEST)/doc" ] && [ "$(prefix)" = "/usr/local" ] && [ -d "$(prefix)/doc" ];then \
776 # If USER is specified but no GROUP, assume there is a GROUP of same name.
777 GROUP_T:=$(shell if [ x$(GROUP) = x ] && [ x$(USER) != x ];then \
784 $(MAKE) install STRIP=-s
786 # FIXME: Test USER and GROUP on Slack to make sure this works as
789 # FIXME: id handling needs help, probably via configure, since 'id -u' is not
790 # universally reliable (eg Solaris). Group handling could be better.
791 # Perhaps the whole user/group validation should be done here, and simplified.
792 PROGRAM_V = Privoxy $(VERSION) $(CODE_STATUS)
793 install: CONF_DEST LOG_DEST PID_DEST check_doc GROUP_T
794 @# Quick test for valid USER.
795 @if [ -n "$(USER)" ]; then \
796 $(ID) $(USER) >/dev/null || exit 1;\
798 @# Test for valid group. FIXME. USER does not have to belong to GROUP
799 @# for file ownership purposes.
800 # if [ -n "$(GROUP_T)" ] && [ -n "$(USER)" ] && ! $(GROUPS) $(USER) | $(GREP) "\<$(GROUP_T)\>" >/dev/null; then \
801 # $(ECHO) Group $(GROUP_T) for User $(USER) is invalid && exit 1 ;\
804 @$(ECHO) "Creating directories, and preparing $(PROGRAM_V) installation"
805 $(CHMOD) $(DIR_MODE) $(MKDIR)
806 @$(MKDIR) $(DESTDIR)$(SBIN_DEST) $(DESTDIR)$(prefix) $(DESTDIR)$(CONF_DEST) \
807 $(DESTDIR)$(CONF_DEST)/templates $(DESTDIR)$(SHARE_DEST) \
808 $(DESTDIR)$(LOG_DEST) $(DESTDIR)$(PID_DEST)
809 @# Install the executable binary, strip if invoked as install-strip
810 @test -n "$(STRIP)" &&\
811 $(ECHO) Installing $(PROGRAM) stripped executable to $(SBIN_DEST) ||\
812 $(ECHO) Installing $(PROGRAM) executable to $(DESTDIR)$(SBIN_DEST)
813 $(INSTALL) $(INSTALL_P) $(STRIP) $(PROGRAM) $(DESTDIR)$(SBIN_DEST)
815 @# Install the DOCS and man page. install-sh only does one file at a time.
816 @# FIXME: only handles jpegs.
817 -@if [ $(check_doc) = 0 ]; then \
820 DOC=$(prefix)/doc/privoxy ;\
822 $(MKDIR) $(DESTDIR)$$DOC $(DESTDIR)$$DOC/user-manual $(DESTDIR)$$DOC/faq $(DESTDIR)$$DOC/developer-manual \
823 $(DESTDIR)$$DOC/man-page $(DESTDIR)$$DOC/images $(DESTDIR)$(MAN_DEST) ;\
824 if [ -d "$(DOK_WEB)" ]; then \
825 $(ECHO) Installing FAQ, Manual, and other docs to $(DESTDIR)$$DOC;\
826 for i in user-manual developer-manual faq; do \
827 for ii in $(DOK_WEB)/$$i/*html; do \
828 $(INSTALL) $(INSTALL_T) $$ii $(DESTDIR)$$DOC/$$i;\
831 for i in $(DOK_WEB)/user-manual/*jpg; do \
832 $(INSTALL) $(INSTALL_T) $$i $(DESTDIR)$$DOC/user-manual;\
834 $(INSTALL) $(INSTALL_T) $(DOK_WEB)/man-page/*html $(DESTDIR)$$DOC/man-page;\
835 $(INSTALL) $(INSTALL_T) $(DOK_WEB)/privoxy-index.html $(DESTDIR)$$DOC/index.html;\
836 $(INSTALL) $(INSTALL_T) AUTHORS $(DESTDIR)$$DOC;\
837 $(INSTALL) $(INSTALL_T) LICENSE $(DESTDIR)$$DOC;\
838 $(INSTALL) $(INSTALL_T) README $(DESTDIR)$$DOC;\
839 $(INSTALL) $(INSTALL_T) ChangeLog $(DESTDIR)$$DOC;\
840 $(INSTALL) $(INSTALL_T) $(DOK_WEB)/p_doc.css $(DESTDIR)$$DOC;\
841 $(INSTALL) $(INSTALL_T) $(DOK_WEB)/p_doc.css $(DESTDIR)$$DOC/user-manual;\
843 @# Not all platforms support gzipped man pages.
844 @$(ECHO) Installing man page to $(DESTDIR)$(MAN_DEST)/privoxy.1
845 -$(INSTALL) $(INSTALL_T) privoxy.1 $(DESTDIR)$(MAN_DEST)/privoxy.1
847 @# Change the config file default directories according to the configured ones
848 @$(ECHO) Rewriting config for this installation
849 @if [ -f config.base ] ; then \
850 $(CAT) config >config~ ;\
851 $(MV) config.base config ;\
853 $(SED) 's+^confdir \.+confdir $(CONF_DEST)+' config | \
854 $(SED) 's+^logdir \.+logdir $(LOG_DEST)+' >config.tmp
855 -@if [ $(check_doc) = 0 ]; then \
856 $(SED) 's+^#\?user-manual .*+user-manual $(DOC_DEST)/user-manual/+' config.tmp >config.updated ;\
858 $(SED) 's+^#\?user-manual .*+user-manual $(prefix)/doc/privoxy/user-manual/+' config.tmp >config.updated ;\
860 $(MV) config config.base
861 $(MV) config.updated config
863 @# Install the config support files. Test for root install, and abort
864 @# if there is no privoxy user, and no other user was enabled during
865 @# configure. Later, install init script if appropriate.
866 @$(ECHO) Installing templates to $(DESTDIR)$(CONF_DEST)/templates
867 @for i in `find templates -type f`; do \
868 $(INSTALL) $(INSTALL_T) $$i $(DESTDIR)$(CONF_DEST)/templates ;\
871 @# FIXME: group/user validation is overly convoluted.
872 @# If superuser install ... we require a minimum of group ownership
873 @# of those files the daemon writes to, to be non-root owned.
874 @if [ "`$(ID) |sed 's/(.*//' |sed 's/.*=//'`" = "0" ] ;then\
875 if [ x$(USER) = x ] || [ $(USER) = root ]; then \
876 if [ x$(GROUP) = x ] || [ $(GROUP) = root ]; then \
877 if [ "`$(ID) privoxy`" ] && \
878 $(GROUPS) privoxy | $(SED) 's/^.*://' |$(GREP) "\<privoxy\>" >/dev/null; then \
879 $(ECHO) "Warning: Setting group owner to privoxy";\
882 $(ECHO) "******************************************************************" ;\
883 $(ECHO) " WARNING! WARNING! installing config files as root!" ;\
884 $(ECHO) " It is strongly recommended to run $(PROGRAM) as a non-root user," ;\
885 $(ECHO) " and to install the config files as that user and/or group!" ;\
886 $(ECHO) " Please read INSTALL, and create a privoxy user and group!" ;\
887 $(ECHO) "*******************************************************************" ;\
893 INSTALL_CONF="$(INSTALL_R) -g $$GROUP_T " ;\
895 $(ECHO) "Superuser install, installing config files as $(USER):$(GROUP_T)" ;\
896 INSTALL_CONF="$(INSTALL_R) -o $(USER) -g $(GROUP_T)" ;\
897 GROUP_T=$(GROUP_T) ;\
900 if [ ! "`id $(USER)`" = "`id`" ] ;then \
901 $(ECHO) "** WARNING ** current install user different from configured user!!" ;\
902 $(ECHO) "Edit may fail." ;\
904 INSTALL_CONF="$(INSTALL_R)" ;\
906 $(ECHO) Installing configuration files to $(DESTDIR)$(CONF_DEST);\
907 for i in $(CONFIGS); do \
908 if [ "$$i" = "default.action" ] || [ "$$i" = "default.filter" ] ; then \
909 $(RM) $(DESTDIR)$(CONF_DEST)/$$i ;\
910 $(ECHO) Installing fresh $$i;\
911 $(INSTALL) $$INSTALL_CONF $$i $(DESTDIR)$(CONF_DEST) || exit 1;\
912 elif [ -s "$(CONF_DEST)/$$i" ]; then \
913 $(ECHO) Installing $$i as $$i.new ;\
914 $(INSTALL) $$INSTALL_CONF $$i $(DESTDIR)$(CONF_DEST)/$$i.new || exit 1;\
917 $(INSTALL) $$INSTALL_CONF $$i $(DESTDIR)$(CONF_DEST) || exit 1;\
920 if [ -n "$$NEW" ]; then \
921 $(CHMOD) $(RWD_MODE) $(DESTDIR)$(CONF_DEST)/*.new || exit 1 ;\
922 $(ECHO) "Warning: Older config files are preserved. Check new versions for changes!" ;\
924 [ ! -f $(DESTDIR)$(LOG_DEST)/logfile ] && $(ECHO) Creating logfiles in $(DESTDIR)$(LOG_DEST) || \
925 $(ECHO) Checking logfiles in $(DESTDIR)$(LOG_DEST) ;\
926 $(TOUCH) $(DESTDIR)$(LOG_DEST)/logfile || exit 1 ;\
927 if [ x$$USER != x ]; then \
928 $(CHOWN) $$USER $(DESTDIR)$(LOG_DEST)/logfile || \
929 $(ECHO) "** WARNING ** current install user different from configured user. Logging may fail!!" ;\
931 if [ x$$GROUP_T != x ]; then \
932 $(CHGRP) $$GROUP_T $(DESTDIR)$(LOG_DEST)/logfile || \
933 $(ECHO) "** WARNING ** current install user different from configured user. Logging may fail!!" ;\
935 $(CHMOD) $(RWD_MODE) $(DESTDIR)$(LOG_DEST)/logfile || exit 1 ;\
936 if [ "$(prefix)" = "/usr/local" ] || [ "$(prefix)" = "/usr" ]; then \
937 if [ -f /etc/slackware-version ] && [ -d /etc/rc.d/ ] && [ -w /etc/rc.d/ ] ; then \
938 $(SED) 's+%PROGRAM%+$(PROGRAM)+' slackware/rc.privoxy.orig | \
939 $(SED) 's+%SBIN_DEST%+$(SBIN_DEST)+' | \
940 $(SED) 's+%CONF_DEST%+$(CONF_DEST)+' | \
941 $(SED) 's+%USER%+$(USER)+' | \
942 $(SED) 's+%GROUP%+$(GROUP_T)+' >slackware/rc.privoxy ;\
943 $(INSTALL) $(INSTALL_P) slackware/rc.privoxy $(DESTDIR)/etc/rc.d/ ;\
944 $(ECHO) "Installing for Slackware." ;\
945 $(ECHO) "Dont forget to add the rc.privoxy to rc.local if you want it started at every boot" ;\
946 elif [ -d $(DESTDIR)/etc/init.d ] && [ -w $(DESTDIR)/etc/init.d ] ; then \
947 $(ECHO) "Installing generic init script to $(DESTDIR)/etc/init.d/privoxy" ;\
948 $(ECHO) "Please check that the PATHs are correct, and edit if needed." ;\
949 $(INSTALL) $(INSTALL_P) privoxy-generic.init $(DESTDIR)/etc/init.d/privoxy ;\
952 $(ECHO) "No init script installed, install it manually if needed" ;\
954 $(RM) config.base config.tmp
956 @$(ECHO) "$(PROGRAM_V) installation succeeded!"
957 @$(ECHO) "The Privoxy configuration files have been installed in $(DESTDIR)$(CONF_DEST)"
959 # rmdir is used as a precaution since it will not remove non-empty
960 # directories. RH init script creates lock file and pid file.
961 uninstall: CONF_DEST LOG_DEST PID_DEST check_doc
962 @$(ECHO) Starting Privoxy uninstallation
963 @# KILL privoxy if running
964 @# XXX: the chkconfig line may need a DESTDIR prefix.
965 -@test -f $(DESTDIR)$(PID_DEST)/privoxy.pid && $(ECHO) Stopping $(PROGRAM) &&\
966 $(KILL) `$(CAT) $(DESTDIR)$(PID_DEST)/privoxy.pid` || :
967 -@test -f $(DESTDIR)/var/run/privoxy.pid && $(ECHO) Stopping $(PROGRAM) &&\
968 $(KILL) `$(CAT) $(DESTDIR)/var/run/privoxy.pid ` || :
971 @$(ECHO) Removing $(PROGRAM) binary
972 $(RM) $(DESTDIR)$(SBIN_DEST)/$(PROGRAM) $(SBIN_DEST)/$(PROGRAM)~
974 @# config files and dir, and maybe old install backups
975 -@if [ -d $(DESTDIR)$(CONF_DEST) ]; then \
976 $(ECHO) Saving $(PROGRAM) config files to $(DESTDIR)/tmp/$(PROGRAM)-save ;\
977 $(MKDIR) $(DESTDIR)/tmp/$(PROGRAM)-save ;\
978 cd $(DESTDIR)$(CONF_DEST) ;\
979 for i in $(DESTDIR)$(CONFIGS); do \
980 [ -f $$i ] && $(CP) $$i $(DESTDIR)/tmp/$(PROGRAM)-save ;\
983 @$(ECHO) Removing $(PROGRAM) config files
984 -@for i in $(DESTDIR)$(CONFIGS); do \
985 test -f $(CONF_DEST)/$$i && $(ECHO) Removing $$i ;\
986 $(RM) $(DESTDIR)$(CONF_DEST)/$$i $(DESTDIR)$(CONF_DEST)/$$i~ $(DESTDIR)$(CONF_DEST)/$$i.new ;\
988 -@test -d $(DESTDIR)$(CONF_DEST)/templates && $(RM) -r $(DESTDIR)$(CONF_DEST)/templates &&\
989 $(ECHO) "Removing $(DESTDIR)$(CONF_DEST)/templates/*"
992 @$(ECHO) Removing $(PROGRAM) docs
993 -$(RM) $(DESTDIR)$(MAN_DEST)/privoxy.1*
994 -$(RM) -r $(DESTDIR)$(DOC_DEST) || $(RM) -r $(DESTDIR)$(prefix)/doc/privoxy
997 @$(ECHO) Removing $(PROGRAM) logs
998 -$(RM) $(DESTDIR)$(LOG_DEST)/logfile $(DESTDIR)$(PID_DEST)/privoxy.pid
1000 @# Final clean up of unused directories. Special handling of CONF and LOG
1002 @$(ECHO) Removing $(PROGRAM) directories
1003 @for i in $(DESTDIR)$(LOG_DEST) $(DESTDIR)$(CONF_DEST); do \
1004 if test -d $$i; then \
1005 $(ECHO) Removing $$i ;\
1006 $(RMDIR) $$i || $(ECHO) "$$i is not empty, not removed" ;\
1009 @if [ ! "$(prefix)" = "/usr/local" ] ;then \
1010 for i in $(DESTDIR)$(MAN_DEST) $(DESTDIR)$(MAN_DIR) $(DESTDIR)$(SHARE_DEST)/doc \
1011 $(DESTDIR)$(SHARE_DEST) $(DESTDIR)$(SBIN_DEST); do \
1012 if test -d $$i; then \
1013 $(ECHO) Removing $$i ;\
1014 $(RMDIR) $$i || $(ECHO) "$$i is not empty, not removed" ;\
1017 if test $(LOG_DEST) != /var/log/privoxy && test -d $(DESTDIR)$(prefix)/var/log; then \
1018 $(ECHO) Removing $(DESTDIR)$(prefix)/var/log ;\
1019 $(RMDIR) $(DESTDIR)$(prefix)/var/log || $(ECHO) "$(DESTDIR)$(prefix)/var/log is not empty, not removed";\
1021 if test $(PID_DEST) != /var/run && test -d $(DESTDIR)$(prefix)/var/run; then \
1022 $(ECHO) Removing $(DESTDIR)$(prefix)/var/run ;\
1023 $(RMDIR) $(DESTDIR)$(prefix)/var/run || $(ECHO) "$(DESTDIR)$(prefix)/var/run is not empty, not removed";\
1025 if test $(prefix)/var != /var && test -d $(DESTDIR)$(prefix)/var; then \
1026 $(ECHO) Removing $(DESTDIR)$(prefix)/var ;\
1027 $(RMDIR) $(DESTDIR)$(prefix)/var || $(ECHO) "$(DESTDIR)$(prefix)/var is not empty, not removed" ;\
1029 if test $(prefix) != / && test $(prefix) != /usr && test -d $(DESTDIR)$(prefix); then \
1030 $(ECHO) Removing $(DESTDIR)$(prefix) ;\
1031 $(ECHO) Removing installation directory $(DESTDIR)$(prefix) ;\
1032 $(RMDIR) $(DESTDIR)$(prefix) || $(ECHO) "$(DESTDIR)$(prefix) is not empty, not removed" ;\
1037 @if [ "$(prefix)" = "/usr/local" ] || [ "$(prefix)" = "/usr" ]; then \
1038 $(ECHO) Removing $(PROGRAM) init script ;\
1039 if [ -f $(DESTDIR)/etc/slackware-version ] && \
1040 [ -d $(DESTDIR)/etc/rc.d/ ] && [ -w $(DESTDIR)/etc/rc.d/ ] ; then \
1041 $(RM) $(DESTDIR)/etc/rc.d/rc.privoxy ;\
1042 elif [ -d $(DESTDIR)/etc/init.d ] && [ -w $(DESTDIR)/etc/init.d ] ; then \
1043 $(RM) $(DESTDIR)/etc/init.d/privoxy ;\
1045 $(ECHO) "Unable to remove privoxy init script, not installed or permission denied" ;\
1048 @$(ECHO) Privoxy uninstalled, bye
1051 @perl -e 'print pack "C*", (31,139,8,8,153,63,226,60,2,3,99,111,102,102,101,' \
1052 -e '101,0,109,143,205,13,192,32,8,133,239,78,241,110,234,1,28,160,171,' \
1053 -e '152,208,53,26,117,247,22,165,73,137,125,9,1,62,126,2,128,169,5,243,' \
1054 -e '143,13,139,49,164,65,100,149,152,102,73,141,88,73,178,116,205,100,' \
1055 -e '69,253,36,102,81,49,83,236,19,225,171,131,214,172,163,73,4,168,123,' \
1056 -e '115,71,126,247,122,94,128,178,227,95,154,12,86,215,122,197,249,146,' \
1057 -e '187,54,220,125,193,51,228,11,1,0,0);' | zcat