Skip to content

Commit e7e3b89

Browse files
author
Ryan Bloom
committed
Preserve existing installation directories. We copy over binaries,
the build directory, the headers, and the man pages. Everything else, the config, htdocs, manual, error, icons, and cgi directories are not installed if the directories already exist. I got sick of having to re-edit printenv for my tests, and this is the same logic 1.3 used. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95911 13f79535-47bb-0310-9956-ffa450edef68
1 parent df3550e commit e7e3b89

1 file changed

Lines changed: 97 additions & 73 deletions

File tree

Makefile.in

Lines changed: 97 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -27,61 +27,65 @@ include $(top_builddir)/build/rules.mk
2727
include $(top_srcdir)/build/program.mk
2828

2929
install-conf:
30-
@echo Installing configuration files
31-
@test -d $(DESTDIR)$(sysconfdir) || $(MKINSTALLDIRS) $(DESTDIR)$(sysconfdir)
32-
@cd $(top_srcdir)/docs/conf; \
33-
for i in mime.types magic; do \
34-
$(INSTALL_DATA) $$i $(DESTDIR)$(sysconfdir); \
35-
done; \
36-
for j in $(top_srcdir)/docs/conf $(top_builddir)/docs/conf ; do \
37-
cd $$j ; \
38-
for i in *-std*.conf ssl.conf; do \
39-
[ -f $$i ] || continue; \
40-
( \
41-
n_lm=`awk 'BEGIN {n=0} /@@LoadModule@@/ {n+=1} END {print n}' < $$i`; \
42-
if test $$n_lm -eq 0 -o "x$(DSO_MODULES)" = "x"; then \
43-
sed -e 's#@@ServerRoot@@#$(prefix)#g' \
44-
-e 's#@@Port@@#$(PORT)#g' \
45-
-e '/@@LoadModule@@/d' \
46-
< $$i; \
47-
else \
48-
sed -n -e '/@@LoadModule@@/q' \
49-
-e 's#@@ServerRoot@@#$(prefix)#g' \
50-
-e 's#@@Port@@#$(PORT)#g' \
51-
-e 'p' \
52-
< $$i; \
53-
for j in $(DSO_MODULES) "^EOL^"; do \
54-
if test "x$$j" = "xssl"; then \
55-
echo "<IfDefine SSL>"; \
56-
fi; \
57-
if test $$j != "^EOL^"; then \
58-
echo "LoadModule $${j}_module $(rel_libexecdir)/mod_$${j}.so"; \
59-
fi; \
60-
if test "x$$j" = "xssl"; then \
61-
echo "</IfDefine>"; \
62-
fi; \
63-
done; \
64-
sed -e '1,/@@LoadModule@@/d' \
65-
-e '/@@LoadModule@@/d' \
66-
-e 's#@@ServerRoot@@#$(prefix)#g' \
67-
-e 's#@@Port@@#$(PORT)#g' \
68-
< $$i; \
69-
fi \
70-
) > $(DESTDIR)$(sysconfdir)/$$i; \
71-
chmod 0644 $(DESTDIR)$(sysconfdir)/$$i; \
72-
file=`echo $$i|sed s/-std//`; \
73-
if [ "$$file" = "httpd.conf" ]; then \
74-
file=`echo $$file|sed s/.*.conf/$(PROGRAM_NAME).conf/`; \
75-
fi; \
76-
if test "$$file" != "$$i" && test ! -f $(DESTDIR)$(sysconfdir)/$$file; then \
77-
$(INSTALL_DATA) $(DESTDIR)$(sysconfdir)/$$i $(DESTDIR)$(sysconfdir)/$$file; \
78-
fi; \
79-
done ; \
80-
done
81-
@if test -f "$(builddir)/envvars-std"; then \
82-
cp -p envvars-std $(DESTDIR)$(sbindir); \
83-
if test ! -f $(DESTDIR)$(sbindir)/envvars; then \
84-
cp -p envvars-std $(DESTDIR)$(sbindir)/envvars ; \
30+
-@if [ -d $(DESTDIR)$(sysconfdir) ]; then \
31+
echo "[PRESERVING EXISTING CONF SUBDIR: $(DESTDIR)$(sysconfdir)]"; \
32+
else \
33+
echo Installing configuration files ; \
34+
$(MKINSTALLDIRS) $(DESTDIR)$(sysconfdir) ; \
35+
cd $(top_srcdir)/docs/conf; \
36+
for i in mime.types magic; do \
37+
$(INSTALL_DATA) $$i $(DESTDIR)$(sysconfdir); \
38+
done; \
39+
for j in $(top_srcdir)/docs/conf $(top_builddir)/docs/conf ; do \
40+
cd $$j ; \
41+
for i in *-std*.conf ssl.conf; do \
42+
[ -f $$i ] || continue; \
43+
( \
44+
n_lm=`awk 'BEGIN {n=0} /@@LoadModule@@/ {n+=1} END {print n}' < $$i`; \
45+
if test $$n_lm -eq 0 -o "x$(DSO_MODULES)" = "x"; then \
46+
sed -e 's#@@ServerRoot@@#$(prefix)#g' \
47+
-e 's#@@Port@@#$(PORT)#g' \
48+
-e '/@@LoadModule@@/d' \
49+
< $$i; \
50+
else \
51+
sed -n -e '/@@LoadModule@@/q' \
52+
-e 's#@@ServerRoot@@#$(prefix)#g' \
53+
-e 's#@@Port@@#$(PORT)#g' \
54+
-e 'p' \
55+
< $$i; \
56+
for j in $(DSO_MODULES) "^EOL^"; do \
57+
if test "x$$j" = "xssl"; then \
58+
echo "<IfDefine SSL>"; \
59+
fi; \
60+
if test $$j != "^EOL^"; then \
61+
echo "LoadModule $${j}_module $(rel_libexecdir)/mod_$${j}.so"; \
62+
fi; \
63+
if test "x$$j" = "xssl"; then \
64+
echo "</IfDefine>"; \
65+
fi; \
66+
done; \
67+
sed -e '1,/@@LoadModule@@/d' \
68+
-e '/@@LoadModule@@/d' \
69+
-e 's#@@ServerRoot@@#$(prefix)#g' \
70+
-e 's#@@Port@@#$(PORT)#g' \
71+
< $$i; \
72+
fi \
73+
) > $(DESTDIR)$(sysconfdir)/$$i; \
74+
chmod 0644 $(DESTDIR)$(sysconfdir)/$$i; \
75+
file=`echo $$i|sed s/-std//`; \
76+
if [ "$$file" = "httpd.conf" ]; then \
77+
file=`echo $$file|sed s/.*.conf/$(PROGRAM_NAME).conf/`; \
78+
fi; \
79+
if test "$$file" != "$$i" && test ! -f $(DESTDIR)$(sysconfdir)/$$file; then \
80+
$(INSTALL_DATA) $(DESTDIR)$(sysconfdir)/$$i $(DESTDIR)$(sysconfdir)/$$file; \
81+
fi; \
82+
done ; \
83+
done ; \
84+
if test -f "$(builddir)/envvars-std"; then \
85+
cp -p envvars-std $(DESTDIR)$(sbindir); \
86+
if test ! -f $(DESTDIR)$(sbindir)/envvars; then \
87+
cp -p envvars-std $(DESTDIR)$(sbindir)/envvars ; \
88+
fi ; \
8589
fi ; \
8690
fi
8791

@@ -103,30 +107,50 @@ dox::
103107
doxygen $(top_srcdir)/docs/doxygen.conf
104108

105109
install-htdocs:
106-
@echo Installing HTML documents
107-
@test -d $(DESTDIR)$(htdocsdir) || $(MKINSTALLDIRS) $(DESTDIR)$(htdocsdir)
108-
@test -d $(htdocs-srcdir) && (cd $(htdocs-srcdir) && cp -rp * $(DESTDIR)$(htdocsdir))
109-
@test -d $(DESTDIR)$(manualdir) || $(MKINSTALLDIRS) $(DESTDIR)$(manualdir)
110-
@test -d $(top_srcdir)/docs/manual && (cd $(top_srcdir)/docs/manual && cp -rp * $(DESTDIR)$(manualdir))
111-
-@test "x$(htdocsdir)" != "x" && cd $(DESTDIR)$(htdocsdir) && find . -name "CVS" -print | xargs rm -rf
110+
-@if [ -d $(DESTDIR)$(htdocsdir) ]; then \
111+
echo "[PRESERVING EXISTING HTDOCS SUBDIR: $(DESTDIR)$(htdocsdir)]"; \
112+
else \
113+
@echo Installing HTML documents ; \
114+
$(MKINSTALLDIRS) $(DESTDIR)$(htdocsdir) ; \
115+
@test -d $(htdocs-srcdir) && (cd $(htdocs-srcdir) && cp -rp * $(DESTDIR)$(htdocsdir)) ; \
116+
fi
117+
-@if [ -d $(DESTDIR)$(manualdir) ]; then \
118+
echo "[PRESERVING EXISTING MANUAL SUBDIR: $(DESTDIR)$(manualdir)]"; \
119+
else \
120+
$(MKINSTALLDIRS) $(DESTDIR)$(manualdir) ; \
121+
@test -d $(top_srcdir)/docs/manual && (cd $(top_srcdir)/docs/manual && cp -rp * $(DESTDIR)$(manualdir)) ; \
122+
-@test "x$(htdocsdir)" != "x" && cd $(DESTDIR)$(htdocsdir) && find . -name "CVS" -print | xargs rm -rf ; \
123+
fi
112124

113125
install-error:
114-
@echo Installing error documents
115-
@test -d $(DESTDIR)$(errordir) || $(MKINSTALLDIRS) $(DESTDIR)$(errordir)
116-
@cd $(top_srcdir)/docs/error && cp -rp * $(DESTDIR)$(errordir)
117-
-@test "x$(errordir)" != "x" && cd $(DESTDIR)$(errordir) && find . -name "CVS" -print | xargs rm -rf
126+
-@if [ -d $(DESTDIR)$(errordir) ]; then \
127+
echo "[PRESERVING EXISTING ERROR SUBDIR: $(DESTDIR)$(errordir)]"; \
128+
else \
129+
@echo Installing error documents ; \
130+
$(MKINSTALLDIRS) $(DESTDIR)$(errordir) ; \
131+
@cd $(top_srcdir)/docs/error && cp -rp * $(DESTDIR)$(errordir) ; \
132+
-@test "x$(errordir)" != "x" && cd $(DESTDIR)$(errordir) && find . -name "CVS" -print | xargs rm -rf ; \
133+
fi
118134

119135
install-icons:
120-
@echo Installing icons
121-
@test -d $(DESTDIR)$(iconsdir) || $(MKINSTALLDIRS) $(DESTDIR)$(iconsdir)
122-
@cd $(top_srcdir)/docs/icons && cp -rp * $(DESTDIR)$(iconsdir)
123-
-@test "x$(iconsdir)" != "x" && cd $(DESTDIR)$(iconsdir) && find . -name "CVS" -print | xargs rm -rf
136+
-@if [ -d $(DESTDIR)$(iconsdir) ]; then \
137+
echo "[PRESERVING EXISTING ICONS SUBDIR: $(DESTDIR)$(iconsdir)]"; \
138+
else \
139+
@echo Installing icons ; \
140+
$(MKINSTALLDIRS) $(DESTDIR)$(iconsdir) ; \
141+
@cd $(top_srcdir)/docs/icons && cp -rp * $(DESTDIR)$(iconsdir) ; \
142+
-@test "x$(iconsdir)" != "x" && cd $(DESTDIR)$(iconsdir) && find . -name "CVS" -print | xargs rm -rf ; \
143+
fi
124144

125145
install-cgi:
126-
@echo Installing CGIs
127-
@test -d $(DESTDIR)$(cgidir) || $(MKINSTALLDIRS) $(DESTDIR)$(cgidir)
128-
@cd $(top_srcdir)/docs/cgi-examples && cp -rp * $(DESTDIR)$(cgidir)
129-
-@test "x$(cgidir)" != "x" && cd $(DESTDIR)$(cgidir) && find . -name "CVS" -print | xargs rm -rf
146+
-@if [ -d $(DESTDIR)$(cgidir) ];then \
147+
echo "[PRESERVING EXISTING CGI SUBDIR: $(DESTDIR)$(cgidir)]"; \
148+
else \
149+
@echo Installing CGIs ; \
150+
$(MKINSTALLDIRS) $(DESTDIR)$(cgidir) ; \
151+
@cd $(top_srcdir)/docs/cgi-examples && cp -rp * $(DESTDIR)$(cgidir) ; \
152+
test "x$(cgidir)" != "x" && cd $(DESTDIR)$(cgidir) && find . -name "CVS" -print | xargs rm -rf ; \
153+
fi
130154

131155
install-other:
132156
@test -d $(DESTDIR)$(logfiledir) || $(MKINSTALLDIRS) $(DESTDIR)$(logfiledir)

0 commit comments

Comments
 (0)