ispman Makefile,1.63,1.64
Joerg Delker <[email protected]>
| Newsgroups | gmane.comp.isp.ispman.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/ispman/ispman
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv931
Modified Files:
Makefile
Log Message:
Stipped down Makefile
Index: Makefile
===================================================================
RCS file: /cvsroot/ispman/ispman/Makefile,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- Makefile 7 Jul 2004 20:20:02 -0000 1.63
+++ Makefile 1 Aug 2004 21:26:55 -0000 1.64
@@ -1,199 +1,148 @@
-MODULES=DISTFILES INSTALL Makefile LICENSE VERSION ispman-web install-data scripts
-CVS_TAG=rel_1_1
VERSION=cat VERSION
-ISPMAN_DIRS=bin lib conf htdocs cgi-bin docs templates var
-APACHE_VERSION=1.3.24
-
+INSTALL=./install-sh
+DESTDIR=
include makedefs
+
first: default
-default:
- @clear
- @cat Makefile.README
-
-ispman: directories make schema ldif
+default: ispman
+# generate schema files
schema:
- cd install-data/schema; make all
- cp install-data/schema/ispman.schema tmp/conf/schema/
- cp install-data/schema/dnszone.schema tmp/conf/schema/
- cp install-data/schema/pureftpd.schema tmp/conf/schema/
- cp install-data/schema/RADIUS-LDAPv3.schema tmp/conf/schema/
- @echo Copying pureftpd.schema, dnszone.schema, RADIUS-LDAPv3.schema and ispman.schema
- @echo to tmp/conf/schema/. Please copy them to your schema directory
-
-
-sources:
- @test -e sources || mkdir sources 2>/dev/null
-
-download:
- @test -e sources || mkdir sources 2>/dev/null
- @test -e sources/apache_$(APACHE_VERSION).tar.gz || (cd sources; wget http://httpd.apache.org/dist/httpd/apache_$(APACHE_VERSION).tar.gz)
-
-
-
-untar:
- test -e build || mkdir build;
- rm -rf build/apache_$(APACHE_VERSION)
- cd build; gzip -dc ../sources/apache_$(APACHE_VERSION).tar.gz | tar -xf -
-
-apache_for_ispman:
- #cp install-data/extras/mod_ldap/mod_ldap.c.orig build/apache_$(APACHE_VERSION)/src/modules/extra/mod_ldap.c
- @echo Nuking apache_$(APACHE_VERSION)/htdocs/ and apache_$(APACHE_VERSION)/cgi-bin/
- rm -rf build/apache_$(APACHE_VERSION)/htdocs/* build/apache_$(APACHE_VERSION)/cgi-bin/*
- cd build/apache_$(APACHE_VERSION); \
- ./configure --prefix=$(ISPMAN_INSTALL_PATH)\
- --enable-module=so
- cd build/apache_$(APACHE_VERSION); make install
+ make -C install-data/schema all
-ispman_web_server: download untar apache_for_ispman
+# generate prime-ldif
+ldif:
+ make -C install-data/ldifs all
+# install schema files
+install-schema:
+ @echo Installing LDAP schema files
+ make -C install-data/schema install
-directories:
- mkdir -p tmp/ldif tmp/conf tmp/templates tmp/conf/schema
- chmod 700 tmp
-make:
- @perl scripts/make.pl
- @perl scripts/subs.pl install-data/ldap.ldapv3.conf.tmpl > tmp/conf/ldap.conf
- @perl scripts/subs.pl install-data/ldap.ldapv2.conf.tmpl > tmp/conf/ldap.openldap1.conf
- @perl scripts/subs.pl install-data/slapd.ldapv3.conf.tmpl > tmp/conf/slapd.conf
- @perl scripts/subs.pl install-data/slapd.ldapv2.conf.tmpl > tmp/conf/slapd.openldap1.conf
- @perl scripts/subs.pl install-data/pureftpd-ldap.conf > tmp/conf/pureftpd-ldap.conf
- cd install-data/ldifs/; make
- @cat install-data/ispman.config >> tmp/conf/ispman.conf
- @cat install-data/ldifs/ispmanVarSort.conf >> tmp/conf/ispman.conf
- @echo '1;' >> tmp/conf/ispman.conf
+# install prime-ldif
+install-ldif:
+ @echo Installing prime LDIF file
+ make -C install-data/ldifs install
+# prepare ispman files
+ispman: schema ldif
+# install base files
+install-base: install-base-dirs install-schema install-ldif
+ @echo "ISPMan Base Files"
+ @echo "-----------------"
+ $(INSTALL) -c VERSION $(DESTDIR)$(PREFIX)
-distro: docs
- mkdir -p dist/ispman-`cat VERSION`;
- cp -fa `cat DISTFILES` dist/ispman-`cat VERSION`
- cd dist; find . -type f -name Root | awk '{print "echo :pserver:[email protected]:/cvsroot/ispman > "$$1}' | sh
- cd dist; tar czf ispman-`cat ../VERSION`.tar.gz ispman-`cat ../VERSION`
- rm -rf ispman-web/htdocs/docs
+ @cat install-data/ispman.config install-data/ldifs/ispmanVarSort.conf \
+ > install-data/ispman.conf
+ @echo '1;' >> install-data/ispman.conf
+ $(INSTALL) -m 640 install-data/ispman.conf $(DESTDIR)$(PREFIX)/conf/ispman.conf.example
+ $(INSTALL) -c install-data/nls.conf $(DESTDIR)$(PREFIX)/conf
+ $(INSTALL) -c lib/ISPMan.pm $(DESTDIR)$(PREFIX)/lib
+ $(INSTALL) -c lib/CustomerMan.pm $(DESTDIR)$(PREFIX)/lib
+ $(INSTALL) -c lib/cyrusadmin.pm $(DESTDIR)$(PREFIX)/lib
+ @list="`find lib/ISPMan lib/CustomerMan -name \*.pm` lib/*.lib"; \
+ for p in $$list; do \
+ echo "$(INSTALL) -c $$p $(DESTDIR)$(PREFIX)/$$p"; \
+ $(INSTALL) -c $$p $(DESTDIR)$(PREFIX)/$$p; \
+ done
+ @list="`find install-data/templates -type f | grep -v CVS | grep -v '/\.'`"; \
+ for p in $$list; do \
+ echo "$(INSTALL) -c $$p $(DESTDIR)$(PREFIX)/templates"; \
+ $(INSTALL) -c $$p $(DESTDIR)$(PREFIX)/templates; \
+ done
-ldif:
- @perl scripts/subs.pl install-data/ldifs/base.ldif >tmp/ldif/ispman.ldif
- @perl scripts/subs.pl install-data/ldifs/conf.ldif >>tmp/ldif/ispman.ldif
- @perl scripts/subs.pl install-data/ldifs/conf.apache_vars.ldif >>tmp/ldif/ispman.ldif
- @perl scripts/subs.pl install-data/ldifs/conf.ftp_vars.ldif >>tmp/ldif/ispman.ldif
- @perl scripts/subs.pl install-data/ldifs/conf.dns_vars.ldif >>tmp/ldif/ispman.ldif
- @perl scripts/subs.pl install-data/ldifs/conf.ldap_vars.ldif >>tmp/ldif/ispman.ldif
- @perl scripts/subs.pl install-data/ldifs/conf.mail_vars.ldif >>tmp/ldif/ispman.ldif
- @perl scripts/subs.pl install-data/ldifs/conf.sys_vars.ldif >>tmp/ldif/ispman.ldif
- @perl scripts/subs.pl install-data/ldifs/conf.account_vars.ldif >>tmp/ldif/ispman.ldif
- @perl scripts/subs.pl install-data/ldifs/counters.ldif >>tmp/ldif/ispman.ldif
- @perl scripts/subs.pl install-data/ldifs/hosts.ldif >>tmp/ldif/ispman.ldif
- @perl scripts/subs.pl install-data/ldifs/dns.ldif >>tmp/ldif/ispman.ldif
- @perl scripts/subs.pl install-data/ldifs/hostgroups.ldif >>tmp/ldif/ispman.ldif
- @perl scripts/subs.pl install-data/ldifs/domainServices.ldif >>tmp/ldif/ispman.ldif
- @perl scripts/subs.pl install-data/ldifs/radiusprofiles.ldif >>tmp/ldif/ispman.ldif
- @perl scripts/subs.pl install-data/ldifs/processes.ldif >>tmp/ldif/ispman.ldif
- @perl scripts/fixldif.pl tmp/ldif/ispman.ldif >tmp/ispman.ldif
- @mv -f tmp/ispman.ldif tmp/ldif/ispman.ldif
+# install cli and agent binaries
+install-bin: install-base
+ @echo "ISPMan binaries"
+ @echo "---------------"
+ @list="`find bin -type f | grep -v CVS | grep -v '/\.'`"; \
+ for p in $$list; do \
+ echo "$(INSTALL) -c -m 750 $$p $(DESTDIR)$(PREFIX)/$$p"; \
+ $(INSTALL) -c -m 750 $$p $(DESTDIR)$(PREFIX)/$$p; \
+ done
-cvs-install:
- @echo press enter to continue when asked for a password
- @cvs -d:pserver:[email protected]:/cvsroot/ispman login
- @cvs -z3 -d:pserver:[email protected]:/cvsroot/ispman co -r $(CVS_TAG) $(MODULES)
-
+# install files for web UI
+install-web: install-base
+ @echo "ISPMan web interface"
+ @echo "--------------------"
+ @list="`find locale -type f | grep -v CVS | grep -v '/\.'`"; \
+ for p in $$list; do \
+ echo "$(INSTALL) -c $$p $(DESTDIR)$(PREFIX)/$$p"; \
+ $(INSTALL) -c $$p $(DESTDIR)$(PREFIX)/$$p; \
+ done
-ldif-install:
- perl scripts/ldif2ldap -h ` perl scripts/getvar.pl ldapHost ` \
- -D "` perl scripts/getvar.pl ldapRootDN `" \
- -w ` perl scripts/getvar.pl ldapRootPass ` -f tmp/ldif/ispman.ldif 2>&1 | tee ldif-install.out
-
-
-v2tov3-update-data:
- perl scripts/ldif2ldap -h ` perl scripts/getvar.pl ldapHost ` \
- -D "` perl scripts/getvar.pl ldapRootDN `" \
- -w ` perl scripts/getvar.pl ldapRootPass ` -f tmp/ldif/update.ldif 2>&1 | tee v2tov3-update-data.out
-
-
+ @list="`find ispman-web/htdocs -type f | grep -v CVS | grep -v '/\.'`"; \
+ for p in $$list; do \
+ echo "$(INSTALL) -c $$p $(DESTDIR)$(PREFIX)/`echo $$p|sed 's/ispman-web\///'`"; \
+ $(INSTALL) -c $$p $(DESTDIR)$(PREFIX)/`echo $$p|sed 's/ispman-web\///'`; \
+ done
-clean:
- rm -rf tmp
- rm -f pod2*
+ @list="`find ispman-web/cgi-bin -type f | grep -v CVS | grep -v '/\.'`"; \
+ for p in $$list; do \
+ echo "$(INSTALL) -c $$p $(DESTDIR)$(PREFIX)/`echo $$p|sed 's/ispman-web\///'`"; \
+ $(INSTALL) -c $$p $(DESTDIR)$(PREFIX)/`echo $$p|sed 's/ispman-web\///'`; \
+ done
-snapshot:
- cd ..; tar cvzf ispman.sourceforge.net/download/ispman.snapshot.`date +"%Y-%m-%d" `.tar.gz ispman
+ $(INSTALL) -c -m 755 ispman-web/htdocs/admin/index.cgi \
+ $(DESTDIR)$(PREFIX)/htdocs/admin/index.cgi
+ $(INSTALL) -c -m 755 ispman-web/htdocs/control_panel/index.cgi \
+ $(DESTDIR)$(PREFIX)/htdocs/control_panel/index.cgi
-docs:
- @mkdir -p ISPMan
- @cp lib/ISPMan.pm ISPMan/
- @cp -r lib/ISPMan ISPMan/
- @mkdir -p ispman-web/htdocs/docs/API
- @perl scripts/makedocs `pwd`
- @rm -rf tmp/pod/
- @rm -rf ISPMan
+# create base directories
+install-base-dirs:
+ $(INSTALL) -d -m 750 $(DESTDIR)$(PREFIX)
+ $(INSTALL) -d -m 750 $(DESTDIR)$(PREFIX)/conf
+ $(INSTALL) -d $(DESTDIR)$(PREFIX)/lib
+ $(INSTALL) -d $(DESTDIR)$(PREFIX)/templates
+ $(INSTALL) -d $(DESTDIR)$(PREFIX)/var
-install_ispman_common:
- test -d $(ISPMAN_INSTALL_PATH) || mkdir $(ISPMAN_INSTALL_PATH) 2>/dev/null
- test -d $(ISPMAN_INSTALL_PATH)/bin || mkdir $(ISPMAN_INSTALL_PATH)/bin 2>/dev/null
- test -d $(ISPMAN_INSTALL_PATH)/lib || mkdir $(ISPMAN_INSTALL_PATH)/lib 2>/dev/null
- test -d $(ISPMAN_INSTALL_PATH)/conf || mkdir $(ISPMAN_INSTALL_PATH)/conf 2>/dev/null
- test -d $(ISPMAN_INSTALL_PATH)/var || mkdir $(ISPMAN_INSTALL_PATH)/var 2>/dev/null
- test -d $(ISPMAN_INSTALL_PATH)/templates || mkdir $(ISPMAN_INSTALL_PATH)/templates 2>/dev/null
- test -d $(ISPMAN_INSTALL_PATH)/locale || mkdir $(ISPMAN_INSTALL_PATH)/locale 2>/dev/null
- cp VERSION $(ISPMAN_INSTALL_PATH)/
- cp -r lib/* $(ISPMAN_INSTALL_PATH)/lib/
- cp -r bin/* $(ISPMAN_INSTALL_PATH)/bin/
- cp -r locale/* $(ISPMAN_INSTALL_PATH)/locale/
- cp -r install-data/templates/* $(ISPMAN_INSTALL_PATH)/templates/ 2>/dev/null
- cp -r tmp/conf/ispman.conf $(ISPMAN_INSTALL_PATH)/conf/ 2>/dev/null
- cp -r install-data/nls.conf $(ISPMAN_INSTALL_PATH)/conf/ 2>/dev/null
- chmod 755 $(ISPMAN_INSTALL_PATH)/bin/*
- test -f $(ISPMAN_INSTALL_PATH)/bin/ispman.domainmail && chmod 700 $(ISPMAN_INSTALL_PATH)/bin/ispman.domainmail || true
- test -f $(ISPMAN_INSTALL_PATH)/bin/ispman.listAdmins && chmod 700 $(ISPMAN_INSTALL_PATH)/bin/ispman.listAdmins || true
- test -f $(ISPMAN_INSTALL_PATH)/bin/ispman.addAdmin && chmod 700 $(ISPMAN_INSTALL_PATH)/bin/ispman.addAdmin || true
- test -f $(ISPMAN_INSTALL_PATH)/bin/ispman.deleteAdmin && chmod 700 $(ISPMAN_INSTALL_PATH)/bin/ispman.deleteAdmin || true
- test -d $(ISPMAN_INSTALL_PATH)/build || mkdir $(ISPMAN_INSTALL_PATH)/build 2>/dev/null
- bash -c "test $(ISPMAN_INSTALL_PATH)/build/ -ef ." || cp -r . $(ISPMAN_INSTALL_PATH)/build/
- chmod 700 $(ISPMAN_INSTALL_PATH)/build/
- @bash -c "test $(ISPMAN_INSTALL_PATH)/build/ -ef ." || echo ------ PLEASE NOTE --------
- @bash -c "test $(ISPMAN_INSTALL_PATH)/build/ -ef ." || echo This source directory is now copied to $(ISPMAN_INSTALL_PATH)/build/
- @bash -c "test $(ISPMAN_INSTALL_PATH)/build/ -ef ." || echo You can now delete the current directory and keep $(ISPMAN_INSTALL_PATH)/build/
- @bash -c "test $(ISPMAN_INSTALL_PATH)/build/ -ef ." || echo for future updates
+# create cli/agent directories
+install-bin-dirs: install-base-dirs
+ $(INSTALL) -d $(DESTDIR)$(PREFIX)/bin
+ $(INSTALL) -d $(DESTDIR)$(PREFIX)/var
-install_ispman_web:
- test -d $(ISPMAN_INSTALL_PATH)/htdocs || mkdir $(ISPMAN_INSTALL_PATH)/htdocs 2>/dev/null
- test -d $(ISPMAN_INSTALL_PATH)/cgi-bin || mkdir $(ISPMAN_INSTALL_PATH)/cgi-bin 2>/dev/null
- cp -r ispman-web/htdocs $(ISPMAN_INSTALL_PATH)/
- cp -r ispman-web/cgi-bin $(ISPMAN_INSTALL_PATH)/
- @perl scripts/subs.pl ispman-web/htdocs/control_panel/style.css > $(ISPMAN_INSTALL_PATH)/htdocs/style.css
- @perl scripts/subs.pl ispman-web/htdocs/ispman.css > $(ISPMAN_INSTALL_PATH)/htdocs/ispman.css
- cp ispman-web/htdocs/control_panel/coolmenus3.js $(ISPMAN_INSTALL_PATH)/htdocs/
- cp ispman-web/htdocs/control_panel/logo.jpg $(ISPMAN_INSTALL_PATH)/htdocs/
- find $(ISPMAN_INSTALL_PATH)/htdocs -type f -exec chmod a+r {} \;
- find $(ISPMAN_INSTALL_PATH)/htdocs -type d -exec chmod a+xr {} \;
- find $(ISPMAN_INSTALL_PATH)/cgi-bin -type f -exec chmod a+r {} \;
- find $(ISPMAN_INSTALL_PATH)/cgi-bin -type d -exec chmod a+xr {} \;
- chmod 755 $(ISPMAN_INSTALL_PATH)/htdocs/admin/index.cgi $(ISPMAN_INSTALL_PATH)/htdocs/control_panel/index.cgi
+# create web directories
+install-web-dirs: install-base-dirs
+ $(INSTALL) -d $(DESTDIR)$(PREFIX)/htdocs
+ $(INSTALL) -d $(DESTDIR)$(PREFIX)/cgi-bin
+ $(INSTALL) -d $(DESTDIR)$(PREFIX)/locale
+# generic install rule
+install: install-base install-bin install-web
-install:
- @echo Please specify what to install
- @echo Possible choices
- @echo
- @echo 'make install_ispman_common (common libraries, agent and scripts. REQUIRED)'
- @echo 'make install_ispman_web (If you want to run the web interface on this machine)'
+# cleanup generated files
+clean:
+ make -C install-data/schema clean
+ make -C install-data/ldifs clean
+# remove any leftover files too
+realclean: clean
+ find . -name \*~ -exec rm \{\} \;
+ find . -name \*.orig -exec rm \{\} \;
+ find . -name \*.rej -exec rm \{\} \;
+# build dist tarball
+dist:
+ mkdir -p dist/ispman-`cat VERSION`;
+ cp -fa `cat DISTFILES` dist/ispman-`cat VERSION`
+ cd dist; find . -type f -name Root | awk '{print "echo :pserver:[email protected]:/cvsroot/ispman > "$$1}' | sh
+ cd dist; tar czf ispman-`cat ../VERSION`.tar.gz ispman-`cat ../VERSION`
\ No newline at end of file
-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com