diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2014-04-08 14:26:23 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2014-04-08 14:40:26 +0300 |
commit | b39389f1a8b2344bbe80eba028c0101b72eceec1 (patch) | |
tree | 1d094b8885ab997049be2755b2686dee6ce1311e | |
parent | afd5c92337ff2df9d1eca2db1d8ef70a9fa01bc4 (diff) | |
download | dnstools-b39389f1a8b2344bbe80eba028c0101b72eceec1.tar.gz dnstools-b39389f1a8b2344bbe80eba028c0101b72eceec1.tar.bz2 |
Use ExtUtils::AutoInstall to handle dependencies.
* .gitignore: Add inc
* README: New file.
* Makefile: Add copyleft statement
(SUBDIRS): Add vhostcname
* bootstrap.pl: New file.
* axfr2acl/Makefile.PL: Use ExtUtils::AutoInstall
* dnsdbck/Makefile.PL: Likewise.
* renewck/Makefile.PL: Likewise.
* rpsl2acl/Makefile.PL: Likewise.
* vhostcname/Makefile.PL: Likewise.
* vhostcname/MANIFEST: Add inc/ExtUtils/AutoInstall.pm
* dnsdbck/MANIFEST: Likewise.
* axfr2acl/MANIFEST: Likewise.
* renewck/MANIFEST: Likewise.
* rpsl2acl/MANIFEST: Likewise.
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 18 | ||||
-rw-r--r-- | README | 54 | ||||
-rw-r--r-- | axfr2acl/MANIFEST | 1 | ||||
-rw-r--r-- | axfr2acl/Makefile.PL | 37 | ||||
-rw-r--r-- | bootstrap.pl | 93 | ||||
-rw-r--r-- | dnsdbck/MANIFEST | 1 | ||||
-rw-r--r-- | dnsdbck/Makefile.PL | 37 | ||||
-rw-r--r-- | renewck/MANIFEST | 1 | ||||
-rw-r--r-- | renewck/Makefile.PL | 41 | ||||
-rw-r--r-- | rpsl2acl/MANIFEST | 1 | ||||
-rw-r--r-- | rpsl2acl/Makefile.PL | 35 | ||||
-rw-r--r-- | vhostcname/MANIFEST | 1 | ||||
-rw-r--r-- | vhostcname/Makefile.PL | 33 | ||||
-rwxr-xr-x | vhostcname/vhostcname | 2 |
15 files changed, 317 insertions, 39 deletions
@@ -5,3 +5,4 @@ pm_to_blib *.tar.gz Makefile MYMETA.* +inc @@ -1,4 +1,20 @@ -SUBDIRS = dnsdbck rpsl2acl axfr2acl +# This file is part of dnstools +# Copyright (C) 2012, 2014 Sergey Poznyakoff <gray@gnu.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +SUBDIRS = dnsdbck rpsl2acl axfr2acl vhostcname include Make.vars @@ -0,0 +1,54 @@ +These notes intend to help people working on the Git version of +this package. + +* Requirements + +To bootstrap the package you need the following: + +- GNU make +- Perl 5 +- CPAN module +- File::Path module + +* Bootstrapping + +Run + + perl bootstrap.pl + +If the ExtUtils::AutoInstall module is not installed on your system, +this script will attempt to download it. Obviously, you will need an +Internet connection. + +* Building + +Upon successfull bootstrapping, run "make". This will build all +subpackages. To create distribution tarballs, run "make dist". + +* Bug reporting + +Please report any bugs and suggestions to Sergey Poznyakoff <gray@gnu.org>. + + +* Copyright information + + Copyright (C) 2014 Free Software Foundation, Inc. + + Permission is granted to anyone to make or distribute verbatim copies + of this document as received, in any medium, provided that the + copyright notice and this permission notice are preserved, + thus giving the recipient permission to redistribute in turn. + + Permission is granted to distribute modified versions + of this document, or of portions of it, + under the above conditions, provided also that they + carry prominent notices stating who last changed them. + +^L +Local Variables: +mode: outline +paragraph-separate: "[ ^L]*$" +version-control: never +End: + + diff --git a/axfr2acl/MANIFEST b/axfr2acl/MANIFEST index 3bb8ac5..64a8ffd 100644 --- a/axfr2acl/MANIFEST +++ b/axfr2acl/MANIFEST @@ -1,3 +1,4 @@ MANIFEST Makefile.PL +inc/ExtUtils/AutoInstall.pm axfr2acl diff --git a/axfr2acl/Makefile.PL b/axfr2acl/Makefile.PL index 2ad8d9a..a97801b 100644 --- a/axfr2acl/Makefile.PL +++ b/axfr2acl/Makefile.PL @@ -1,15 +1,38 @@ # -*- perl -*- -use ExtUtils::MakeMaker; +# Copyright (C) 2014 Sergey Poznyakoff <gray@gnu.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +use lib 'inc'; +use ExtUtils::AutoInstall ( + -core => [ + 'Getopt::Long' => 2.34, + 'Pod::Usage' => 1.51, + 'Pod::Man' => 2.25, + 'IO' => 1.2301, + 'Digest::MD5' => 2.50, + 'Net::DNS' => 0.66 + ] +); # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( 'NAME' => 'axfr2acl', + 'AUTHOR' => 'Sergey Poznyakoff <gray@gnu.org>', + 'ABSTRACT' => 'Transfers A records from the given DNS zones and converts them to an ACL for use in BIND configuration files', 'FIRST_MAKEFILE' => 'Makefile', - 'VERSION' => '1.00', - 'EXE_FILES' => [ 'axfr2acl' ], - 'PREREQ_PM' => { 'Getopt::Long' => 2.34, - 'IO' => 1.2301, - 'Digest::MD5' => 2.50, - 'Net::DNS' => 0.66 } + 'VERSION' => '1.01', + 'EXE_FILES' => [ 'axfr2acl' ] ); diff --git a/bootstrap.pl b/bootstrap.pl new file mode 100644 index 0000000..6625365 --- /dev/null +++ b/bootstrap.pl @@ -0,0 +1,93 @@ +#! /usr/bin/perl +# This file is part of dnstools. +# Copyright (C) 2014 Sergey Poznyakoff <gray@gnu.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +use strict; +use CPAN; +use Cwd qw(getcwd); +use File::Path qw(mkpath); + +sub find_subdirs { + my $line; + my @ret; + + open(my $fd, "<", "Makefile") or die "Can't open Makefile: $!"; + while (<$fd>) { + s/#.*//; + next if (/^\s*$/); + if (s/\\\s*$//) { + $line .= $_; + next; + } else { + $line .= $_; + $line =~ s/^\s+//; + if ($line =~ s/^SUBDIRS\s*=\s*(.*)//) { + @ret = split /\s+/, $1; + last; + } + } + } + close($fd); + return @ret; +} + +#### +my $incdir = "inc/ExtUtils"; +my $topdir = getcwd; + +my @subdirs = find_subdirs(); +die "No SUBDIRS found in the Makefile; make sure you run this script from the project's top-level directory\n" if ($#subdirs == -1); + +my $modname = "ExtUtils::AutoInstall"; + +my $mod = CPAN::Shell->expandany($modname) or die "Can't expand $modname"; +my $file = $mod->inst_file; +my $dir; + +if (defined($file)) { + print "$modname installed at $file\n"; + if (-f $file) { + $file =~ s/\.pm$//; + if (-d $file) { + $dir = $file; + } else { + die "Can't find $modname directory"; + } + } +} else { + print "Getting $modname\n"; + my $distro = $mod->get or die "Can't get distribution for $modname"; + $dir = $distro->dir; +} + +$file = "$dir/$incdir/AutoInstall.pm"; +-f $file or die "$file not found"; + +chdir $topdir or die "Can't change to $topdir: $!"; +foreach my $d (@subdirs) { + print "Directory $d/$incdir\n"; + if (! -d "$d/$incdir") { + mkpath "$d/$incdir" or die "Can't create $d/$incdir: $!"; + } + chdir "$d/$incdir" + or die "Can't change to $d/$incdir: $!"; + unlink("AutoInstall.pm"); + symlink($file, "AutoInstall.pm") + or die "Can't create symlink in ". getcwd . ": $!"; + chdir $topdir + or die "Can't change back to $topdir: $!"; +} + diff --git a/dnsdbck/MANIFEST b/dnsdbck/MANIFEST index fd61d5c..c9abc84 100644 --- a/dnsdbck/MANIFEST +++ b/dnsdbck/MANIFEST @@ -1,3 +1,4 @@ MANIFEST Makefile.PL +inc/ExtUtils/AutoInstall.pm dnsdbck diff --git a/dnsdbck/Makefile.PL b/dnsdbck/Makefile.PL index 4e54f1b..690eb05 100644 --- a/dnsdbck/Makefile.PL +++ b/dnsdbck/Makefile.PL @@ -1,15 +1,38 @@ # -*- perl -*- -use ExtUtils::MakeMaker; +# Copyright (C) 2011, 2014 Sergey Poznyakoff <gray@gnu.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +use lib 'inc'; +use ExtUtils::AutoInstall ( + -core => [ + 'Getopt::Long' => 2.34, + 'Pod::Usage' => 1.51, + 'Pod::Man' => 2.25, + 'DBI' , => 1.607, + 'Net::DNS' => 0.66, + 'Net::CIDR' => 0.14 + ] +); # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( 'NAME' => 'dnsdbck', + 'AUTHOR' => 'Sergey Poznyakoff <gray@gnu.org>', + 'ABSTRACT' => 'Verifies consistency of DNS information in an SQL database.', 'FIRST_MAKEFILE' => 'Makefile', - 'VERSION' => '1.00', - 'EXE_FILES' => [ 'dnsdbck' ], - 'PREREQ_PM' => { 'Getopt::Long' => 2.34, - 'DBI' , => 1.607, - 'Net::DNS' => 0.66, - 'Net::CIDR' => 0.14 } + 'VERSION' => '1.01', + 'EXE_FILES' => [ 'dnsdbck' ] ); diff --git a/renewck/MANIFEST b/renewck/MANIFEST index ccfc672..55f4e83 100644 --- a/renewck/MANIFEST +++ b/renewck/MANIFEST @@ -1,3 +1,4 @@ MANIFEST Makefile.PL +inc/ExtUtils/AutoInstall.pm renewck diff --git a/renewck/Makefile.PL b/renewck/Makefile.PL index deafaa6..af06ad9 100644 --- a/renewck/Makefile.PL +++ b/renewck/Makefile.PL @@ -1,18 +1,39 @@ # -*- perl -*- -use ExtUtils::MakeMaker; +# Copyright (C) 2014 Sergey Poznyakoff <gray@gnu.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +use lib 'inc'; +use ExtUtils::AutoInstall ( + -core => [ + 'Getopt::Long' => 2.34, + 'IO::Socket' => 1.34, + 'Mail::Send' => 2.09, + 'Pod::Usage' => 1.51, + 'Pod::Man' => 2.25, + 'Time::ParseDate' => 2011.0517, + 'GDBM_File' => 1.14 + ] +); # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( 'NAME' => 'renewck', + 'AUTHOR' => 'Sergey Poznyakoff <gray@gnu.org>', + 'ABSTRACT' => 'Checks expiration times of one or more domains and notifies the user via email about the domains that are approaching expiring.', 'FIRST_MAKEFILE' => 'Makefile', - 'VERSION' => '1.00', - 'EXE_FILES' => [ 'renewck' ], - 'PREREQ_PM' => { 'Getopt::Long' => 2.34, - 'IO::Socket' => 1.34, - 'Mail::Send' => 2.09, - 'Pod::Usage' => 1.51, - 'Pod::Man' => 2.25, - 'Time::ParseDate' => 2011.0517, - 'GDBM_File' => 1.14 } + 'VERSION' => '1.01', + 'EXE_FILES' => [ 'renewck' ] ); diff --git a/rpsl2acl/MANIFEST b/rpsl2acl/MANIFEST index 2efe4c0..9056545 100644 --- a/rpsl2acl/MANIFEST +++ b/rpsl2acl/MANIFEST @@ -1,3 +1,4 @@ MANIFEST Makefile.PL +inc/ExtUtils/AutoInstall.pm rpsl2acl diff --git a/rpsl2acl/Makefile.PL b/rpsl2acl/Makefile.PL index 544785b..1c4dce1 100644 --- a/rpsl2acl/Makefile.PL +++ b/rpsl2acl/Makefile.PL @@ -1,14 +1,37 @@ # -*- perl -*- -use ExtUtils::MakeMaker; +# Copyright (C) 2012, 2014 Sergey Poznyakoff <gray@gnu.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +use lib 'inc'; +use ExtUtils::AutoInstall ( + -core => [ + 'Getopt::Long' => 2.34, + 'Pod::Usage' => 1.51, + 'Pod::Man' => 2.25, + 'IO' => 1.2301, + 'Net::CIDR' => 0.14 + ] +); # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( 'NAME' => 'rpsl2acl', + 'AUTHOR' => 'Sergey Poznyakoff <gray@gnu.org>', + 'ABSTRACT' => 'Queries a set of RPSL database objects (normally route-sets) and converts them to an ACL for use in BIND configuration files.', 'FIRST_MAKEFILE' => 'Makefile', - 'VERSION' => '1.00', - 'EXE_FILES' => [ 'rpsl2acl' ], - 'PREREQ_PM' => { 'Getopt::Long' => 2.34, - 'IO' => 1.2301, - 'Net::CIDR' => 0.14 } + 'VERSION' => '1.01', + 'EXE_FILES' => [ 'rpsl2acl' ] ); diff --git a/vhostcname/MANIFEST b/vhostcname/MANIFEST index 90f74bb..7f92cad 100644 --- a/vhostcname/MANIFEST +++ b/vhostcname/MANIFEST @@ -1,4 +1,5 @@ MANIFEST Makefile.PL +inc/ExtUtils/AutoInstall.pm vhostcname diff --git a/vhostcname/Makefile.PL b/vhostcname/Makefile.PL index 573c5d4..3735412 100644 --- a/vhostcname/Makefile.PL +++ b/vhostcname/Makefile.PL @@ -1,5 +1,29 @@ # -*- perl -*- -use ExtUtils::MakeMaker; +# Copyright (C) 2014 Sergey Poznyakoff <gray@gnu.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +use lib 'inc'; +use ExtUtils::AutoInstall ( + -core => [ + 'Getopt::Long' => 2.34, + 'Net::DNS' => 0.66, + 'Digest::HMAC' => 1.03, + 'Pod::Usage' => 1.51, + 'Pod::Man' => 2.25 + ] +); # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. @@ -8,11 +32,6 @@ WriteMakefile( 'AUTHOR' => 'Sergey Poznyakoff <gray@gnu.org>', 'ABSTRACT' => 'Synchronizes DNS with server names and aliases from Apache virtual host configuration', 'FIRST_MAKEFILE' => 'Makefile', - 'VERSION' => '1.00', + 'VERSION' => '1.01', 'EXE_FILES' => [ 'vhostcname' ], - 'PREREQ_PM' => { 'Getopt::Long' => 2.34, - 'Net::DNS' => 0.66, - 'Digest::HMAC' => 1.03, - 'Pod::Usage' => 1.51, - 'Pod::Man' => 2.25 } ); diff --git a/vhostcname/vhostcname b/vhostcname/vhostcname index 3db1c76..9b6d424 100755 --- a/vhostcname/vhostcname +++ b/vhostcname/vhostcname @@ -1,4 +1,4 @@ -# -*- perl -*- +#! /usr/bin/perl # Copyright (C) 2014 Sergey Poznyakoff <gray@gnu.org> # # This program is free software; you can redistribute it and/or modify |