Changeset 216


Ignore:
Timestamp:
01/04/12 23:25:56 (12 years ago)
Author:
Kris Deugau
Message:

/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
Location:
trunk
Files:
1 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r212 r216  
    120120# fmeh.  this is a real web path, not a logical internal one.  hm..
    121121#               cssdir  => 'templates/',
     122                sessiondir      => 'session/',
    122123
    123124                # Session params
     
    223224      $config{domain}           = $1 if /^domain\s*=\s*([a-z0-9_.-]+)/i;
    224225      # session - note this is fed directly to CGI::Session
    225       $config{timeout}  = $1 if /^[tT][iI][mM][eE][oO][uU][tT]\s*=\s*(\d+[smhdwMy]?)/;
     226      $config{timeout}          = $1 if /^[tT][iI][mM][eE][oO][uU][tT]\s*=\s*(\d+[smhdwMy]?)/;
     227      $config{sessiondir}       = $1 if m{^sessiondir\s*=\s*([a-z0-9/_.-]+)}i;
    226228      # misc
    227229      $config{log_failures}     = $1 if /^log_failures\s*=\s*([a-z01]+)/i;
  • trunk/Makefile

    r210 r216  
    4747        templates/pgcount.tmpl templates/reclist.tmpl templates/record.tmpl templates/sbox.tmpl \
    4848        templates/soadata.tmpl templates/template.tmpl templates/updatesoa.tmpl templates/useradmin.tmpl \
    49         templates/user.tmpl templates/viadns.css templates/whoisq.tmpl \
     49        templates/user.tmpl templates/whoisq.tmpl \
     50        \
     51        dnsdb.conf
    5052
    5153DIRS = \
     
    6163MODULES = DNSDB.pm
    6264
    63 #CONFIGMODULES = MyDNSDB.pm
     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
    6479
    6580all:
     
    6782
    6883install:
    69         @for i in $(HTML) $(IMAGES); do \
    70                 $(INSTALL_DATA) -D $$i $(DESTDIR)${libdir}/dnsdb/$$i ; \
     84        @for i in $(IMAGES) $(TEMPLATES); do \
     85                $(INSTALL_DATA) -D $$i $(DESTDIR)${datadir}/dnsdb-$(VERSION)/$$i ; \
    7186        done
    72         # munge in necessary 'use lib ...' bits so scripts can find MyDNSDB.pm...
     87        @# munge in necessary 'use lib ...' bits so scripts can find libs and config...
     88        @# datadir is correct;  no arch-specific files
    7389        @for i in $(SCRIPTS) $(MODULES); do \
    74                 $(INSTALL_SCRIPT) -D $$i $(DESTDIR)${libdir}/dnsdb/$$i ; \
    75                 perl -pi -e 's|##uselib##|use lib "${sysconfdir}/dnsdb/";|;' $(DESTDIR)${libdir}/dnsdb/$$i ; \
     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 ; \
    7693        done
    77         $(INSTALL) -d $(DESTDIR)${sysconfdir}/dnsdb/
    78         @for i in $(CONFIGMODULES) ; do \
    79                 $(INSTALL_DATA) $$i $(DESTDIR)${sysconfdir}/dnsdb/ ; \
     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 \
    80103        done
    81104#       # and now munge MyDNSDB.pm so it can find the core library
     
    96119        gzip -v -f -9 $(PKGNAME)-$(VERSION).tar
    97120        rm -rf $(PKGNAME)-$(VERSION)
    98         # gpg --detach-sign $(PKGNAME)-$(VERSION).tar.gz
     121        gpg --detach-sign $(PKGNAME)-$(VERSION).tar.gz
  • trunk/dns-rpc.cgi

    r200 r216  
    1 #!/usr/bin/perl
     1#!/usr/bin/perl -w -T
    22# $Id$
    33# XMLRPC interface to manipulate most DNS DB entities
     
    66use strict;
    77use warnings;
     8
     9# don't remove!  required for GNU/FHS-ish install from tarball
     10use lib '.';    ##uselib##
     11
    812use DNSDB;      # note we're not importing subs;  this lets us (ab)use the same sub names here for convenience
    913use Data::Dumper;
  • trunk/dns.cgi

    r213 r216  
    3232#die "argh! \@INC got tainted!" if is_tainted(@INC);
    3333
    34 # custom modules
    35 use lib '.';
     34# don't remove!  required for GNU/FHS-ish install from tarball
     35use lib '.';    ##uselib##
     36
    3637use DNSDB qw(:ALL);
    3738
     
    4142# Let's do these templates right...
    4243my $templatedir = "templates";
    43 my $sessiondir = "session";
    4444
    4545# Set up the CGI object...
     
    6464# persistent stuff needed on most/all pages
    6565my $sid = ($webvar{sid} ? $webvar{sid} : undef);
    66 my $session = new CGI::Session("driver:File", $sid, {Directory => $sessiondir})
     66my $session = new CGI::Session("driver:File", $sid, {Directory => $config{sessiondir}})
    6767        or die CGI::Session->errstr();
    6868#$sid = $session->id() if !$sid;
Note: See TracChangeset for help on using the changeset viewer.