# $Id$ # IPDB makefile PKGNAME=ipdb VERSION=2.8.2 RELEASE=1 # Include some boilerplate Gnu makefile definitions. prefix = /usr/local exec_prefix = ${prefix} bindir = ${exec_prefix}/bin libdir = ${exec_prefix}/lib infodir = ${prefix}/info includedir = ${prefix}/include datadir = ${prefix}/share localedir = $(datadir)/locale sysconfdir = ${prefix}/etc mandir = ${prefix}/man INSTALL = /usr/bin/install -c INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 INSTALLMODE= -m 0755 INSTALLMODE2 = -m 0555 DESTDIR = HTML = \ alloctypes.html help.html index.shtml ipdb.css JS = templates/widgets.js IMAGES = images/logo.png TEMPLATES = \ templates/aclerror.tmpl templates/addmaster.tmpl templates/assign.tmpl templates/confirm.tmpl \ templates/dberr.tmpl templates/delete.tmpl templates/dunno.tmpl templates/edit.tmpl \ templates/finaldelete.tmpl templates/footer.tmpl templates/header.tmpl templates/index.tmpl \ templates/insert.tmpl templates/listpool.tmpl templates/newcity.tmpl templates/newmaster.tmpl \ templates/newnode.tmpl templates/nodesearch.tmpl templates/showmaster.tmpl templates/showrouted.tmpl \ templates/subnet-calc.tmpl templates/update.tmpl \ \ templates/admin/aclerr.tmpl templates/admin/addnotice.tmpl templates/admin/alloc.tmpl \ templates/admin/alloctweak.tmpl templates/admin/confirm.tmpl templates/admin/dberr.tmpl \ templates/admin/delnotice.tmpl templates/admin/deluser.tmpl templates/admin/dunno.tmpl \ templates/admin/edcust.tmpl templates/admin/ednotice.tmpl templates/admin/emailnotice.tmpl \ templates/admin/header.tmpl templates/admin/listcust.tmpl templates/admin/main.tmpl \ templates/admin/newuser.tmpl templates/admin/showallocs.tmpl templates/admin/showpools.tmpl \ templates/admin/showusers.tmpl templates/admin/touch.tmpl templates/admin/tweakpool.tmpl \ templates/admin/updacl.tmpl templates/admin/updatepool.tmpl templates/admin/update.tmpl \ templates/admin/updcust.tmpl templates/admin/updnotice.tmpl \ \ templates/search/compsearch.tmpl templates/search/sresults.tmpl SCRIPTS = \ cgi-bin/extras/db2rwhois.pl cgi-bin/combineblocks.pl cgi-bin/access-pwd-update.pl \ cgi-bin/newnode.cgi cgi-bin/freespace.pl cgi-bin/admin.cgi \ cgi-bin/main.cgi cgi-bin/ipdb-rpc.cgi cgi-bin/newcity.cgi cgi-bin/allocate.pl \ cgi-bin/search.cgi cgi-bin/consistency-check.pl cgi-bin/snCalc.cgi MODULES = cgi-bin/IPDB.pm CONFIGMODULES = cgi-bin/MyIPDB.pm cgi-bin/CustIDCK.pm RWHOIS = \ cgi-bin/extras/rwhois-net-skel.tar.gz cgi-bin/extras/rwhois-config \ cgi-bin/extras/network.tmpl DIRS = images templates cgi-bin cgi-bin/extras MANIFEST = \ $(HTML) \ $(JS) \ $(IMAGES) \ $(TEMPLATES) \ $(SCRIPTS) \ $(MODULES) \ $(CONFIGMODULES) \ $(RWHOIS) all: # nullop install: @for i in $(HTML) $(IMAGES) $(JS) $(TEMPLATES); do \ $(INSTALL_DATA) -D $$i $(DESTDIR)${libdir}/ipdb-$(VERSION)/$$i ; \ done # munge in necessary 'use lib ...' bits so scripts can find MyIPDB.pm... @for i in $(SCRIPTS) $(MODULES) $(RWHOIS); do \ $(INSTALL_SCRIPT) -D $$i $(DESTDIR)${libdir}/ipdb-$(VERSION)/$$i ; \ perl -pi -e 's|##uselib##|use lib "${sysconfdir}/ipdb-$(VERSION)/";|;' $(DESTDIR)${libdir}/ipdb-$(VERSION)/$$i ; \ done $(INSTALL) -d $(DESTDIR)${sysconfdir}/ipdb-$(VERSION)/ @for i in $(CONFIGMODULES) ; do \ $(INSTALL_DATA) $$i $(DESTDIR)${sysconfdir}/ipdb-$(VERSION)/ ; \ done # and now munge MyIPDB.pm so it can find the core library perl -pi -e 's|##uselib##|use lib "${libdir}/ipdb-$(VERSION)";|;' $(DESTDIR)${sysconfdir}/ipdb-$(VERSION)/MyIPDB.pm #clean: # @for i in $(DIRS) ; do \ # $(MAKE) -C $$i clean ; \ # done dist: mkdir $(PKGNAME)-$(VERSION) tar cf - $(MANIFEST) | (cd $(PKGNAME)-$(VERSION); tar xf -) /usr/bin/perl -p -e 's/#VERSION#/$(VERSION)/g;s/#RELEASE#/$(RELEASE)/g;s/#BETA#//g' < $(PKGNAME).spec > $(PKGNAME)-$(VERSION)/$(PKGNAME).spec /usr/bin/perl -p -e 's/#VERSION#/$(VERSION)/g;s/#RELEASE#/$(RELEASE)/g;s/#BETA#//g' < INSTALL > $(PKGNAME)-$(VERSION)/INSTALL perl -pi -e 's/[\d.]+;\s*##VERSION##/"$(VERSION)";/;' $(PKGNAME)-$(VERSION)/cgi-bin/IPDB.pm tar cf $(PKGNAME)-$(VERSION).tar $(PKGNAME)-$(VERSION) gzip -v -f -9 $(PKGNAME)-$(VERSION).tar rm -rf $(PKGNAME)-$(VERSION) gpg --detach-sign -a $(PKGNAME)-$(VERSION).tar.gz