Changeset 219 for trunk


Ignore:
Timestamp:
01/13/12 18:11:38 (13 years ago)
Author:
Kris Deugau
Message:

/trunk

Add some nifty bits to allow packaged or install-via-make-install
setups to keep multiple versions, same as the run-from-the-tarball
Add .spec file

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r218 r219  
    147147  my $deferr = '';      # place to put error from default config file in case we can't find either one
    148148
    149   my $configroot = '/etc/dnsdb';
     149  my $configroot = "/etc/dnsdb";        ##CFG_LEAF##
    150150  $configroot = '' if $basename =~ m|^/|;
    151151  $basename .= ".conf" if $basename !~ /\.conf$/;
  • trunk/INSTALL

    r218 r219  
    2727    - NetAddr::IP >= 4.x.  3.x may work, however 4.x has been out for
    2828      more than 4 years.
     29    - Frontier::Responder (only required if using dns-rpc.cgi)
    2930- tinydns - support for other DNS server software is planned
    3031
     
    6970shell> psql -U dnsdb dnsdb <dns.sql
    7071
    71 
    72 ##work
    73724) Configure your webserver to call the DNS Administrator scripts
    74 at an appropriate web path.  A webroot pointing to the HTML files
    75 (first level under the dnsadmin-#VERSION#/ tarball directory, or
    76 /usr/local/lib/dnsadmin-#VERSION#) should work fine;  a server
    77 alias under an existing virtual host should work as well.
     73at an appropriate web path.  A webroot pointing to the unpacked tarball
     74directory or the default install location /usr/local/lib/dnsadmin-#VERSION#
     75should work fine;  a directory alias under an existing virtual host should
     76work as well.
    7877
    7978The directory containing the HTML and scripts must have at least the
  • trunk/Makefile

    r216 r219  
    2828DESTDIR =
    2929
     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
    3045MANIFEST = \
    31         INSTALL COPYING TODO Makefile new-dns.sql dns.sql dns.cgi dns-rpc.cgi DNSDB.pm \
    32         vega-import.pl \
     46        INSTALL COPYING TODO Makefile dnsadmin.spec \
     47        \
     48        new-dns.sql dns.sql dns.cgi dns-rpc.cgi DNSDB.pm vega-import.pl \
    3349        \
    3450        index.shtml \
     
    8399install:
    84100        @for i in $(IMAGES) $(TEMPLATES); do \
    85                 $(INSTALL_DATA) -D $$i $(DESTDIR)${datadir}/dnsdb-$(VERSION)/$$i ; \
     101                $(INSTALL_DATA) -D $$i $(DESTDIR)${datadir}/$(PKG_LEAF)/$$i ; \
    86102        done
    87103        @# munge in necessary 'use lib ...' bits so scripts can find libs and config...
    88104        @# datadir is correct;  no arch-specific files
    89105        @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 ; \
     106                $(INSTALL_SCRIPT) -D $$i $(DESTDIR)${datadir}/$(PKG_LEAF)/$$i ; \
     107                perl -pi -e 's|use lib '.';     ##uselib##|use lib "${datadir}/$(PKG_LEAF)/";|;' $(DESTDIR)${datadir}/$(PKG_LEAF)/$$i ; \
     108                perl -pi -e 's|use lib '.';     ##uselib##|use lib "${datadir}/$(PKG_LEAF)/";|;' $(DESTDIR)${datadir}/$(PKG_LEAF)/$$i ; \
    93109        done
    94         @$(INSTALL) -d $(DESTDIR)${sysconfdir}/dnsdb/
     110        @$(INSTALL) -d $(DESTDIR)${sysconfdir}/$(CFG_LEAF)/
    95111        @# install an example config file with all known settings
    96112        @for i in $(CONFIGFILES) ; do \
    97                 if [ -e $(DESTDIR)${sysconfdir}/dnsdb/$$i ]; then \
     113                if [ -e $(DESTDIR)${sysconfdir}/$(CFG_LEAF)/$$i ]; then \
    98114                        echo "refusing to overwrite existing config file, created as $$i.new" ; \
    99                         $(INSTALL_DATA) $$i $(DESTDIR)${sysconfdir}/dnsdb/$$i.new ; \
     115                        $(INSTALL_DATA) $$i $(DESTDIR)${sysconfdir}/$(CFG_LEAF)/$$i.new ; \
    100116                else \
    101                         $(INSTALL_DATA) $$i $(DESTDIR)${sysconfdir}/dnsdb/ ; \
    102                 fi \
     117                        $(INSTALL_DATA) $$i $(DESTDIR)${sysconfdir}/$(CFG_LEAF)/ ; \
     118                fi ; \
     119                perl -pi -e 's|"/etc/dnsdb";    ##CFG_LEAF##|"${sysconfdir}/$(CFG_LEAF)";|;' $(DESTDIR)${datadir}/$(PKG_LEAF)/DNSDB.pm ; \
    103120        done
    104121#       # and now munge MyDNSDB.pm so it can find the core library
     
    113130        mkdir $(PKGNAME)-$(VERSION)
    114131        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
     132        /usr/bin/perl -p -e 's/#VERSION#/$(VERSION)/;s/#RELEASE#/$(RELEASE)/;s/#BETA#//g' < $(PKGNAME).spec > $(PKGNAME)-$(VERSION)/$(PKGNAME).spec
    116133        /usr/bin/perl -p -e 's/#VERSION#/$(VERSION)/;s/#RELEASE#/$(RELEASE)/;s/#BETA#//g' < INSTALL > $(PKGNAME)-$(VERSION)/INSTALL
    117134        perl -pi -e 's/[\d.]+;\s*##VERSION##/$(VERSION);/;' $(PKGNAME)-$(VERSION)/DNSDB.pm
Note: See TracChangeset for help on using the changeset viewer.