diff --git a/lam-packaging/autoconf/Makefile.in b/lam-packaging/autoconf/Makefile.in new file mode 100644 index 00000000..37f9bc15 --- /dev/null +++ b/lam-packaging/autoconf/Makefile.in @@ -0,0 +1,131 @@ +# +# Tim Rice Wed Aug 10 10:36:25 PDT 2005 +# +# Tim Rice +# +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@ +sysconfdir=@sysconfdir@ +localstatedir=@localstatedir@ +mandir=@mandir@ +htmldir=@prefix@/html + +srcdir=@srcdir@ +top_srcdir=@top_srcdir@ +VPATH=@srcdir@ +top_builddir = . + +HTTPD_USER = @HTTPD_USER@ +HTTPD_GROUP = @HTTPD_GROUP@ + +#INSTALL_PROGRAM = $(INSTALL) +#INSTALL_DATA = $(INSTALL) -m 644 +#INSTALL_SCRIPT = $(INSTALL) -m 755 + +DOCS = COPYING HISTORY INSTALL README TODO VERSION copyright \ + docs/README.Kolab.txt docs/README.fpdf.htm \ + docs/README.hosts.txt docs/README.lamdaemon.txt \ + docs/README.openldap.txt docs/README.schema.txt \ + docs/README.security.txt docs/README.upgrade.txt + +HTML_DOCS = docs/devel + +LIST1 = graphics help index.html lib locale style templates +LIST2 = sess tmp +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)$(localstatedir) ] || \ + $(MKDIR) -p $(DESTDIR)$(localstatedir) || exit 1 ; \ + [ -d $(DESTDIR)$(sysconfdir) ] || \ + $(MKDIR) -p $(DESTDIR)$(sysconfdir) || exit 1 ; \ + cd $(DESTDIR)$(prefix) || exit 1 ; \ + for i in $(LIST2) ; do \ + [ -d $(DESTDIR)$(localstatedir)/$${i} ] || \ + $(MKDIR) -p $(DESTDIR)$(localstatedir)/$${i} || exit 1 ; \ + $(CHMOD) 750 $(DESTDIR)$(localstatedir)/$${i} ; \ + $(LN_S) $(localstatedir)/$${i} $${i} ; \ + done ; \ + LIST4="`(cd $(srcdir)/$(LIST3) ; ls -d * | $(GREP) -v sample)`" ; \ + (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)$(prefix)/lib/lamdaemon.pl \ + $(DESTDIR)$(prefix)/docs/README.lamdaemon.txt ; \ + cd $${HERE} ; \ + echo "LAM files installed" ; \ + if [ `$(ID) -u` = 0 ] ; then \ + $(MAKE) DESTDIR=$(DESTDIR) do-chown ; \ + else \ + $(MAKE) DESTDIR=$(DESTDIR) echo-chown ; \ + fi + + +do-chown: + @for i in $(LIST2) ; do \ + $(CHOWN) $(HTTPD_USER) $(DESTDIR)$(localstatedir)/$${i} ; \ + done ; \ + LIST4="`(cd $(srcdir)/$(LIST3) ; ls -d * | $(GREP) -v sample)`" ; \ + for i in $${LIST4} ; do \ + $(CHOWN) -R $(HTTPD_USER) $(DESTDIR)$(sysconfdir)/$${i} ; \ + done + + +echo-chown: + @$(RM) -f $(RAR) ; \ + for i in $(LIST2) ; do \ + echo "$(CHOWN) $(HTTPD_USER) $(DESTDIR)$(localstatedir)/$${i}" \ + >> $(RAR) ; \ + done ; \ + LIST4="`(cd $(srcdir)/$(LIST3) ; ls -d * | $(GREP) -v sample)`" ; \ + for i in $${LIST4} ; do \ + echo "$(CHOWN) -R $(HTTPD_USER) $(DESTDIR)$(sysconfdir)/$${i}" \ + >> $(RAR) ; \ + done ; \ + echo "Switch user to root and run $(RAR)" + + +install-htdocs: + @[ -d $(DESTDIR)$(htmldir) ] || \ + $(MKDIR) -p $(DESTDIR)$(htmldir) || exit 1 ; \ + (cd $(srcdir)/$(HTML_DOCS) ; $(TAR) cf - .) | \ + (cd $(DESTDIR)$(htmldir) ; $(TAR) xf -) ; \ + echo "HTML docs installed in $(htmldir)" + + +clean: + $(RM) -f $(RAR) + + +distclean: clean + $(RM) -f Makefile config.log config.status + + diff --git a/lam-packaging/autoconf/configure.ac b/lam-packaging/autoconf/configure.ac new file mode 100644 index 00000000..47064b96 --- /dev/null +++ b/lam-packaging/autoconf/configure.ac @@ -0,0 +1,117 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. +# +# Tim Rice +# +# $Id$ +# +# Copyright (c) 2005, 2006 Tim Rice +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +AC_PREREQ(2.53) +AC_INIT(ldap-account-manager, 1.0.rc2, lam-public@lists.sourceforge.net) +AC_CONFIG_SRCDIR(INSTALL) +AC_PREFIX_DEFAULT(/usr/local/lam) + +# work around those that want to build in srcdir +if test x$srcdir = "x." ; then + exec $0 --srcdir=`pwd` $* +fi + +# Does make set variable $(MAKE) +AC_PROG_MAKE_SET + +# Checks for programs. +AC_PROG_LN_S +AC_PROG_INSTALL +AC_PATH_PROG(CHMOD, chmod) +AC_PATH_PROG(CHOWN, chown) +AC_PATH_PROG(GREP, grep) +AC_PATH_PROG(ID, id) +AC_PATH_PROG(MKDIR, mkdir) +AC_PATH_PROG(RM, rm) +AC_PATH_PROG(TAR, tar) + +# Find a sutable copy command +AC_PATH_PROG(COPY, copy) +AC_PATH_PROG(CP, cp) +if test x$COPY = x ; then + touch conf-cp-tst + $CP --preserve=timestamps conf-cp-tst conf-cp-tst2 2>/dev/null + if test -f conf-cp-tst2 ; then + COPY_PROG="$CP --preserve=timestamps" + rm conf-cp-tst2 + fi + rm conf-cp-tst +else + COPY_PROG="$COPY -m" +fi +AC_SUBST(COPY_PROG) + +HTTPD_USER=httpd +AC_ARG_WITH(httpd-user, + [ --with-httpd-user=user Specify the user your http daemon runs as. + default is http ], + [ + if test -n "$withval" && test "x$withval" != "xno" && \ + test "x${withval}" != "xyes"; then + HTTPD_USER=$withval + fi + ] +) +AC_SUBST(HTTPD_USER) + +HTTPD_GROUP=httpd +AC_ARG_WITH(httpd-group, + [ --with-httpd-group=group Specify the group your http daemon runs as. + default is http ], + [ + if test -n "$withval" && test "x$withval" != "xno" && \ + test "x${withval}" != "xyes"; then + HTTPD_GROUP=$withval + fi + ] +) +AC_SUBST(HTTPD_GROUP) + +AC_ARG_WITH(perl, + [ --with-perl=PATH Specify path to perl program ], + [ + if test -n "$withval" && test "x$withval" != "xno" && \ + test "x${withval}" != "xyes"; then + perl_path=$withval + fi + ], + [ +# We search these paths before $PATH to find a more up-to-date/capable +# version of perl than the system installed one. + TestPath="/opt/bin" + TestPath="${TestPath}${PATH_SEPARATOR}/opt/sfw/bin" + TestPath="${TestPath}${PATH_SEPARATOR}/usr/local/bin" + TestPath="${TestPath}${PATH_SEPARATOR}$PATH" + AC_PATH_PROGS(perl_path, perl5 perl, , $TestPath) + ] +) + +if test -z "$perl_path" ; then + PERL_PATH="/usr/bin/perl" + AC_MSG_WARN([*** lamdaemon.pl requires perl ***]) +else + PERL_PATH=$perl_path +fi +AC_SUBST(PERL_PATH) + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT +