1 | # $Id: Makefile 581 2013-01-04 16:34:48Z kdeugau $
|
---|
2 | # IPDB makefile
|
---|
3 |
|
---|
4 | PKGNAME=ipdb
|
---|
5 | VERSION=2.6
|
---|
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 |
|
---|
21 | INSTALL = /usr/bin/install -c
|
---|
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 |
|
---|
30 | HTML = \
|
---|
31 | alloctypes.html help.html index.shtml ipdb.css
|
---|
32 |
|
---|
33 | JS = templates/widgets.js
|
---|
34 |
|
---|
35 | IMAGES = images/logo.png
|
---|
36 |
|
---|
37 | TEMPLATES = \
|
---|
38 | templates/aclerror.tmpl templates/addmaster.tmpl templates/assign.tmpl templates/confirm.tmpl \
|
---|
39 | templates/dberr.tmpl templates/delete.tmpl templates/dunno.tmpl templates/edit.tmpl \
|
---|
40 | templates/finaldelete.tmpl templates/footer.tmpl templates/header.tmpl templates/index.tmpl \
|
---|
41 | templates/insert.tmpl templates/listpool.tmpl templates/newcity.tmpl templates/newmaster.tmpl \
|
---|
42 | templates/newnode.tmpl templates/nodesearch.tmpl templates/showsubs.tmpl \
|
---|
43 | templates/subnet-calc.tmpl templates/update.tmpl \
|
---|
44 | \
|
---|
45 | templates/admin/aclerr.tmpl templates/admin/addnotice.tmpl templates/admin/alloc.tmpl \
|
---|
46 | templates/admin/alloctweak.tmpl templates/admin/confirm.tmpl templates/admin/dberr.tmpl \
|
---|
47 | templates/admin/delnotice.tmpl templates/admin/deluser.tmpl templates/admin/dunno.tmpl \
|
---|
48 | templates/admin/edcust.tmpl templates/admin/ednotice.tmpl templates/admin/emailnotice.tmpl \
|
---|
49 | templates/admin/header.tmpl templates/admin/listcust.tmpl templates/admin/main.tmpl \
|
---|
50 | templates/admin/newuser.tmpl templates/admin/showallocs.tmpl templates/admin/showpools.tmpl \
|
---|
51 | templates/admin/showusers.tmpl templates/admin/touch.tmpl templates/admin/tweakpool.tmpl \
|
---|
52 | templates/admin/updacl.tmpl templates/admin/updatepool.tmpl templates/admin/update.tmpl \
|
---|
53 | templates/admin/updcust.tmpl templates/admin/updnotice.tmpl \
|
---|
54 | \
|
---|
55 | templates/search/compsearch.tmpl templates/search/sresults.tmpl
|
---|
56 |
|
---|
57 | SCRIPTS = \
|
---|
58 | cgi-bin/extras/db2rwhois.pl cgi-bin/combineblocks.pl cgi-bin/access-pwd-update.pl \
|
---|
59 | cgi-bin/newnode.cgi cgi-bin/freespace.pl cgi-bin/admin.cgi \
|
---|
60 | cgi-bin/main.cgi cgi-bin/newcity.cgi cgi-bin/allocate.pl \
|
---|
61 | cgi-bin/search.cgi cgi-bin/consistency-check.pl
|
---|
62 |
|
---|
63 | MODULES = cgi-bin/IPDB.pm
|
---|
64 |
|
---|
65 | CONFIGMODULES = cgi-bin/MyIPDB.pm cgi-bin/CustIDCK.pm
|
---|
66 |
|
---|
67 | RWHOIS = \
|
---|
68 | cgi-bin/extras/rwhois-net-skel.tar.gz cgi-bin/extras/rwhois-config \
|
---|
69 | cgi-bin/extras/network.tmpl
|
---|
70 |
|
---|
71 | DIRS = images templates cgi-bin cgi-bin/extras
|
---|
72 |
|
---|
73 | MANIFEST = \
|
---|
74 | $(HTML) \
|
---|
75 | $(JS) \
|
---|
76 | $(IMAGES) \
|
---|
77 | $(TEMPLATES) \
|
---|
78 | $(SCRIPTS) \
|
---|
79 | $(MODULES) \
|
---|
80 | $(CONFIGMODULES) \
|
---|
81 | $(RWHOIS)
|
---|
82 |
|
---|
83 | all:
|
---|
84 | # nullop
|
---|
85 |
|
---|
86 | install:
|
---|
87 | @for i in $(HTML) $(IMAGES) $(JS) $(TEMPLATES); do \
|
---|
88 | $(INSTALL_DATA) -D $$i $(DESTDIR)${libdir}/ipdb-$(VERSION)/$$i ; \
|
---|
89 | done
|
---|
90 | # munge in necessary 'use lib ...' bits so scripts can find MyIPDB.pm...
|
---|
91 | @for i in $(SCRIPTS) $(MODULES) $(RWHOIS); do \
|
---|
92 | $(INSTALL_SCRIPT) -D $$i $(DESTDIR)${libdir}/ipdb-$(VERSION)/$$i ; \
|
---|
93 | perl -pi -e 's|##uselib##|use lib "${sysconfdir}/ipdb-$(VERSION)/";|;' $(DESTDIR)${libdir}/ipdb-$(VERSION)/$$i ; \
|
---|
94 | done
|
---|
95 | $(INSTALL) -d $(DESTDIR)${sysconfdir}/ipdb-$(VERSION)/
|
---|
96 | @for i in $(CONFIGMODULES) ; do \
|
---|
97 | $(INSTALL_DATA) $$i $(DESTDIR)${sysconfdir}/ipdb-$(VERSION)/ ; \
|
---|
98 | done
|
---|
99 | # and now munge MyIPDB.pm so it can find the core library
|
---|
100 | perl -pi -e 's|##uselib##|use lib "${libdir}/ipdb-$(VERSION)";|;' $(DESTDIR)${sysconfdir}/ipdb-$(VERSION)/MyIPDB.pm
|
---|
101 |
|
---|
102 | #clean:
|
---|
103 | # @for i in $(DIRS) ; do \
|
---|
104 | # $(MAKE) -C $$i clean ; \
|
---|
105 | # done
|
---|
106 |
|
---|
107 | dist:
|
---|
108 | mkdir $(PKGNAME)-$(VERSION)
|
---|
109 | tar cf - $(MANIFEST) | (cd $(PKGNAME)-$(VERSION); tar xf -)
|
---|
110 | /usr/bin/perl -p -e 's/#VERSION#/$(VERSION)/;s/#RELEASE#/$(RELEASE)/;s/#BETA#//g' < $(PKGNAME).spec > $(PKGNAME)-$(VERSION)/$(PKGNAME).spec
|
---|
111 | /usr/bin/perl -p -e 's/#VERSION#/$(VERSION)/;s/#RELEASE#/$(RELEASE)/;s/#BETA#//g' < INSTALL > $(PKGNAME)-$(VERSION)/INSTALL
|
---|
112 | perl -pi -e 's/[\d.]+;\s*##VERSION##/$(VERSION);/;' $(PKGNAME)-$(VERSION)/cgi-bin/IPDB.pm
|
---|
113 | tar cf $(PKGNAME)-$(VERSION).tar $(PKGNAME)-$(VERSION)
|
---|
114 | gzip -v -f -9 $(PKGNAME)-$(VERSION).tar
|
---|
115 | rm -rf $(PKGNAME)-$(VERSION)
|
---|
116 | # gpg --detach-sign $(PKGNAME)-$(VERSION).tar.gz
|
---|