source: trunk/Makefile@ 451

Last change on this file since 451 was 427, checked in by Kris Deugau, 12 years ago

/trunk

Add location delete template, tweak link for location delete in
location list. See #10.
Normalize delete templates to be closer to identical.
Add revzone delete template to Makefile file list.

  • Property svn:keywords set to Id
File size: 5.8 KB
Line 
1# $Id: Makefile 427 2012-10-11 20:58:14Z 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
22INSTALL_PROGRAM = ${INSTALL}
23INSTALL_SCRIPT = ${INSTALL}
24INSTALL_DATA = ${INSTALL} -m 644
25INSTALLMODE= -m 0755
26INSTALLMODE2 = -m 0555
27
28DESTDIR =
29
30# flag to indicate if we install in a version-numbered location to
31# support parallel installs (packaged or otherwise) or if we're
32# installing to .../dnsdb/ (overwrite whatever was there last)
33PARA_VERSIONS = 0
34
35# also set the leaf directories we'll be putting things in
36PKG_LEAF = dnsdb
37CFG_LEAF = dnsdb
38
39# tweak the final leaf directories we install to if PARA_VERSIONS is set
40ifeq "$(PARA_VERSIONS)" "1"
41PKG_LEAF = dnsdb-$(VERSION)
42CFG_LEAF = dnsdb/$(VERSION)
43endif
44
45MANIFEST = \
46 INSTALL COPYING TODO Makefile dnsadmin.spec \
47 \
48 new-dns.sql dns.sql dns.cgi dns-rpc.cgi textrecs.cgi DNSDB.pm vega-import.pl export.pl \
49 \
50 index.shtml \
51 \
52 images/trash2.png images/fwd.png images/ffwd.png images/frev.png \
53 images/rev.png images/DESC.png images/ASC.png images/tree_open.png images/tree_closed.png \
54 \
55 templates/adddomain.tmpl templates/addgroup.tmpl templates/addrec.tmpl templates/adduser.tmpl \
56 templates/axfr.tmpl templates/bulkchange.tmpl templates/bulkdomain.tmpl templates/dberr.tmpl \
57 templates/deldom.tmpl templates/delgrp.tmpl templates/delloc.tmpl templates/delrec.tmpl \
58 templates/delrevzone.tmpl templates/deluser.tmpl \
59 templates/dns.css templates/dnsq.tmpl templates/domlist.tmpl templates/edgroup.tmpl \
60 templates/editsoa.tmpl templates/footer.tmpl templates/fpnla.tmpl templates/grouptree.css \
61 templates/grouptree-ie.css templates/grpman.tmpl templates/grptree.tmpl templates/header.tmpl \
62 templates/lettsearch.tmpl templates/login.tmpl templates/log.tmpl templates/menu.tmpl \
63 templates/newdomain.tmpl templates/newgrp.tmpl templates/permlist_enabled.tmpl templates/permlist.tmpl \
64 templates/pgcount.tmpl templates/reclist.tmpl templates/record.tmpl templates/sbox.tmpl \
65 templates/soadata.tmpl templates/template.tmpl templates/textrecs.tmpl templates/updatesoa.tmpl \
66 templates/useradmin.tmpl templates/user.tmpl templates/whoisq.tmpl \
67 \
68 dnsdb.conf
69
70DIRS = \
71 images templates
72
73IMAGES = \
74 images/trash2.png images/fwd.png images/ffwd.png images/frev.png \
75 images/rev.png images/DESC.png images/ASC.png
76
77SCRIPTS = \
78 dns.cgi dns-rpc.cgi textrecs.cgi vega-import.pl export.pl
79
80MODULES = DNSDB.pm
81
82TEMPLATES = \
83 templates/adddomain.tmpl templates/addgroup.tmpl templates/addrec.tmpl templates/adduser.tmpl \
84 templates/axfr.tmpl templates/bulkchange.tmpl templates/bulkdomain.tmpl templates/dberr.tmpl \
85 templates/deldom.tmpl templates/delgrp.tmpl templates/delloc.tmpl templates/delrec.tmpl \
86 templates/delrevzone.tmpl templates/deluser.tmpl \
87 templates/dns.css templates/dnsq.tmpl templates/domlist.tmpl templates/edgroup.tmpl \
88 templates/editsoa.tmpl templates/footer.tmpl templates/fpnla.tmpl templates/grouptree.css \
89 templates/grouptree-ie.css templates/grpman.tmpl templates/grptree.tmpl templates/header.tmpl \
90 templates/lettsearch.tmpl templates/login.tmpl templates/log.tmpl templates/menu.tmpl \
91 templates/newdomain.tmpl templates/newgrp.tmpl templates/permlist_enabled.tmpl templates/permlist.tmpl \
92 templates/pgcount.tmpl templates/reclist.tmpl templates/record.tmpl templates/sbox.tmpl \
93 templates/soadata.tmpl templates/template.tmpl templates/textrecs.tmpl templates/updatesoa.tmpl \
94 templates/useradmin.tmpl templates/user.tmpl templates/whoisq.tmpl
95
96CONFIGFILES = dnsdb.conf
97
98all:
99 # nullop
100
101install:
102 @mkdir -p $(DESTDIR)${datadir}/$(PKG_LEAF)/images
103 @$(INSTALL_DATA) $(IMAGES) $(DESTDIR)${datadir}/$(PKG_LEAF)/images
104 @mkdir -p $(DESTDIR)${datadir}/$(PKG_LEAF)/templates
105 @$(INSTALL_DATA) $(TEMPLATES) $(DESTDIR)${datadir}/$(PKG_LEAF)/templates
106 @# munge in necessary 'use lib ...' bits so scripts can find libs and config...
107 @# datadir is correct; no arch-specific files
108 @for i in $(SCRIPTS) $(MODULES); do \
109 $(INSTALL_SCRIPT) -D $$i $(DESTDIR)${datadir}/$(PKG_LEAF)/$$i ; \
110 perl -pi -e 's|use lib '.'; ##uselib##|use lib "${datadir}/$(PKG_LEAF)/";|;' $(DESTDIR)${datadir}/$(PKG_LEAF)/$$i ; \
111 perl -pi -e 's|use lib '.'; ##uselib##|use lib "${datadir}/$(PKG_LEAF)/";|;' $(DESTDIR)${datadir}/$(PKG_LEAF)/$$i ; \
112 done
113 @$(INSTALL) -d $(DESTDIR)${sysconfdir}/$(CFG_LEAF)/
114 @# install an example config file with all known settings
115 @for i in $(CONFIGFILES) ; do \
116 if [ -e $(DESTDIR)${sysconfdir}/$(CFG_LEAF)/$$i ]; then \
117 echo "refusing to overwrite existing config file, created as $$i.new" ; \
118 $(INSTALL_DATA) $$i $(DESTDIR)${sysconfdir}/$(CFG_LEAF)/$$i.new ; \
119 else \
120 $(INSTALL_DATA) $$i $(DESTDIR)${sysconfdir}/$(CFG_LEAF)/ ; \
121 fi ; \
122 perl -pi -e 's|"/etc/dnsdb"; ##CFG_LEAF##|"${sysconfdir}/$(CFG_LEAF)";|;' $(DESTDIR)${datadir}/$(PKG_LEAF)/DNSDB.pm ; \
123 done
124# # and now munge MyDNSDB.pm so it can find the core library
125# perl -pi -e 's|##uselib##|use lib "${libdir}/dnsdb";|;' $(DESTDIR)${sysconfdir}/dnsdb/MyDNSDB.pm
126
127#clean:
128# @for i in $(DIRS) ; do \
129# $(MAKE) -C $$i clean ; \
130# done
131
132dist:
133 mkdir $(PKGNAME)-$(VERSION)
134 tar cf - $(MANIFEST) | (cd $(PKGNAME)-$(VERSION); tar xf -)
135 /usr/bin/perl -p -e 's/#VERSION#/$(VERSION)/;s/#RELEASE#/$(RELEASE)/;s/#BETA#//g' < $(PKGNAME).spec > $(PKGNAME)-$(VERSION)/$(PKGNAME).spec
136 /usr/bin/perl -p -e 's/#VERSION#/$(VERSION)/;s/#RELEASE#/$(RELEASE)/;s/#BETA#//g' < INSTALL > $(PKGNAME)-$(VERSION)/INSTALL
137 perl -pi -e 's/[\d.]+;\s*##VERSION##/"$(VERSION)";/;' $(PKGNAME)-$(VERSION)/DNSDB.pm
138 tar cf $(PKGNAME)-$(VERSION).tar $(PKGNAME)-$(VERSION)
139 gzip -v -f -9 $(PKGNAME)-$(VERSION).tar
140 rm -rf $(PKGNAME)-$(VERSION)
141 gpg -a --detach-sign $(PKGNAME)-$(VERSION).tar.gz
Note: See TracBrowser for help on using the repository browser.