diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2017-02-10 17:50:31 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2017-02-10 17:50:31 +0200 |
commit | d8ee8a56a3a5ac156f8d840f050b8223fb955636 (patch) | |
tree | 62ac4c1112ea28de5d0b23221db2dcaacbf82ab0 | |
parent | 8a916702efcd22685b02d7dd2760de8e55a2868b (diff) | |
download | syslogck-d8ee8a56a3a5ac156f8d840f050b8223fb955636.tar.gz syslogck-d8ee8a56a3a5ac156f8d840f050b8223fb955636.tar.bz2 |
-rw-r--r-- | .gitignore | 10 | ||||
-rw-r--r-- | MANIFEST | 6 | ||||
-rw-r--r-- | Makefile.PL | 20 | ||||
-rw-r--r-- | bootstrap.pl | 61 | ||||
-rw-r--r-- | syslogck | 8 |
5 files changed, 102 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b43081a --- /dev/null +++ b/.gitignore | |||
@@ -0,0 +1,10 @@ | |||
1 | .emacs* | ||
2 | *~ | ||
3 | /MYMETA.json | ||
4 | /MYMETA.yml | ||
5 | Makefile | ||
6 | /syslogck-*.tar.gz | ||
7 | /tmp | ||
8 | /blib | ||
9 | /pm_to_blib | ||
10 | /inc | ||
diff --git a/MANIFEST b/MANIFEST new file mode 100644 index 0000000..344ac44 --- /dev/null +++ b/MANIFEST | |||
@@ -0,0 +1,6 @@ | |||
1 | Changes | ||
2 | LICENSE | ||
3 | Makefile.PL | ||
4 | MANIFEST This list of files | ||
5 | inc/ExtUtils/AutoInstall.pm | ||
6 | syslogck | ||
diff --git a/Makefile.PL b/Makefile.PL new file mode 100644 index 0000000..8e9812f --- /dev/null +++ b/Makefile.PL | |||
@@ -0,0 +1,20 @@ | |||
1 | # -*- perl -*- | ||
2 | use strict; | ||
3 | use lib 'inc'; | ||
4 | use ExtUtils::AutoInstall ( | ||
5 | -core => { | ||
6 | 'Getopt::Long' => 2.34, | ||
7 | 'File::Basename' => 2.84, | ||
8 | 'Pod::Usage' => 1.51, | ||
9 | 'Pod::Man' => 2.25, | ||
10 | 'Sys::Syslog' => 0.29 | ||
11 | } | ||
12 | ); | ||
13 | |||
14 | WriteMakefile(NAME => 'syslogck', | ||
15 | ABSTRACT_FROM => 'syslogck', | ||
16 | VERSION_FROM => 'syslogck', | ||
17 | AUTHOR => 'Sergey Poznyakoff <gray@gnu.org>', | ||
18 | LICENSE => 'gpl', | ||
19 | EXE_FILES => [ 'syslogck' ] | ||
20 | ); | ||
diff --git a/bootstrap.pl b/bootstrap.pl new file mode 100644 index 0000000..90db16a --- /dev/null +++ b/bootstrap.pl | |||
@@ -0,0 +1,61 @@ | |||
1 | #! /usr/bin/perl | ||
2 | # This file is part of acmeman. | ||
3 | # Copyright (C) 2014, 2017 Sergey Poznyakoff <gray@gnu.org> | ||
4 | # | ||
5 | # This program is free software; you can redistribute it and/or modify | ||
6 | # it under the terms of the GNU General Public License as published by | ||
7 | # the Free Software Foundation; either version 3, or (at your option) | ||
8 | # any later version. | ||
9 | # | ||
10 | # This program is distributed in the hope that it will be useful, | ||
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | # GNU General Public License for more details. | ||
14 | # | ||
15 | # You should have received a copy of the GNU General Public License | ||
16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
18 | use strict; | ||
19 | use CPAN; | ||
20 | use Cwd qw(getcwd); | ||
21 | use File::Path qw(mkpath); | ||
22 | |||
23 | #### | ||
24 | my $incdir = "inc/ExtUtils"; | ||
25 | my $topdir = getcwd; | ||
26 | |||
27 | my $modname = "ExtUtils::AutoInstall"; | ||
28 | |||
29 | my $mod = CPAN::Shell->expandany($modname) or die "Can't expand $modname"; | ||
30 | my $file = $mod->inst_file; | ||
31 | my $dir; | ||
32 | |||
33 | if (defined($file)) { | ||
34 | print "$modname installed at $file\n"; | ||
35 | if (-f $file) { | ||
36 | $file =~ s#/[^/]+\.pm$##; | ||
37 | if (-d $file) { | ||
38 | $dir = $file; | ||
39 | } else { | ||
40 | die "Can't find $modname directory"; | ||
41 | } | ||
42 | } | ||
43 | } else { | ||
44 | print "Getting $modname\n"; | ||
45 | my $distro = $mod->get or die "Can't get distribution for $modname"; | ||
46 | $dir = $distro->dir; | ||
47 | } | ||
48 | |||
49 | $file = "$dir/$incdir/AutoInstall.pm"; | ||
50 | $file = "$dir/AutoInstall.pm" unless (-f $file); | ||
51 | -f $file or die "$file not found"; | ||
52 | |||
53 | use autodie; | ||
54 | chdir $topdir; | ||
55 | mkpath $incdir unless -d $incdir; | ||
56 | chdir $incdir; | ||
57 | no autodie; | ||
58 | unlink "AutoInstall.pm"; | ||
59 | use autodie; | ||
60 | symlink $file, "AutoInstall.pm"; | ||
61 | |||
@@ -7,6 +7,8 @@ use Pod::Usage; | |||
7 | use Pod::Man; | 7 | use Pod::Man; |
8 | use Getopt::Long qw(:config gnu_getopt no_ignore_case); | 8 | use Getopt::Long qw(:config gnu_getopt no_ignore_case); |
9 | 9 | ||
10 | our $VERSION = '0.99'; | ||
11 | |||
10 | use constant { | 12 | use constant { |
11 | EX_OK => 0, | 13 | EX_OK => 0, |
12 | EX_USAGE => 64, | 14 | EX_USAGE => 64, |
@@ -39,9 +41,9 @@ can be changed by supplying the name of the file in the command line. Multiple | |||
39 | arguments are allowed. | 41 | arguments are allowed. |
40 | 42 | ||
41 | The configuration parser is very permissive. It selects only lines that | 43 | The configuration parser is very permissive. It selects only lines that |
42 | can reliably be parsed as traditional syslog selector lines. This allows to | 44 | can reliably be parsed as traditional syslog selector lines, and silently |
43 | use B<syslogck> with any flavor of syslog that allows for traditional | 45 | ignores the rest. This allows to use B<syslogck> with any flavor of syslog |
44 | configuration (e.g. B<rsyslogd>). | 46 | that allows for traditional configuration (e.g. B<rsyslogd>). |
45 | 47 | ||
46 | On success (test message appeared in the log), B<syslogck> silently exits with | 48 | On success (test message appeared in the log), B<syslogck> silently exits with |
47 | code B<0>. If the message did not appear in the log within the time out period, | 49 | code B<0>. If the message did not appear in the log within the time out period, |