Commit 53da7b6c authored by Ben Collins's avatar Ben Collins
Browse files

* build/top.mk: removed references to TMPROOT and added DESTDIR support

* all others: Added DESTDIR support
parent c87cb8b1
......@@ -26,17 +26,17 @@ all-common:
done
install-common:
-$(MKDIR) $(MANDIR)
-$(MKDIR) $(DESTDIR)$(MANDIR)
PAGES=`cd $(srcdir); echo *.$(MANSECT)`; \
for page in $$PAGES; do \
echo "installing $(MANDIR)/$$page"; \
$(RM) $(MANDIR)/$$page; \
$(INSTALL) $(INSTALLFLAGS) -m 644 $$page.$(TMP_SUFFIX) $(MANDIR)/$$page; \
$(RM) $(DESTDIR)$(MANDIR)/$$page; \
$(INSTALL) $(INSTALLFLAGS) -m 644 $$page.$(TMP_SUFFIX) $(DESTDIR)$(MANDIR)/$$page; \
if test -f "$(srcdir)/$$page.links" ; then \
for link in `$(CAT) $(srcdir)/$$page.links`; do \
echo "installing $(MANDIR)/$$link as link to $$page"; \
$(RM) $(MANDIR)/$$link ; \
$(LN_S) $$page $(MANDIR)/$$link; \
$(RM) $(DESTDIR)$(MANDIR)/$$link ; \
$(LN_S) $$page $(DESTDIR)$(MANDIR)/$$link; \
done; \
fi; \
done
......
......@@ -46,8 +46,8 @@ all-local-lib:
all-yes: $(LIBSTAT) all-local-lib FORCE
install-mod: $(LIBRARY)
@-$(MKDIR) $(moduledir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 $(LIBRARY) $(moduledir)
@-$(MKDIR) $(DESTDIR)$(moduledir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 $(LIBRARY) $(DESTDIR)$(moduledir)
install-local-lib:
install-yes: install-local-lib FORCE
......
......@@ -22,18 +22,18 @@ prefix = @prefix@
exec_prefix = @exec_prefix@
ldap_subdir = @ldap_subdir@
bindir = $(TMPROOT)@bindir@
datadir = $(TMPROOT)@datadir@$(ldap_subdir)
includedir = $(TMPROOT)@includedir@
infodir = $(TMPROOT)@infodir@
libdir = $(TMPROOT)@libdir@
libexecdir = $(TMPROOT)@libexecdir@
localstatedir = $(TMPROOT)@localstatedir@
mandir = $(TMPROOT)@mandir@
moduledir = $(TMPROOT)@libexecdir@$(ldap_subdir)
sbindir = $(TMPROOT)@sbindir@
sharedstatedir = $(TMPROOT)@sharedstatedir@
sysconfdir = $(TMPROOT)@sysconfdir@$(ldap_subdir)
bindir = @bindir@
datadir = @datadir@$(ldap_subdir)
includedir = @includedir@
infodir = @infodir@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
moduledir = @libexecdir@$(ldap_subdir)
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@$(ldap_subdir)
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
......
......@@ -32,7 +32,7 @@ xrpcomp.tmp: xrpcomp
$(SED) -e 's|%LIBEXECDIR%|$(libexecdir)|' $(srcdir)/xrpcomp > xrpcomp.tmp
install-local: $(PROGRAMS) FORCE
-$(MKDIR) $(libexecdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 rp500 $(libexecdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 fax500 $(libexecdir)
$(INSTALL) $(INSTALLFLAGS) -m 755 xrpcomp.tmp $(libexecdir)/xrpcomp
-$(MKDIR) $(DESTDIR)$(libexecdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 rp500 $(DESTDIR)$(libexecdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 fax500 $(DESTDIR)$(libexecdir)
$(INSTALL) $(INSTALLFLAGS) -m 755 xrpcomp.tmp $(DESTDIR)$(libexecdir)/xrpcomp
......@@ -19,5 +19,5 @@ version.c: ${OBJS} ${LDAP_LIBDEPEND}
$(MKVERSION) in.xfingerd > $@
install-local: $(PROGRAMS) FORCE
-$(MKDIR) $(libexecdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 in.xfingerd $(libexecdir)
-$(MKDIR) $(DESTDIR)$(libexecdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 in.xfingerd $(DESTDIR)$(libexecdir)
......@@ -30,8 +30,8 @@ gwversion.c: ${GWOBJS} $(LDAP_LIBDEPEND)
$(MKVERSION) go500gw > $@
install-local: $(PROGRAMS) go500gw.help FORCE
-$(MKDIR) $(libexecdir) $(datadir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 go500 $(libexecdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 go500gw $(libexecdir)
-$(MV) $(datadir)/go500gw.help $(datadir)/go500gw.help-
$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/go500gw.help $(datadir)
-$(MKDIR) $(DESTDIR)$(libexecdir) $(DESTDIR)$(datadir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 go500 $(DESTDIR)$(libexecdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 go500gw $(DESTDIR)$(libexecdir)
-$(MV) $(DESTDIR)$(datadir)/go500gw.help $(DESTDIR)$(datadir)/go500gw.help-
$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/go500gw.help $(DESTDIR)$(datadir)
......@@ -20,5 +20,5 @@ version.c: ${OBJS} $(LDAP_LIBDEPEND)
$(MKVERSION) mail500 > $@
install-local: $(PROGRAMS) FORCE
-$(MKDIR) $(libexecdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 mail500 $(libexecdir)
-$(MKDIR) $(DESTDIR)$(libexecdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 mail500 $(DESTDIR)$(libexecdir)
......@@ -20,7 +20,7 @@ version.c: ${OBJS} $(LDAP_LIBDEPEND)
$(MKVERSION) rcpt500 > $@
install-local: $(PROGRAMS) rcpt500.help FORCE
-$(MKDIR) $(libexecdir) $(datadir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 rcpt500 $(libexecdir)
-$(MV) $(datadir)/rcpt500.help $(datadir)/rcpt500.help-
$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/rcpt500.help $(datadir)
-$(MKDIR) $(DESTDIR)$(libexecdir) $(DESTDIR)$(datadir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 rcpt500 $(DESTDIR)$(libexecdir)
-$(MV) $(DESTDIR)$(datadir)/rcpt500.help $(DESTDIR)$(datadir)/rcpt500.help-
$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/rcpt500.help $(DESTDIR)$(datadir)
......@@ -55,11 +55,11 @@ ldrversion.c: ldapmodrdn.o $(LDAP_LIBDEPEND)
$(MKVERSION) ldapmodrdn > $@
install-local: FORCE
-$(MKDIR) $(bindir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 ldapsearch $(bindir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 ldapmodify $(bindir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 ldapdelete $(bindir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 ldapmodrdn $(bindir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 ldappasswd $(bindir)
$(RM) $(bindir)/ldapadd$(EXEEXT)
$(LN) $(bindir)/ldapmodify$(EXEEXT) $(bindir)/ldapadd$(EXEEXT)
-$(MKDIR) $(DESTDIR)$(bindir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 ldapsearch $(DESTDIR)$(bindir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 ldapmodify $(DESTDIR)$(bindir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 ldapdelete $(DESTDIR)$(bindir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 ldapmodrdn $(DESTDIR)$(bindir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 ldappasswd $(DESTDIR)$(bindir)
$(RM) $(DESTDIR)$(bindir)/ldapadd$(EXEEXT)
$(LN) ldapmodify$(EXEEXT) $(DESTDIR)$(bindir)/ldapadd$(EXEEXT)
......@@ -22,6 +22,6 @@ version.c: ${OBJS} $(LDAP_LIBDEPEND)
$(MKVERSION) -s -c -n Version UserDirectory > $@
install-local: FORCE
-$(MKDIR) $(bindir)
-mv -f $(bindir)/ud $(bindir)/ud-
$(LTINSTALL) $(INSTALLFLAGS) -m 755 ud $(bindir)
-$(MKDIR) $(DESTDIR)$(bindir)
-mv -f $(DESTDIR)$(bindir)/ud $(DESTDIR)$(bindir)/ud-
$(LTINSTALL) $(INSTALLFLAGS) -m 755 ud $(DESTDIR)$(bindir)
......@@ -21,24 +21,24 @@ exec_prefix = @exec_prefix@
# The following definition can be set to non-null for special systems
# like AFS with replication. It allows the pathnames used for installation
# to be different than those used for actually reference files at
# run-time. INSTALL_ROOT is prepended to $prefix and $exec_prefix
# run-time. DESTDIR is prepended to $prefix and $exec_prefix
# when installing files.
INSTALL_ROOT =
DESTDIR =
# Directory in which to search for tcl libraries
NEO_LIBRARY = $(exec_prefix)/lib/ldaptcl$(VERSION)
# Directory in which to install the ldaptcl binary:
BIN_INSTALL_DIR = $(INSTALL_ROOT)$(exec_prefix)/bin
BIN_INSTALL_DIR = $(DESTDIR)$(exec_prefix)/bin
# Directory in which to install the .a or .so binary for the Neo library:
LIB_INSTALL_DIR = $(INSTALL_ROOT)$(exec_prefix)/lib
LIB_INSTALL_DIR = $(DESTDIR)$(exec_prefix)/lib
# Path to use at runtime to refer to LIB_INSTALL_DIR:
LIB_RUNTIME_DIR = $(exec_prefix)/lib
# Top-level directory for man entries:
MANN_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/man/mann
MANN_INSTALL_DIR = $(DESTDIR)$(prefix)/man/mann
# The symbols below provide support for dynamic loading and shared
......
......@@ -17,7 +17,7 @@ saucer: ${OBJS} $(LDAP_LIBDEPEND)
$(LTLINK) -o $@ $(OBJS) $(LIBS)
install-local: $(PROGRAMS) FORCE
-$(MKDIR) $(bindir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 saucer $(bindir)
-test -d $(MANDIR) || $(MKDIR) $(mandir) $(MANDIR)
$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/saucer.1 $(MANDIR)/saucer.1
-$(MKDIR) $(DESTDIR)$(bindir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 saucer $(DESTDIR)$(bindir)
-$(MKDIR) $(DESTDIR)$(MANDIR)
$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/saucer.1 $(DESTDIR)$(MANDIR)/saucer.1
......@@ -13,6 +13,6 @@ web_ldap: ${OBJS} $(LDAP_LIBDEPEND)
$(LTLINK) -o $@ $(OBJS) $(LIBS)
install-local: $(PROGRAMS) FORCE
-test -d $(libexecdir) || $(MKDIR) $(libexecdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 web_ldap $(libexecdir)
-$(MKDIR) $(DESTDIR)$(libexecdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 web_ldap $(DESTDIR)$(libexecdir)
@echo ">> You must copy and edit web_ldap.cfg and web_ldap.html as needed. <<"
......@@ -60,16 +60,17 @@ whois++.o: whois++.c $(HDRS)
install: inst-whois++
inst-whois++: $(ETCDIR)/whois++d
-mkdir -p $(CONFIG_DIRECTORY)
cp -r templates $(CONFIG_DIRECTORY)
-mkdir -p $(HELP_DIRECTORY)
cp -r helpfiles/* $(HELP_DIRECTORY)
sed -e 's#ETCDIR#$(ETCDIR)#' whois++d.man > $(MANDIR)/man$(MANSEC)/whois++d.$(MANSEC)
inst-whois++: $(DESTDIR)$(ETCDIR)/whois++d
-$(MKDIR) $(DESTDIR)$(CONFIG_DIRECTORY)
cp -r templates $(DESTDIR)$(CONFIG_DIRECTORY)
-$(MKDIR) $(DESTDIR)$(HELP_DIRECTORY)
cp -r helpfiles/* $(DESTDIR)$(HELP_DIRECTORY)
-$(MKDIR) $(DESTDIR)$(DESTDIR)$(MANDIR)/man$(MANSEC)
sed -e 's#ETCDIR#$(ETCDIR)#' whois++d.man > $(DESTDIR)$(MANDIR)/man$(MANSEC)/whois++d.$(MANSEC)
@echo "Don't forget to modify and install the tailor file"
$(ETCDIR)/whois++d: whois++d
install -c -m 755 whois++d $(ETCDIR)
$(DESTDIR)$(ETCDIR)/whois++d: whois++d
install -c -m 755 whois++d $(DESTDIR)$(ETCDIR)
lint:;
lint $(SRCS)
......
......@@ -7,15 +7,12 @@
all-local: ldap_config.h FORCE
install-local: FORCE
-$(MKDIR) -p $(includedir)
$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/lber.h $(includedir)
$(INSTALL) $(INSTALLFLAGS) -m 644 lber_types.h $(includedir)
$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/ldap.h $(includedir)
$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/ldap_cdefs.h $(includedir)
$(INSTALL) $(INSTALLFLAGS) -m 644 ldap_features.h $(includedir)
$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/ldap_schema.h $(includedir)
$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/disptmpl.h $(includedir)
$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/srchpref.h $(includedir)
-$(MKDIR) $(DESTDIR)$(includedir)
for header in $(srcdir)/lber.h lber_types.h $(srcdir)/ldap.h \
$(srcdir)/ldap_cdefs.h ldap_features.h $(srcdir)/ldap_schema.h \
$(srcdir)/disptmpl.h $(srcdir)/srchpref.h; do \
$(INSTALL) $(INSTALLFLAGS) -m 644 $$header $(DESTDIR)$(includedir); \
done
clean-local: FORCE
$(RM) ldap_config.h
......
......@@ -30,6 +30,6 @@ idtest: $(LIBRARY) idtest.o
$(LTLINK) $(LDFLAGS) -o $@ idtest.o $(LIBS)
install-local: FORCE
-$(MKDIR) $(libdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 644 $(LIBRARY) $(libdir)
-$(MKDIR) $(DESTDIR)$(libdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 644 $(LIBRARY) $(DESTDIR)$(libdir)
......@@ -44,20 +44,20 @@ ttest: $(LIBRARY) tmpltest.o $(LDAP_LIBLBER_DEPEND)
CFFILES=ldap.conf ldapfilter.conf ldaptemplates.conf ldapsearchprefs.conf
install-local: $(CFFILES) FORCE
-$(MKDIR) $(libdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 644 $(LIBRARY) $(libdir)
-$(MKDIR) $(sysconfdir)
-$(MKDIR) $(DESTDIR)$(libdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 644 $(LIBRARY) $(DESTDIR)$(libdir)
-$(MKDIR) $(DESTDIR)$(sysconfdir)
@for i in $(CFFILES); do \
if test ! -f $(sysconfdir)/$$i; then \
if test ! -f $(DESTDIR)$(sysconfdir)/$$i; then \
echo "installing $$i in $(sysconfdir)"; \
echo "$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/$$i $(sysconfdir)/$$i"; \
$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/$$i $(sysconfdir)/$$i; \
echo "$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/$$i $(DESTDIR)$(sysconfdir)/$$i"; \
$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/$$i $(DESTDIR)$(sysconfdir)/$$i; \
else \
echo "PRESERVING EXISTING CONFIGURATION FILE $(sysconfdir)/$$i" ; \
fi; \
$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/$$i $(sysconfdir)/$$i.default; \
$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/$$i $(DESTDIR)$(sysconfdir)/$$i.default; \
done
-$(MKDIR) $(datadir)
-$(MV) $(datadir)/ldapfriendly $(datadir)/ldapfriendly-
$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/ldapfriendly $(datadir)/ldapfriendly
-$(MKDIR) $(DESTDIR)$(datadir)
-$(MV) $(DESTDIR)$(datadir)/ldapfriendly $(DESTDIR)$(datadir)/ldapfriendly-
$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/ldapfriendly $(DESTDIR)$(datadir)/ldapfriendly
......@@ -61,5 +61,5 @@ ttest: $(LIBRARY) tmpltest.o $(LDAP_LIBLBER_DEPEND)
$(LTLINK) $(LDFLAGS) -o $@ tmpltest.o $(LIBS)
install-local: $(CFFILES) FORCE
-$(MKDIR) $(libdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 644 $(LIBRARY) $(libdir)
-$(MKDIR) $(DESTDIR)$(libdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 644 $(LIBRARY) $(DESTDIR)$(libdir)
......@@ -48,5 +48,5 @@ LDAP_tables.c: ldap.py
LDAP-types.h: LDAP_tables.c
install-local-srv: FORCE
@-$(MKDIR) $(libexecdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 ldapd $(libexecdir)
-$(MKDIR) $(DESTDIR)$(libexecdir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 ldapd $(DESTDIR)$(libexecdir)
......@@ -113,9 +113,9 @@ veryclean-local-srv: FORCE
install-local-srv: install-slapd install-conf install-tools
install-slapd: FORCE
@-$(MKDIR) $(libexecdir)
@-$(MKDIR) $(localstatedir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 slapd $(libexecdir)
-$(MKDIR) $(DESTDIR)$(libexecdir)
-$(MKDIR) $(DESTDIR)$(localstatedir)
$(LTINSTALL) $(INSTALLFLAGS) -m 755 slapd $(DESTDIR)$(libexecdir)
@if [ ! -z "$(SLAPD_MODULES)" ]; then \
for i in back-* shell-backends tools; do \
if [ -d $$i ]; then \
......@@ -138,7 +138,7 @@ all-cffiles: slapd
touch all-cffiles
install-conf: FORCE
@-$(MKDIR) $(sysconfdir)
@-$(MKDIR) $(DESTDIR)$(sysconfdir)
@for i in $(CFFILES); do \
tmpcf=$$i.tmp ; \
if test $$i = slapd.conf ; then \
......@@ -146,17 +146,17 @@ install-conf: FORCE
else \
mode=644 ; \
fi ; \
if test ! -f $(sysconfdir)/$$i; then \
if test ! -f $(DESTDIR)$(sysconfdir)/$$i; then \
echo "installing $$i in $(sysconfdir)"; \
echo "$(INSTALL) $(INSTALLFLAGS) -m $$mode $$tmpcf $(sysconfdir)/$$i"; \
$(INSTALL) $(INSTALLFLAGS) -m $$mode $$tmpcf $(sysconfdir)/$$i; \
echo "$(INSTALL) $(INSTALLFLAGS) -m $$mode $$tmpcf $(DESTDIR)$(sysconfdir)/$$i"; \
$(INSTALL) $(INSTALLFLAGS) -m $$mode $$tmpcf $(DESTDIR)$(sysconfdir)/$$i; \
else \
echo "PRESERVING EXISTING CONFIGURATION FILE $(sysconfdir)/$$i" ; \
echo "PRESERVING EXISTING CONFIGURATION FILE $(DESTDIR)$(sysconfdir)/$$i" ; \
fi; \
$(INSTALL) $(INSTALLFLAGS) -m $$mode $$tmpcf $(sysconfdir)/$$i.default ; \
$(INSTALL) $(INSTALLFLAGS) -m $$mode $$tmpcf $(DESTDIR)$(sysconfdir)/$$i.default ; \
done
install-tools: FORCE
@-$(MKDIR) $(sbindir)
@-$(MKDIR) $(DESTDIR)$(sbindir)
(cd tools; $(MAKE) $(MFLAGS) install)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment