gnuspool-1.7ubuntu1/ 0000775 0000000 0000000 00000000000 11421757504 011451 5 ustar gnuspool-1.7ubuntu1/Netinst.in 0000775 0000000 0000000 00000012743 11366642365 013445 0 ustar #! /usr/bin/perl
#
# Copyright 2008 Free Software Foundation, Inc.
#
# 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 of the License, 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 .
use Socket;
$prefix = "@prefix@";
$exec_prefix = "@exec_prefix@";
$bindir = "@bindir@";
$sbindir = "@sbindir@";
# Initialise network setup for GNUspool
# This assumes that network code is compiled in which it usually is
# First set up services (see services.h)
# Services for GNUspool
#gnuspool 48100/tcp # Connection port
#gnuspool 48100/udp # Probe port
#gnuspool-feeder 48101/tcp # Feeder port for GNUspool
#gnuspool-netsrv 48102/tcp # External job submission
#gnuspool-netsrv 48102/udp # Client access
#gnuspool-api 48103/tcp # API
#gnuspool-api 48103/udp # API (for wakeup messages)
# Name pnum t/u comment alternative names
@Portlist = ([gnuspool => [48100, 'tcp', 'GNUspool connection port', [qw/xitext spshed spooler/]]],
[gnuspool => [48100, 'udp', 'GNUspool probe port', [qw/xitext spshed spooler/]]],
["gnuspool-feeder" => [48101, 'tcp', 'GNUspool feeder port', [qw/spq/]]],
["gnuspool-netsrv" => [48102, 'tcp', 'GNUspool external job submission', [qw/xtnetsrv/]]],
["gnuspool-netsrv" => [48102, 'udp', 'GNUspool client access', [qw/xtnetsrv/]]],
["gnuspool-api" => [48103, 'tcp', 'GNUspool API', [qw/xtapi/]]],
["gnuspool-api" => [48103, 'udp', 'GNUspool API wakeup', [qw/xtapi/]]]);
# Make lookup for that lot
for my $p (@Portlist) {
my $name = $p->[0];
my $dets = $p->[1];
my $pnum = $dets->[0];
my $istcp = $dets->[1] eq 'tcp';
my @altnames = @{$dets->[3]};
my $v = { NAME => $name, PORT => $pnum, LIST => $p, COMMENT => $dets->[2], ALIAS => \@altnames };
if ($istcp) {
$mtcpnames{$name} = $v;
$mtcpports{$pnum} = $v;
for my $a (@altnames) {
$mtcpnames{$a} = $v;
}
}
else {
$mudpnames{$name} = $v;
$mudpports{$pnum} = $v;
for my $a (@altnames) {
$mudpnames{$a} = $v;
}
}
}
# Read in the services file
while (my ($name,$aliases,$port,$proto) = getservent) {
if ((lc $proto) eq 'tcp') {
my $mp = $mtcpnames{$name};
if ($mp) {
$mp->{HAD} = 1;
$had++;
push @tcpnconflict, {EXP => $mp, READ => $port} if $port != $mp->{PORT};
}
else {
$mp = $mtcpports{$port};
push @tcppconflict, {EXP => $mp, READ => $name} if $mp;
}
}
else {
my $mp = $mudpnames{$name};
if ($mp) {
$mp->{HAD} = 1;
$had++;
push @udpnconflict, {EXP => $mp, READ => $port} if $port != $mp->{PORT};
}
else {
$mp = $mudpports{$port};
push @udppconflict, {EXP => $mp, READ => $name} if $mp;
}
}
}
endservent;
# If we had any check we had all of them
if ($had != 0) {
if ($had != $#Portlist + 1) {
$errors++;
print "Warning - service(s) are missing\n";
for my $p (@Portlist) {
my $name = $p->[0];
my $dets = $p->[1];
my $pnum = $dets->[0];
my $istcp = $dets->[1] eq 'tcp';
if ($istcp) {
my $mp = $mtcpnames{$name};
print "Tcp port $name\n" unless $mp->{HAD};
}
else {
my $mp = $mudpnames{$name};
print "Udp port $name\n" unless $mp->{HAD};
}
}
}
}
if (@tcpnconflict || @tcppconflict || @udpnconflict || @udppconflict) {
for my $c (@tcpnconflict) {
my $name = $c->{EXP}->{NAME};
my $eport = $c->{EXP}->{PORT};
my $rport = $c->{READ};
print "Unexpected TCP port number $rport for $name expecting $eport\n";
$warnings++;
}
for my $c (@tcppconflict) {
my $name = $c->{EXP}->{NAME};
my $eport = $c->{EXP}->{PORT};
my $rname = $c->{READ};
print "TCP port $eport in use by $rname expecting to use it for $name\n";
$warnings++;
}
for my $c (@udpnconflict) {
my $name = $c->{EXP}->{NAME};
my $eport = $c->{EXP}->{PORT};
my $rport = $c->{READ};
print "Unexpected UDP port number $rport for $name expecting $eport\n";
$warnings++;
}
for my $c (@udppconflict) {
my $name = $c->{EXP}->{NAME};
my $eport = $c->{EXP}->{PORT};
my $rname = $c->{READ};
print "UDP port $eport in use by $rname expecting to use it for $name\n";
$warnings++;
}
}
if ($errors) {
print "Aborting due to $errors error(s)\n";
exit 10;
}
unless ($had) {
open(SRV, ">>/etc/services") or die "Cannot open services file\n";
print SRV "# GNUspool services\n";
for my $p (@Portlist) {
my $name = $p->[0];
my $dets = $p->[1];
my $pnum = $dets->[0];
my $proto = $dets->[1];
my $comment = $dets->[2];
my @altnames = @{$dets->[3]};
print SRV "$name\t$pnum/$proto ", join(' ', @altnames), " #$comment\n";
}
close SRV;
}
unless (-f "@sysconfdir@/gnuspool-hosts") {
my $hn = `hostname`;
chop($hn);
my $he = gethostbyname($hn);
my $ha = inet_ntoa($he);
unless ($ha =~ /^127\./) {
if (open(HF, ">/@sysconfdir@/gnuspool-hosts")) {
my $lt = localtime;
print HF "# Host file created on $lt\n\n";
print HF "localaddress\t$ha\n";
close HF;
}
}
}
gnuspool-1.7ubuntu1/STARTUP/ 0000775 0000000 0000000 00000000000 11421757503 012612 5 ustar gnuspool-1.7ubuntu1/STARTUP/Startdirs.in 0000775 0000000 0000000 00000001477 11366642365 015144 0 ustar #! /bin/sh
#
# Copyright 2008 Free Software Foundation, Inc.
#
# 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 of the License, 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 .
#
# Set directories for startup files
prefix=@prefix@
exec_prefix=@exec_prefix@
USERPATH=@bindir@
SPOOLDIR=@spooldir@
gnuspool-1.7ubuntu1/STARTUP/Sysstart.SysV 0000775 0000000 0000000 00000004665 11366642365 015321 0 ustar #! /bin/sh
#
# Copyright 2008 Free Software Foundation, Inc.
#
# 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 of the License, 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 .
#
# System V startup
. ./Startdirs
defaultstate=`sed -e '/:initdefault:/!d
s/^[^:]*:\([^:]*\):.*:/\1/' /etc/inittab`
for loc in /etc/rc.d /etc
do
if [ -d $loc ]
then
rcloc=$loc
break
fi
done
if [ -z "$defaultstate" ] && [ -d $rcloc/rc3.d ]
then
echo "Assuming default startup state is 3...."
defaultstate=3
fi
for loc in /etc/rc.d/init.d /etc/init.d
do
if [ -d $loc ]
then
initdir=$loc
break
fi
done
if [ -z "$rcloc" ] || [ -z "$initdir" ] || [ -z "$defaultstate" ]
then
cat <$Scriptfile
#
# Startup of GNUspool
#
case "\$1" in
start)
# Start GNUspool.
# Delete previous memory-mapped stuff which might have got left behind
rm -f $SPOOLDIR/spmm*
# This allocates space for amaximum of 2000 jobs and 50 printers
# but please adjust as needed
$USERPATH/gspl-start 2000 50
# If you want all your local printers started, uncomment the next two lines
# sleep 5
# $USERPATH/gspl-start -f '*'
echo GNUspool Started
;;
stop)
$USERPATH/gspl-stop -y
echo GNUspool stopped
;;
*)
echo "Usage: \$0 { start | stop }"
exit 1
;;
esac
EOF
chmod 744 $Scriptfile
ln $Scriptfile $rcloc/rc0.d/K01gnuspool
ln $Scriptfile $rcloc/rc$defaultstate.d/S80gnuspool
ln $Scriptfile $rcloc/rc$defaultstate.d/K01gnuspool
fi
gnuspool-1.7ubuntu1/STARTUP/README 0000664 0000000 0000000 00000001450 11421757503 013472 0 ustar Startup routine shell scripts.
=============================
Copyright 2008 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
----------------------------------------------------------------------
These shell scripts are intended to aid the insertion of startup
routines for GNUspool into the /etc/rc* files for various types of
machine.
Please choose the script closest to what you want to do.
"configure" sets up "Startdirs" which is "."-ed to give the directories.
If it gets stuck it will just stop.
Please help us by adding and correcting these files as various people
change their startup files. Thanks!
John Collins
February 2009
gnuspool-1.7ubuntu1/STARTUP/Sysstart.IBM 0000775 0000000 0000000 00000002712 11366642365 015013 0 ustar #! /bin/sh
#
# Copyright 2008 Free Software Foundation, Inc.
#
# 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 of the License, 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 .
#
# Insert system start for IBM
. ./Startdirs
sysname=`uname`
if [ "$sysname" != "AIX" ]
then
cat </dev/null 2>&1;[ $? -ne 0 ]
then
if grep "^gnuspool:" /etc/inittab >/dev/null 2>&1
then
ed -s /etc/inittab <>/etc/inittab
fi
fi
gnuspool-1.7ubuntu1/STARTUP/Sysstart.HP 0000775 0000000 0000000 00000007615 11366642365 014722 0 ustar #! /bin/sh
#
# Copyright 2008 Free Software Foundation, Inc.
#
# 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 of the License, 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 .
#
# Insert system start for HP prior to 11
. ./Startdirs
sysname=`uname`
if [ "$sysname" != 'HP-UX' ]
then
cat </dev/null 2>&1;[ $? -ne 0 ]
then
defaultstate=`sed -e '/:initdefault:/!d
s/^[^:]*:\([^:]*\):.*:/\1/' /etc/inittab`
if [ -d /sbin/rc3.d ]
then
rcloc=/sbin
elif [ -d /etc/rc.d ]
then
rcloc=/etc/rc.d
fi
if [ -z "$defaultstate" ] && [ -d $rcloc/rc3.d ]
then
echo "Assuming default startup state is 3...."
defaultstate=3
fi
for loc in $rcloc/init.d /sbin/init.d /etc/rc.d/init.d /etc/init.d
do
if [ -d $loc ]
then
initdir=$loc
break
fi
done
if [ -z "$rcloc" ] || [ -z "$initdir" ] || [ -z "$defaultstate" ]
then
cat <$Scriptfile
#
# Startup of GNUspool
#
case "\$1" in
start)
# Start GNUspool.
# Delete previous memory-mapped stuff which might have got left behind
rm -f $SPOOLDIR/spmm*
# This allocates space for amaximum of 2000 jobs and 50 printers
# but please adjust as needed
$USERPATH/gspl-start 2000 50
# If you want all your local printers started, uncomment the next two lines
# sleep 5
# $USERPATH/gspl-start -f '*'
echo GNUspool Started
;;
stop)
$USERPATH/gspl-stop -y
echo GNUspool stopped
;;
*)
echo "Usage: \$0 { start | stop }"
exit 1
;;
esac
EOF
chmod 744 $Scriptfile
ln $Scriptfile $rcloc/rc0.d/K01gnuspool
ln $Scriptfile $rcloc/rc$defaultstate.d/S80gnuspool
ln $Scriptfile $rcloc/rc$defaultstate.d/K01gnuspool
fi
else
if [ "$forceme" = "Y" ] || grep startgnuspool /etc/rc >/dev/null 2>&1;[ %? -ne 0 ]
then
if grep startgnuspool /etc/rc >/dev/null 2>&1
then
ed -s /etc/rc <<'EORO'
/startgnuspool()/,/}/d
/startgnuspool/d
w
q
EORO
fi
rm -f /etc/shutdown.d/stopgnuspool
tmped=/tmp/edrc$$
cat >$tmped </etc/shutdown.d/stopgnuspool <