makes more sense the other way :)
[yasql.git] / install.pl
blob1a56f15d57897fcc400750226f8c666ef691198e
1 #! /usr/bin/env perl
3 use strict;
5 my $installpath = shift;
6 my $bindir = shift;
7 my $mandir = shift;
8 my $sysconfdir = shift;
10 print "Installing yasql to $bindir/yasql\n";
11 system("$installpath -m 755 yasql $bindir/yasql");
13 unless(-e "$sysconfdir/yasql.conf") {
14 print "Installing yasql.conf to $sysconfdir/yasql.conf\n";
15 system("$installpath -m 644 yasql.conf $sysconfdir/yasql.conf");
16 } else {
17 print "$sysconfdir/yasql.conf exists, skipping config file installation.\n";
18 print "Please read the documentation for info on any new ".
19 "configuration directives\n";
22 if( -f "yasql.1" ) {
23 print "Installing yasql.1 man page to $mandir/man1/yasql.1\n";
24 system("mkdir -p $mandir/man1");
25 system("$installpath -m 644 yasql.1 $mandir/man1/yasql.1");
26 } else {
27 warn "yasql.1 not found, use perldoc $bindir/yasql to read the docs"
30 print "Installation successfull\n";