[210] | 1 | # $Id: Makefile 712 2016-03-29 20:27:10Z kdeugau $
|
---|
[114] | 2 | # DNS Admin makefile
|
---|
| 3 |
|
---|
| 4 | PKGNAME=dnsadmin
|
---|
[561] | 5 | VERSION=1.3
|
---|
[114] | 6 | RELEASE=1
|
---|
| 7 |
|
---|
| 8 | # Include some boilerplate Gnu makefile definitions.
|
---|
| 9 | prefix = /usr/local
|
---|
| 10 |
|
---|
| 11 | exec_prefix = ${prefix}
|
---|
| 12 | bindir = ${exec_prefix}/bin
|
---|
| 13 | libdir = ${exec_prefix}/lib
|
---|
| 14 | infodir = ${prefix}/info
|
---|
| 15 | includedir = ${prefix}/include
|
---|
| 16 | datadir = ${prefix}/share
|
---|
| 17 | localedir = $(datadir)/locale
|
---|
| 18 | sysconfdir = ${prefix}/etc
|
---|
| 19 | mandir = ${prefix}/man
|
---|
| 20 |
|
---|
[220] | 21 | INSTALL = /usr/bin/install
|
---|
[114] | 22 | INSTALL_PROGRAM = ${INSTALL}
|
---|
| 23 | INSTALL_SCRIPT = ${INSTALL}
|
---|
| 24 | INSTALL_DATA = ${INSTALL} -m 644
|
---|
| 25 | INSTALLMODE= -m 0755
|
---|
| 26 | INSTALLMODE2 = -m 0555
|
---|
| 27 |
|
---|
| 28 | DESTDIR =
|
---|
| 29 |
|
---|
[219] | 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)
|
---|
| 33 | PARA_VERSIONS = 0
|
---|
| 34 |
|
---|
| 35 | # also set the leaf directories we'll be putting things in
|
---|
[220] | 36 | PKG_LEAF = dnsdb
|
---|
| 37 | CFG_LEAF = dnsdb
|
---|
[219] | 38 |
|
---|
| 39 | # tweak the final leaf directories we install to if PARA_VERSIONS is set
|
---|
| 40 | ifeq "$(PARA_VERSIONS)" "1"
|
---|
[220] | 41 | PKG_LEAF = dnsdb-$(VERSION)
|
---|
| 42 | CFG_LEAF = dnsdb/$(VERSION)
|
---|
[219] | 43 | endif
|
---|
| 44 |
|
---|
[114] | 45 | MANIFEST = \
|
---|
[219] | 46 | INSTALL COPYING TODO Makefile dnsadmin.spec \
|
---|
[114] | 47 | \
|
---|
[712] | 48 | dns.sql dns-1.0-1.2.sql dns-1.2.3-1.2.4.sql dns-upd-1.2.6.sql\
|
---|
[219] | 49 | \
|
---|
[528] | 50 | $(SCRIPTS) $(MODULES) \
|
---|
| 51 | \
|
---|
[693] | 52 | index.shtml reverse-patterns.html \
|
---|
[114] | 53 | \
|
---|
[528] | 54 | $(IMAGES) \
|
---|
[114] | 55 | \
|
---|
[528] | 56 | $(TEMPLATES) \
|
---|
[216] | 57 | \
|
---|
| 58 | dnsdb.conf
|
---|
[114] | 59 |
|
---|
| 60 | DIRS = \
|
---|
| 61 | images templates
|
---|
| 62 |
|
---|
[199] | 63 | IMAGES = \
|
---|
[528] | 64 | images/ASC.png images/DESC.png \
|
---|
| 65 | images/ffwd.png images/frev.png images/fwd.png images/rev.png \
|
---|
| 66 | images/trash2.png \
|
---|
| 67 | images/tree_closed.png images/tree_open.png
|
---|
[114] | 68 |
|
---|
| 69 | SCRIPTS = \
|
---|
[646] | 70 | compact-recs.pl dns.cgi dns-rpc.cgi dns-rpc.fcgi export.pl mergerecs textrecs.cgi tiny-import.pl \
|
---|
| 71 | vega-import.pl
|
---|
[114] | 72 |
|
---|
[166] | 73 | MODULES = DNSDB.pm
|
---|
[114] | 74 |
|
---|
[216] | 75 | TEMPLATES = \
|
---|
[528] | 76 | templates/adddomain.tmpl templates/addgroup.tmpl templates/addrec.tmpl templates/addrevzone.tmpl \
|
---|
| 77 | templates/adduser.tmpl templates/axfr.tmpl templates/badpage.tmpl templates/bulkchange.tmpl \
|
---|
[646] | 78 | templates/bulkdomain.tmpl templates/bulkrev.tmpl templates/confirmbulk.tmpl templates/dberr.tmpl \
|
---|
| 79 | templates/deldom.tmpl templates/delgrp.tmpl templates/delloc.tmpl templates/delrec.tmpl \
|
---|
| 80 | templates/delrevzone.tmpl templates/deluser.tmpl templates/dns.css templates/dnsq.tmpl \
|
---|
| 81 | templates/domlist.tmpl templates/edgroup.tmpl templates/editsoa.tmpl templates/footer.tmpl \
|
---|
| 82 | templates/fpnla.tmpl templates/grouptree.css templates/grouptree-ie.css templates/grpman.tmpl \
|
---|
[648] | 83 | templates/grptree.tmpl templates/header.tmpl templates/lettsearch.tmpl templates/location.tmpl \
|
---|
| 84 | templates/loclist.tmpl templates/login.tmpl templates/log.tmpl templates/menu.tmpl \
|
---|
| 85 | templates/msgblock.tmpl templates/newdomain.tmpl templates/newgrp.tmpl templates/newrevzone.tmpl \
|
---|
| 86 | templates/permlist.tmpl templates/pgcount.tmpl templates/reclist.tmpl templates/record.tmpl \
|
---|
| 87 | templates/revzones.tmpl templates/sbox.tmpl templates/soadata.tmpl templates/template.tmpl \
|
---|
| 88 | templates/textrecs.tmpl templates/updatesoa.tmpl templates/useradmin.tmpl templates/user.tmpl \
|
---|
| 89 | templates/whoisq.tmpl templates/widgets.js
|
---|
[114] | 90 |
|
---|
[216] | 91 | CONFIGFILES = dnsdb.conf
|
---|
| 92 |
|
---|
[114] | 93 | all:
|
---|
| 94 | # nullop
|
---|
| 95 |
|
---|
| 96 | install:
|
---|
[220] | 97 | @mkdir -p $(DESTDIR)${datadir}/$(PKG_LEAF)/images
|
---|
| 98 | @$(INSTALL_DATA) $(IMAGES) $(DESTDIR)${datadir}/$(PKG_LEAF)/images
|
---|
| 99 | @mkdir -p $(DESTDIR)${datadir}/$(PKG_LEAF)/templates
|
---|
| 100 | @$(INSTALL_DATA) $(TEMPLATES) $(DESTDIR)${datadir}/$(PKG_LEAF)/templates
|
---|
[216] | 101 | @# munge in necessary 'use lib ...' bits so scripts can find libs and config...
|
---|
| 102 | @# datadir is correct; no arch-specific files
|
---|
[114] | 103 | @for i in $(SCRIPTS) $(MODULES); do \
|
---|
[219] | 104 | $(INSTALL_SCRIPT) -D $$i $(DESTDIR)${datadir}/$(PKG_LEAF)/$$i ; \
|
---|
[528] | 105 | perl -pi -e "s|use lib '.';\s+##uselib##|use lib '${datadir}/$(PKG_LEAF)/';|;" $(DESTDIR)${datadir}/$(PKG_LEAF)/$$i ; \
|
---|
[114] | 106 | done
|
---|
[219] | 107 | @$(INSTALL) -d $(DESTDIR)${sysconfdir}/$(CFG_LEAF)/
|
---|
[216] | 108 | @# install an example config file with all known settings
|
---|
| 109 | @for i in $(CONFIGFILES) ; do \
|
---|
[219] | 110 | if [ -e $(DESTDIR)${sysconfdir}/$(CFG_LEAF)/$$i ]; then \
|
---|
[216] | 111 | echo "refusing to overwrite existing config file, created as $$i.new" ; \
|
---|
[219] | 112 | $(INSTALL_DATA) $$i $(DESTDIR)${sysconfdir}/$(CFG_LEAF)/$$i.new ; \
|
---|
[216] | 113 | else \
|
---|
[219] | 114 | $(INSTALL_DATA) $$i $(DESTDIR)${sysconfdir}/$(CFG_LEAF)/ ; \
|
---|
| 115 | fi ; \
|
---|
[528] | 116 | perl -pi -e 's|"/etc/dnsdb/dnsdb.conf",\s+##CFG_LEAF##|"${sysconfdir}/$(CFG_LEAF)/dnsdb.conf",|;' $(DESTDIR)${datadir}/$(PKG_LEAF)/DNSDB.pm ; \
|
---|
[114] | 117 | done
|
---|
| 118 |
|
---|
| 119 | #clean:
|
---|
| 120 | # @for i in $(DIRS) ; do \
|
---|
| 121 | # $(MAKE) -C $$i clean ; \
|
---|
| 122 | # done
|
---|
| 123 |
|
---|
| 124 | dist:
|
---|
| 125 | mkdir $(PKGNAME)-$(VERSION)
|
---|
| 126 | tar cf - $(MANIFEST) | (cd $(PKGNAME)-$(VERSION); tar xf -)
|
---|
[219] | 127 | /usr/bin/perl -p -e 's/#VERSION#/$(VERSION)/;s/#RELEASE#/$(RELEASE)/;s/#BETA#//g' < $(PKGNAME).spec > $(PKGNAME)-$(VERSION)/$(PKGNAME).spec
|
---|
[114] | 128 | /usr/bin/perl -p -e 's/#VERSION#/$(VERSION)/;s/#RELEASE#/$(RELEASE)/;s/#BETA#//g' < INSTALL > $(PKGNAME)-$(VERSION)/INSTALL
|
---|
[549] | 129 | perl -pi -e 's/["\d.]+;\s*##VERSION##/"$(VERSION)";/;' $(PKGNAME)-$(VERSION)/DNSDB.pm
|
---|
[114] | 130 | tar cf $(PKGNAME)-$(VERSION).tar $(PKGNAME)-$(VERSION)
|
---|
| 131 | gzip -v -f -9 $(PKGNAME)-$(VERSION).tar
|
---|
| 132 | rm -rf $(PKGNAME)-$(VERSION)
|
---|
[262] | 133 | gpg -a --detach-sign $(PKGNAME)-$(VERSION).tar.gz
|
---|