source: trunk/Makefile@ 216

Last change on this file since 216 was 216, checked in by Kris Deugau, 13 years ago

/trunk

Found some not-so-little things missing for a tarball

  • munging of @INC via "use lib" needs to be pointed to the right path on install
  • session dir should be configurable (eg, to put it in /var/lib/dnsdb when packaged scripts + templates all go in /usr/share/dnsdb)
  • Finally remove lingering unused viadns.css
  • Remember to install template files on 'make install'
  • Get a good start on filling out INSTALL halfway properly by copy-pasting the IPDB version
  • Add all-commented example config file to be installed
  • Property svn:keywords set to Id
File size: 4.9 KB
Line 
1# $Id: Makefile 216 2012-01-05 04:25:56Z kdeugau $
2# DNS Admin makefile
3
4PKGNAME=dnsadmin
5VERSION=1.0
6RELEASE=1
7
8# Include some boilerplate Gnu makefile definitions.
9prefix = /usr/local
10
11exec_prefix = ${prefix}
12bindir = ${exec_prefix}/bin
13libdir = ${exec_prefix}/lib
14infodir = ${prefix}/info
15includedir = ${prefix}/include
16datadir = ${prefix}/share
17localedir = $(datadir)/locale
18sysconfdir = ${prefix}/etc
19mandir = ${prefix}/man
20
21INSTALL = /usr/bin/install -c
22INSTALL_PROGRAM = ${INSTALL}
23INSTALL_SCRIPT = ${INSTALL}
24INSTALL_DATA = ${INSTALL} -m 644
25INSTALLMODE= -m 0755
26INSTALLMODE2 = -m 0555
27
28DESTDIR =
29
30MANIFEST = \
31 INSTALL COPYING TODO Makefile new-dns.sql dns.sql dns.cgi dns-rpc.cgi DNSDB.pm \
32 vega-import.pl \
33 \
34 index.shtml \
35 \
36 images/trash2.png images/fwd.png images/ffwd.png images/frev.png \
37 images/rev.png images/DESC.png images/ASC.png images/tree_open.png images/tree_closed.png \
38 \
39 templates/adddomain.tmpl templates/addgroup.tmpl templates/addrec.tmpl templates/adduser.tmpl \
40 templates/axfr.tmpl templates/bulkchange.tmpl templates/bulkdomain.tmpl templates/dberr.tmpl \
41 templates/deldom.tmpl templates/delgrp.tmpl templates/delrec.tmpl templates/deluser.tmpl \
42 templates/dns.css templates/dnsq.tmpl templates/domlist.tmpl templates/edgroup.tmpl \
43 templates/editsoa.tmpl templates/footer.tmpl templates/fpnla.tmpl templates/grouptree.css \
44 templates/grouptree-ie.css templates/grpman.tmpl templates/grptree.tmpl templates/header.tmpl \
45 templates/lettsearch.tmpl templates/login.tmpl templates/log.tmpl templates/menu.tmpl \
46 templates/newdomain.tmpl templates/newgrp.tmpl templates/permlist_enabled.tmpl templates/permlist.tmpl \
47 templates/pgcount.tmpl templates/reclist.tmpl templates/record.tmpl templates/sbox.tmpl \
48 templates/soadata.tmpl templates/template.tmpl templates/updatesoa.tmpl templates/useradmin.tmpl \
49 templates/user.tmpl templates/whoisq.tmpl \
50 \
51 dnsdb.conf
52
53DIRS = \
54 images templates
55
56IMAGES = \
57 images/trash2.png images/fwd.png images/ffwd.png images/frev.png \
58 images/rev.png images/DESC.png images/ASC.png
59
60SCRIPTS = \
61 dns.cgi dns-rpc.cgi vega-import.pl
62
63MODULES = DNSDB.pm
64
65TEMPLATES = \
66 templates/adddomain.tmpl templates/addgroup.tmpl templates/addrec.tmpl templates/adduser.tmpl \
67 templates/axfr.tmpl templates/bulkchange.tmpl templates/bulkdomain.tmpl templates/dberr.tmpl \
68 templates/deldom.tmpl templates/delgrp.tmpl templates/delrec.tmpl templates/deluser.tmpl \
69 templates/dns.css templates/dnsq.tmpl templates/domlist.tmpl templates/edgroup.tmpl \
70 templates/editsoa.tmpl templates/footer.tmpl templates/fpnla.tmpl templates/grouptree.css \
71 templates/grouptree-ie.css templates/grpman.tmpl templates/grptree.tmpl templates/header.tmpl \
72 templates/lettsearch.tmpl templates/login.tmpl templates/log.tmpl templates/menu.tmpl \
73 templates/newdomain.tmpl templates/newgrp.tmpl templates/permlist_enabled.tmpl templates/permlist.tmpl \
74 templates/pgcount.tmpl templates/reclist.tmpl templates/record.tmpl templates/sbox.tmpl \
75 templates/soadata.tmpl templates/template.tmpl templates/updatesoa.tmpl templates/useradmin.tmpl \
76 templates/user.tmpl templates/whoisq.tmpl
77
78CONFIGFILES = dnsdb.conf
79
80all:
81 # nullop
82
83install:
84 @for i in $(IMAGES) $(TEMPLATES); do \
85 $(INSTALL_DATA) -D $$i $(DESTDIR)${datadir}/dnsdb-$(VERSION)/$$i ; \
86 done
87 @# munge in necessary 'use lib ...' bits so scripts can find libs and config...
88 @# datadir is correct; no arch-specific files
89 @for i in $(SCRIPTS) $(MODULES); do \
90 $(INSTALL_SCRIPT) -D $$i $(DESTDIR)${datadir}/dnsdb-$(VERSION)/$$i ; \
91 perl -pi -e 's|use lib '.'; ##uselib##|use lib "${datadir}/dnsdb-$(VERSION)/";|;' $(DESTDIR)${datadir}/dnsdb-$(VERSION)/$$i ; \
92 perl -pi -e 's|use lib '.'; ##uselib##|use lib "${datadir}/dnsdb-$(VERSION)/";|;' $(DESTDIR)${datadir}/dnsdb-$(VERSION)/$$i ; \
93 done
94 @$(INSTALL) -d $(DESTDIR)${sysconfdir}/dnsdb/
95 @# install an example config file with all known settings
96 @for i in $(CONFIGFILES) ; do \
97 if [ -e $(DESTDIR)${sysconfdir}/dnsdb/$$i ]; then \
98 echo "refusing to overwrite existing config file, created as $$i.new" ; \
99 $(INSTALL_DATA) $$i $(DESTDIR)${sysconfdir}/dnsdb/$$i.new ; \
100 else \
101 $(INSTALL_DATA) $$i $(DESTDIR)${sysconfdir}/dnsdb/ ; \
102 fi \
103 done
104# # and now munge MyDNSDB.pm so it can find the core library
105# perl -pi -e 's|##uselib##|use lib "${libdir}/dnsdb";|;' $(DESTDIR)${sysconfdir}/dnsdb/MyDNSDB.pm
106
107#clean:
108# @for i in $(DIRS) ; do \
109# $(MAKE) -C $$i clean ; \
110# done
111
112dist:
113 mkdir $(PKGNAME)-$(VERSION)
114 tar cf - $(MANIFEST) | (cd $(PKGNAME)-$(VERSION); tar xf -)
115 #/usr/bin/perl -p -e 's/#VERSION#/$(VERSION)/;s/#RELEASE#/$(RELEASE)/;s/#BETA#//g' < $(PKGNAME).spec > $(PKGNAME)-$(VERSION)/$(PKGNAME).spec
116 /usr/bin/perl -p -e 's/#VERSION#/$(VERSION)/;s/#RELEASE#/$(RELEASE)/;s/#BETA#//g' < INSTALL > $(PKGNAME)-$(VERSION)/INSTALL
117 perl -pi -e 's/[\d.]+;\s*##VERSION##/$(VERSION);/;' $(PKGNAME)-$(VERSION)/DNSDB.pm
118 tar cf $(PKGNAME)-$(VERSION).tar $(PKGNAME)-$(VERSION)
119 gzip -v -f -9 $(PKGNAME)-$(VERSION).tar
120 rm -rf $(PKGNAME)-$(VERSION)
121 gpg --detach-sign $(PKGNAME)-$(VERSION).tar.gz
Note: See TracBrowser for help on using the repository browser.