From ad0bbbb835fb6185a8b76cc5ae38dd0ec7209cc3 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Mon, 13 Jun 2011 13:31:53 +0100 Subject: [PATCH] Respect DESTDIR during the build process Add $(DESTDIR) to paths it is currently missing from Manually specify the apxs2 install location so that DESTDIR can be prepended Attempt to create the apache directory if it does not exist Signed-off-by: Ben Webb Signed-off-by: Dan Scott --- Open-ILS/src/Makefile.am | 16 ++++++++-------- Open-ILS/src/apachemods/Makefile.am | 6 ++++-- Open-ILS/src/perlmods/Makefile.am | 2 +- Open-ILS/web/Makefile.am | 4 ++-- Open-ILS/xul/staff_client/Makefile.am | 10 +++++----- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Open-ILS/src/Makefile.am b/Open-ILS/src/Makefile.am index 7d52ad5b24..e14f4c2426 100644 --- a/Open-ILS/src/Makefile.am +++ b/Open-ILS/src/Makefile.am @@ -150,7 +150,7 @@ EXTRA_DIST = @srcdir@/perlmods @srcdir@/templates @top_srcdir@/Open-ILS/xsl @src # Install header files -oilsincludedir = $(DESTDIR)@includedir@/openils +oilsincludedir = @includedir@/openils headsdir = @top_srcdir@/Open-ILS/include/openils oilsinclude_HEADERS = $(headsdir)/idl_fieldmapper.h $(headsdir)/oils_constants.h $(headsdir)/oils_event.h $(headsdir)/oils_idl.h $(headsdir)/oils_utils.h @@ -167,13 +167,13 @@ uninstall-hook: #perl-install and string-templates-install ilscore-install: @echo $@ - $(MKDIR_P) $(TEMPLATEDIR) - cp -r @srcdir@/templates/marc $(TEMPLATEDIR) - cp -r @srcdir@/templates/password-reset $(TEMPLATEDIR) - @echo "Installing string templates to $(TEMPLATEDIR)" - $(MKDIR_P) $(TEMPLATEDIR) - $(MKDIR_P) $(datadir)/overdue/ - cp -r @srcdir@/templates/strings $(TEMPLATEDIR) + $(MKDIR_P) $(DESTDIR)$(TEMPLATEDIR) + cp -r @srcdir@/templates/marc $(DESTDIR)$(TEMPLATEDIR) + cp -r @srcdir@/templates/password-reset $(DESTDIR)$(TEMPLATEDIR) + @echo "Installing string templates to $(DESTDIR)$(TEMPLATEDIR)" + $(MKDIR_P) $(DESTDIR)$(TEMPLATEDIR) + $(MKDIR_P) $(DESTDIR)$(datadir)/overdue/ + cp -r @srcdir@/templates/strings $(DESTDIR)$(TEMPLATEDIR) sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/oils_sip.xml.example' sed -i 's|SYSCONFDIR|@sysconfdir@|g' '$(DESTDIR)@sysconfdir@/oils_sip.xml.example' sed -i 's|LOCALSTATEDIR|@localstatedir@|g' '$(DESTDIR)@sysconfdir@/opensrf_core.xml.example' diff --git a/Open-ILS/src/apachemods/Makefile.am b/Open-ILS/src/apachemods/Makefile.am index 536087509b..dd1f938a01 100644 --- a/Open-ILS/src/apachemods/Makefile.am +++ b/Open-ILS/src/apachemods/Makefile.am @@ -6,6 +6,7 @@ AM_CFLAGS = -D_LARGEFILE64_SOURCE -Wall -I@abs_top_srcdir@/Open-ILS/include/ -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) -I$(APR_HEADERS) -I$(OPENSRF_HEADERS) AM_LDFLAGS = -L$(LIBDIR) -L$(OPENSRF_LIBS) +AP_LIBEXECDIR = `$(APXS2) -q LIBEXECDIR` if BUILDAPACHEMODS OILSAPACHEINST = apachemods @@ -14,10 +15,11 @@ endif install-exec-local: $(OILSAPACHEINST) apachemods: + $(MKDIR_P) $(DESTDIR)$(AP_LIBEXECDIR) $(APXS2) -c $(AM_LDFLAGS) -lxml2 -lopensrf -lxslt -lexpat $(AM_CFLAGS) @srcdir@/mod_xmlent.c - $(APXS2) -i -a @srcdir@/mod_xmlent.la + $(APXS2) -i -S LIBEXECDIR=$(DESTDIR)$(AP_LIBEXECDIR) -a @srcdir@/mod_xmlent.la $(APXS2) -c $(AM_LDFLAGS) -lxml2 -lopensrf -lxslt -lexpat $(AM_CFLAGS) @srcdir@/mod_idlchunk.c - $(APXS2) -i -a @srcdir@/mod_idlchunk.la + $(APXS2) -i -S LIBEXECDIR=$(DESTDIR)$(AP_LIBEXECDIR) -a @srcdir@/mod_idlchunk.la clean-local: rm -f @srcdir@/mod_xmlent.la @srcdir@/mod_xmlent.lo @srcdir@/mod_xmlent.slo diff --git a/Open-ILS/src/perlmods/Makefile.am b/Open-ILS/src/perlmods/Makefile.am index 0d27bfa316..4f492642a4 100644 --- a/Open-ILS/src/perlmods/Makefile.am +++ b/Open-ILS/src/perlmods/Makefile.am @@ -24,7 +24,7 @@ install: build-perl ./Build install build-perl: - perl Build.PL || make -s build-perl-fail + perl Build.PL --destdir $(DESTDIR) || make -s build-perl-fail build-perl-fail: echo diff --git a/Open-ILS/web/Makefile.am b/Open-ILS/web/Makefile.am index 6437c734db..38c7ac8fff 100644 --- a/Open-ILS/web/Makefile.am +++ b/Open-ILS/web/Makefile.am @@ -8,7 +8,7 @@ opacjsdir = $(DESTDIR)$(WEBDIR)/opac/common/js jsdojodir = $(DESTDIR)$(WEBDIR)/js/dojo jsdojoosrfdir = $(DESTDIR)$(WEBDIR)/js/dojo/opensrf opacextrasdir = $(DESTDIR)$(WEBDIR)/opac/extras/xsl/ -reportsdir = $(DESTDIR)$(WEBDIR)/reports/ +reportsdir = $(WEBDIR)/reports/ if BUILDILSWEB OILSWEB_INST = webcore-install offline-install @@ -63,7 +63,7 @@ offline-install: @echo "Installing offline CGIs to $(CGIDIR)/offline"; $(MKDIR_P) $(TMP) $(MKDIR_P) $(DESTDIR)$(CGIDIR)/offline; - $(MKDIR_P) $(datadir)/offline; + $(MKDIR_P) $(DESTDIR)$(datadir)/offline; perl -pe "s{##CONFIG##}{@sysconfdir@}" < @top_srcdir@/Open-ILS/src/offline/offline.pl > $(TMP)/offline.pl; cp $(TMP)/offline.pl $(DESTDIR)$(CGIDIR)/offline/ chmod +x $(DESTDIR)$(CGIDIR)/offline/offline.pl diff --git a/Open-ILS/xul/staff_client/Makefile.am b/Open-ILS/xul/staff_client/Makefile.am index 387d9b97ed..51a61c0efd 100644 --- a/Open-ILS/xul/staff_client/Makefile.am +++ b/Open-ILS/xul/staff_client/Makefile.am @@ -179,12 +179,12 @@ needwebdir: server-xul: needwebdir build @echo $@ - mkdir -p $(WEBDIR) - mkdir -p $(WEBDIR)/xul/ + mkdir -p $(DESTDIR)$(WEBDIR) + mkdir -p $(DESTDIR)$(WEBDIR)/xul/ @echo "STAMP_ID = $(STAFF_CLIENT_STAMP_ID)" - @echo "Copying xul into $(WEBDIR)/xul/$(STAFF_CLIENT_STAMP_ID)" - mkdir -p "$(WEBDIR)/xul/$(STAFF_CLIENT_STAMP_ID)" - cp -R @top_srcdir@/Open-ILS/xul/staff_client/build/server "${WEBDIR}/xul/${STAFF_CLIENT_STAMP_ID}/" + @echo "Copying xul into $(DESTDIR)$(WEBDIR)/xul/$(STAFF_CLIENT_STAMP_ID)" + mkdir -p "$(DESTDIR)$(WEBDIR)/xul/$(STAFF_CLIENT_STAMP_ID)" + cp -R @top_srcdir@/Open-ILS/xul/staff_client/build/server "$(DESTDIR)${WEBDIR}/xul/${STAFF_CLIENT_STAMP_ID}/" compress-javascript: build @echo "Size of build/ before compression = " `du -sh build/` -- 2.43.2