1 | --- GNUmakefile.in.orig 2006-12-28 12:34:14.000000000 -0600 |
---|
2 | +++ GNUmakefile.in 2006-12-28 13:15:27.000000000 -0600 |
---|
3 | @@ -67,6 +67,8 @@ |
---|
4 | LOGS_DEST = $(VAR_DEST)/log/privoxy |
---|
5 | PIDS_DEST = $(VAR_DEST)/run |
---|
6 | |
---|
7 | +DESTDIR= |
---|
8 | + |
---|
9 | # if $prefix = /usr/local then the default CONFDEST change from |
---|
10 | # CONF_DEST = $(CONF_BASE) to CONF_DEST = $(CONF_BASE)/privoxy |
---|
11 | # by the target rule CONF_DEST |
---|
12 | @@ -246,7 +248,7 @@ |
---|
13 | CFLAGS = @CFLAGS@ @CPPFLAGS@ $(OTHER_CFLAGS) $(SPECIAL_CFLAGS) -Wall \ |
---|
14 | @STATIC_PCRE_ONLY@ -Ipcre |
---|
15 | |
---|
16 | -LDFLAGS = $(DEBUG_CFLAGS) $(SPECIAL_CFLAGS) |
---|
17 | +LDFLAGS = @LDFLAGS@ $(DEBUG_CFLAGS) $(SPECIAL_CFLAGS) |
---|
18 | |
---|
19 | |
---|
20 | ############################################################################# |
---|
21 | @@ -1086,23 +1088,23 @@ |
---|
22 | |
---|
23 | @$(ECHO) "Creating directories, and preparing $(PROGRAM_V) installation" |
---|
24 | $(CHMOD) $(DIR_MODE) $(MKDIR) |
---|
25 | - @$(MKDIR) $(SBIN_DEST) $(prefix) $(CONF_DEST) $(CONF_DEST)/templates $(SHARE_DEST) \ |
---|
26 | - $(LOG_DEST) $(PID_DEST) |
---|
27 | + @$(MKDIR) $(DESTDIR)$(SBIN_DEST) $(DESTDIR)$(prefix) $(DESTDIR)$(CONF_DEST) $(DESTDIR)$(CONF_DEST)/templates $(DESTDIR)$(SHARE_DEST) \ |
---|
28 | + $(DESTDIR)$(LOG_DEST) $(DESTDIR)$(PID_DEST) |
---|
29 | @# Install the executable binary, strip if invoked as install-strip |
---|
30 | @test -n "$(STRIP)" &&\ |
---|
31 | - $(ECHO) Installing $(PROGRAM) stripped executable to $(SBIN_DEST) ||\ |
---|
32 | - $(ECHO) Installing $(PROGRAM) executable to $(SBIN_DEST) |
---|
33 | - $(INSTALL) $(INSTALL_P) $(STRIP) $(PROGRAM) $(SBIN_DEST) |
---|
34 | + $(ECHO) Installing $(PROGRAM) stripped executable to $(DESTDIR)$(SBIN_DEST) ||\ |
---|
35 | + $(ECHO) Installing $(PROGRAM) executable to $(DESTDIR)$(SBIN_DEST) |
---|
36 | + $(INSTALL) $(INSTALL_P) $(STRIP) $(PROGRAM) $(DESTDIR)$(SBIN_DEST) |
---|
37 | |
---|
38 | @# Install the DOCS and man page. install-sh only does one file at a time. |
---|
39 | @# FIXME: only handles jpegs. |
---|
40 | -@if [ $(check_doc) = 0 ]; then \ |
---|
41 | - DOC=$(DOC_DEST) ;\ |
---|
42 | + DOC=$(DESTDIR)$(DOC_DEST) ;\ |
---|
43 | else \ |
---|
44 | - DOC=$(prefix)/doc/privoxy ;\ |
---|
45 | + DOC=$(DESTDIR)$(prefix)/doc/privoxy ;\ |
---|
46 | fi;\ |
---|
47 | $(MKDIR) $$DOC $$DOC/user-manual $$DOC/faq $$DOC/developer-manual \ |
---|
48 | - $$DOC/man-page $$DOC/images $(MAN_DEST) ;\ |
---|
49 | + $$DOC/man-page $$DOC/images $(DESTDIR)$(MAN_DEST) ;\ |
---|
50 | if [ -d "$(DOK_WEB)" ]; then \ |
---|
51 | $(ECHO) Installing FAQ, Manual, and other docs to $$DOC;\ |
---|
52 | for i in user-manual developer-manual faq; do \ |
---|
53 | @@ -1123,8 +1125,8 @@ |
---|
54 | $(INSTALL) $(INSTALL_T) $(DOK_WEB)/p_doc.css $$DOC/user-manual;\ |
---|
55 | fi |
---|
56 | @# Not all platforms support gzipped man pages. |
---|
57 | - @$(ECHO) Installing man page to $(MAN_DEST)/privoxy.1 |
---|
58 | - -$(INSTALL) $(INSTALL_T) privoxy.1 $(MAN_DEST)/privoxy.1 |
---|
59 | + @$(ECHO) Installing man page to $(DESTDIR)$(MAN_DEST)/privoxy.1 |
---|
60 | + -$(INSTALL) $(INSTALL_T) privoxy.1 $(DESTDIR)$(MAN_DEST)/privoxy.1 |
---|
61 | |
---|
62 | @# Change the config file default directories according to the configured ones |
---|
63 | @$(ECHO) Rewriting config for this installation |
---|
64 | @@ -1145,9 +1147,9 @@ |
---|
65 | @# Install the config support files. Test for root install, and abort |
---|
66 | @# if there is no privoxy user, and no other user was enabled during |
---|
67 | @# configure. Later, install init script if appropriate. |
---|
68 | - @$(ECHO) Installing templates to $(CONF_DEST)/templates |
---|
69 | + @$(ECHO) Installing templates to $(DESTDIR)$(CONF_DEST)/templates |
---|
70 | @for i in `find templates -type f`; do \ |
---|
71 | - $(INSTALL) $(INSTALL_T) $$i $(CONF_DEST)/templates ;\ |
---|
72 | + $(INSTALL) $(INSTALL_T) $$i $(DESTDIR)$(CONF_DEST)/templates ;\ |
---|
73 | done |
---|
74 | |
---|
75 | @# FIXME: group/user validation is overly convoluted. |
---|
76 | @@ -1185,36 +1187,36 @@ |
---|
77 | fi ;\ |
---|
78 | INSTALL_CONF="$(INSTALL_R)" ;\ |
---|
79 | fi ;\ |
---|
80 | - $(ECHO) Installing configuration files to $(CONF_DEST);\ |
---|
81 | + $(ECHO) Installing configuration files to $(DESTDIR)$(CONF_DEST);\ |
---|
82 | for i in $(CONFIGS); do \ |
---|
83 | if [ "$$i" = "default.action" ] || [ "$$i" = "default.filter" ] || [ "$$i" = "standard.action" ]; then \ |
---|
84 | - $(RM) $(CONF_DEST)/$$i ;\ |
---|
85 | + $(RM) $(DESTDIR)$(CONF_DEST)/$$i ;\ |
---|
86 | $(ECHO) Installing fresh $$i;\ |
---|
87 | - $(INSTALL) $$INSTALL_CONF $$i $(CONF_DEST) || exit 1;\ |
---|
88 | - elif [ -s "$(CONF_DEST)/$$i" ]; then \ |
---|
89 | + $(INSTALL) $$INSTALL_CONF $$i $(DESTDIR)$(CONF_DEST) || exit 1;\ |
---|
90 | + elif [ -s "$(DESTDIR)$(CONF_DEST)/$$i" ]; then \ |
---|
91 | $(ECHO) Installing $$i as $$i.new ;\ |
---|
92 | - $(INSTALL) $$INSTALL_CONF $$i $(CONF_DEST)/$$i.new || exit 1;\ |
---|
93 | + $(INSTALL) $$INSTALL_CONF $$i $(DESTDIR)$(CONF_DEST)/$$i.new || exit 1;\ |
---|
94 | NEW=1;\ |
---|
95 | else \ |
---|
96 | - $(INSTALL) $$INSTALL_CONF $$i $(CONF_DEST) || exit 1;\ |
---|
97 | + $(INSTALL) $$INSTALL_CONF $$i $(DESTDIR)$(CONF_DEST) || exit 1;\ |
---|
98 | fi ;\ |
---|
99 | done ;\ |
---|
100 | if [ -n "$$NEW" ]; then \ |
---|
101 | - $(CHMOD) $(RWD_MODE) $(CONF_DEST)/*.new || exit 1 ;\ |
---|
102 | + $(CHMOD) $(RWD_MODE) $(DESTDIR)$(CONF_DEST)/*.new || exit 1 ;\ |
---|
103 | $(ECHO) "Warning: Older config files are preserved. Check new versions for changes!" ;\ |
---|
104 | fi ;\ |
---|
105 | - [ ! -f $(LOG_DEST)/logfile ] && $(ECHO) Creating logfiles in $(LOG_DEST) || \ |
---|
106 | - $(ECHO) Checking logfiles in $(LOG_DEST) ;\ |
---|
107 | - $(TOUCH) $(LOG_DEST)/logfile $(LOG_DEST)/jarfile || exit 1 ;\ |
---|
108 | + [ ! -f $(DESTDIR)$(LOG_DEST)/logfile ] && $(ECHO) Creating logfiles in $(DESTDIR)$(LOG_DEST) || \ |
---|
109 | + $(ECHO) Checking logfiles in $(DESTDIR)$(LOG_DEST) ;\ |
---|
110 | + $(TOUCH) $(DESTDIR)$(LOG_DEST)/logfile $(DESTDIR)$(LOG_DEST)/jarfile || exit 1 ;\ |
---|
111 | if [ x$$USER != x ]; then \ |
---|
112 | - $(CHOWN) $$USER $(LOG_DEST)/logfile $(LOG_DEST)/jarfile || \ |
---|
113 | + $(CHOWN) $$USER $(DESTDIR)$(LOG_DEST)/logfile $(DESTDIR)$(LOG_DEST)/jarfile || \ |
---|
114 | $(ECHO) "** WARNING ** current install user different from configured user. Logging may fail!!" ;\ |
---|
115 | fi ;\ |
---|
116 | if [ x$$GROUP_T != x ]; then \ |
---|
117 | - $(CHGRP) $$GROUP_T $(LOG_DEST)/logfile $(LOG_DEST)/jarfile || \ |
---|
118 | + $(CHGRP) $$GROUP_T $(DESTDIR)$(LOG_DEST)/logfile $(DESTDIR)$(LOG_DEST)/jarfile || \ |
---|
119 | $(ECHO) "** WARNING ** current install user different from configured user. Logging may fail!!" ;\ |
---|
120 | fi ;\ |
---|
121 | - $(CHMOD) $(RWD_MODE) $(LOG_DEST)/logfile $(LOG_DEST)/jarfile || exit 1 ;\ |
---|
122 | + $(CHMOD) $(RWD_MODE) $(DESTDIR)$(LOG_DEST)/logfile $(DESTDIR)$(LOG_DEST)/jarfile || exit 1 ;\ |
---|
123 | if [ "$(prefix)" = "/usr/local" ] || [ "$(prefix)" = "/usr" ]; then \ |
---|
124 | if [ -f /etc/slackware-version ] && [ -d /etc/rc.d/ ] && [ -w /etc/rc.d/ ] ; then \ |
---|
125 | $(SED) 's+%PROGRAM%+$(PROGRAM)+' slackware/rc.privoxy.orig | \ |
---|
126 | @@ -1245,7 +1247,7 @@ |
---|
127 | $(RM) config.base config.tmp |
---|
128 | @# mmmmm, good. |
---|
129 | @$(ECHO) "$(PROGRAM_V) installation succeeded!" |
---|
130 | - @$(ECHO) "The Privoxy configuration files have been installed in $(CONF_DEST)" |
---|
131 | + @$(ECHO) "The Privoxy configuration files have been installed in $(DESTDIR)$(CONF_DEST)" |
---|
132 | |
---|
133 | # rmdir is used as a precaution since it will not remove non-empty |
---|
134 | # directories. RH init script creates lock file and pid file. |
---|