LDAPAccountManager/lam-packaging/autoconf/Makefile.in

135 lines
3.5 KiB
Makefile
Raw Normal View History

2006-03-09 17:44:19 +00:00
#
# Tim Rice Wed Aug 10 10:36:25 PDT 2005
#
# Tim Rice <tim@multitalents.net>
#
SHELL = /bin/sh
# We'll use tar instead of install-sh to preserve time stamps
#INSTALL = @INSTALL@
LN_S = @LN_S@
CHMOD = @CHMOD@
CHOWN = @CHOWN@
COPY = @COPY_PROG@
GREP = @GREP@
ID = @ID@
MKDIR = @MKDIR@
PERL = @PERL_PATH@
RM = @RM@
TAR = @TAR@
prefix=@prefix@
exec_prefix=@exec_prefix@
2009-09-25 17:38:33 +00:00
sbindir=@sbindir@
datarootdir=@datarootdir@
2006-03-09 17:44:19 +00:00
sysconfdir=@sysconfdir@
localstatedir=@localstatedir@
mandir=@mandir@
2016-11-01 08:23:36 +00:00
docdir=@prefix@/docs
web_root=@WEB_ROOT@
2006-03-09 17:44:19 +00:00
srcdir=@srcdir@
top_srcdir=@top_srcdir@
VPATH=@srcdir@
top_builddir = .
HTTPD_USER = @HTTPD_USER@
HTTPD_GROUP = @HTTPD_GROUP@
DOCS = COPYING HISTORY README copyright docs/schema/dhcp.schema
2006-03-09 17:44:19 +00:00
HTML_DOCS = devel manual
2006-03-09 17:44:19 +00:00
2019-06-09 08:02:06 +00:00
LIST1 = graphics help index.html lib locale style templates VERSION pwa_worker.js
LIST2 = sess tmp tmp/internal
2006-03-09 17:44:19 +00:00
LIST3 = config
RAR = run-as-root.sh
all:
install: install-lam install-htdocs
install-lam:
@HERE=`pwd` ; \
[ -d $(DESTDIR)$(prefix) ] || \
$(MKDIR) -p $(DESTDIR)$(prefix) || exit 1 ; \
[ -d $(DESTDIR)$(web_root) ] || \
$(MKDIR) -p $(DESTDIR)$(web_root) || exit 1 ; \
2006-03-09 17:44:19 +00:00
[ -d $(DESTDIR)$(localstatedir) ] || \
$(MKDIR) -p $(DESTDIR)$(localstatedir) || exit 1 ; \
[ -d $(DESTDIR)$(sysconfdir) ] || \
$(MKDIR) -p $(DESTDIR)$(sysconfdir) || exit 1 ; \
cd $(DESTDIR)$(web_root) || exit 1 ; \
2006-03-09 17:44:19 +00:00
for i in $(LIST2) ; do \
[ -d $(DESTDIR)$(localstatedir)/$${i} ] || \
$(MKDIR) -p $(DESTDIR)$(localstatedir)/$${i} || exit 1 ; \
$(CHMOD) 750 $(DESTDIR)$(localstatedir)/$${i} ; \
2017-06-05 17:16:51 +00:00
[ -d $${i} ] || \
2006-03-09 17:44:19 +00:00
$(LN_S) $(localstatedir)/$${i} $${i} ; \
2009-09-25 17:38:33 +00:00
(cd $(srcdir) ; $(COPY) $${i}/.htaccess \
$(DESTDIR)$(localstatedir)/$${i}) ; \
2006-03-09 17:44:19 +00:00
done ; \
2016-10-09 08:37:35 +00:00
LIST4="`(cd $(srcdir)/$(LIST3) ; ls -d *)`" ; \
2006-03-09 17:44:19 +00:00
(cd $(srcdir)/$(LIST3) ; $(TAR) cf - .) | \
(cd $(DESTDIR)$(sysconfdir) ; $(TAR) xf -) ; \
$(LN_S) $(sysconfdir) ${LIST3} ; \
(cd $(srcdir) ; $(TAR) cf - $(LIST1)) | $(TAR) xf - ; \
[ -d $(DESTDIR)$(prefix)/docs ] || \
$(MKDIR) -p $(DESTDIR)$(prefix)/docs || exit 1 ; \
(cd $(srcdir) ; $(COPY) $(DOCS) $(DESTDIR)$(prefix)/docs) ; \
$(PERL) -pi -e "s~/usr/bin/perl~$(PERL)~" \
$(DESTDIR)$(web_root)/lib/lamdaemon.pl ; \
2006-03-09 17:44:19 +00:00
cd $${HERE} ; \
if [ `$(ID) -u` = 0 ] ; then \
$(MAKE) DESTDIR=$(DESTDIR) do-chown ; \
else \
$(MAKE) DESTDIR=$(DESTDIR) echo-chown ; \
2016-11-01 08:23:36 +00:00
fi ; \
echo "" ; \
echo "LAM installed in $(DESTDIR)$(prefix)"
2006-03-09 17:44:19 +00:00
do-chown:
@for i in $(LIST2) ; do \
2010-02-13 17:34:17 +00:00
$(CHOWN) $(HTTPD_USER):$(HTTPD_GROUP) $(DESTDIR)$(localstatedir)/$${i} ; \
2006-03-09 17:44:19 +00:00
done ; \
2016-10-09 08:37:35 +00:00
LIST4="`(cd $(srcdir)/$(LIST3) ; ls -d *)`" ; \
2006-03-09 17:44:19 +00:00
for i in $${LIST4} ; do \
2010-02-13 17:34:17 +00:00
$(CHOWN) -R $(HTTPD_USER):$(HTTPD_GROUP) $(DESTDIR)$(sysconfdir)/$${i} ; \
2006-03-09 17:44:19 +00:00
done
2016-10-09 08:45:21 +00:00
$(CHOWN) $(HTTPD_USER):$(HTTPD_GROUP) $(DESTDIR)$(sysconfdir)
2006-03-09 17:44:19 +00:00
echo-chown:
@$(RM) -f $(RAR) ; \
for i in $(LIST2) ; do \
2010-02-13 17:34:17 +00:00
echo "$(CHOWN) $(HTTPD_USER):$(HTTPD_GROUP) $(DESTDIR)$(localstatedir)/$${i}" \
2006-03-09 17:44:19 +00:00
>> $(RAR) ; \
done ; \
2016-10-09 08:37:35 +00:00
LIST4="`(cd $(srcdir)/$(LIST3) ; ls -d *)`" ; \
2006-03-09 17:44:19 +00:00
for i in $${LIST4} ; do \
2010-02-13 17:34:17 +00:00
echo "$(CHOWN) -R $(HTTPD_USER):$(HTTPD_GROUP) $(DESTDIR)$(sysconfdir)/$${i}" \
2006-03-09 17:44:19 +00:00
>> $(RAR) ; \
done ; \
2016-10-09 08:45:21 +00:00
echo $(CHOWN) $(HTTPD_USER):$(HTTPD_GROUP) $(DESTDIR)$(sysconfdir)
2006-03-09 17:44:19 +00:00
echo "Switch user to root and run $(RAR)"
install-htdocs:
2016-11-01 08:23:36 +00:00
@[ -d $(DESTDIR)$(docdir) ] || \
$(MKDIR) -p $(DESTDIR)$(docdir) || exit 1 ; \
(cd $(srcdir)/docs ; $(TAR) cf - $(HTML_DOCS)) | \
2016-11-01 08:23:36 +00:00
(cd $(DESTDIR)$(docdir) ; $(TAR) xf -) ; \
echo "Documentation installed in $(docdir)" ; \
echo ""
2006-03-09 17:44:19 +00:00
clean:
$(RM) -f $(RAR)
distclean: clean
$(RM) -f Makefile config.log config.status