[gap-scscp] 02/02: first Debian packaging

Jerome Benoit calculus-guest at moszumanska.debian.org
Thu Aug 28 19:16:18 UTC 2014


This is an automated email from the git hooks/post-receive script.

calculus-guest pushed a commit to branch master
in repository gap-scscp.

commit 327c429b107b5df018ffe6d0409f808d743dcf17
Author: Jerome Benoit <calculus at rezozer.net>
Date:   Thu Aug 28 21:04:24 2014 +0200

    first Debian packaging
---
 debian/adhoc/demo/maple2gap.mpl    |  45 ++++++
 debian/changelog                   |  26 ++++
 debian/clean                       |  16 ++
 debian/compat                      |   1 +
 debian/control                     |  25 +++
 debian/copyright                   |  37 +++++
 debian/etc/config.g                |  85 ++++++++++
 debian/etc/configpar.g             |  42 +++++
 debian/etc/server.g                |  93 +++++++++++
 debian/gap-scscp.README.Debian     |  16 ++
 debian/gap-scscp.dir               |   1 +
 debian/gap-scscp.doc-base          |  12 ++
 debian/gap-scscp.docs              |   1 +
 debian/gap-scscp.gapd.default      |  10 ++
 debian/gap-scscp.gapd.init         | 198 +++++++++++++++++++++++
 debian/gap-scscp.gapd.logrotate    |   9 ++
 debian/gap-scscp.install           |  13 ++
 debian/gap-scscp.links             |   5 +
 debian/gap-scscp.lintian-overrides |   1 +
 debian/gap-scscp.manpages          |   1 +
 debian/gap-scscp.postinst          |  16 ++
 debian/gap-scscp.postrm            |  27 ++++
 debian/makedoc.g                   |   4 +
 debian/man/gapd.h2m                |  50 ++++++
 debian/repack                      | 109 +++++++++++++
 debian/rules                       |  31 ++++
 debian/sbin/gapd.in                | 312 +++++++++++++++++++++++++++++++++++++
 debian/source/format               |   1 +
 debian/source/lintian-overrides    |   1 +
 debian/source/options              |   2 +
 debian/watch                       |   4 +
 31 files changed, 1194 insertions(+)

diff --git a/debian/adhoc/demo/maple2gap.mpl b/debian/adhoc/demo/maple2gap.mpl
new file mode 100644
index 0000000..13cfc67
--- /dev/null
+++ b/debian/adhoc/demo/maple2gap.mpl
@@ -0,0 +1,45 @@
+# scscp/demo/maple2gap.mpl
+# exported as is from scscp/demo/maple2gap.mw as Maple script
+# for Debian by Jerome Benoit <calculus at rezozer.net>
+#
+# to run the demo:
+# $ maple maple2gap.mpl
+#
+# Calling GAP using Maple's SCSCP[Client]
+with(SCSCP);
+with(Client);
+GapServer := "chrystal.mcs.st-andrews.ac.uk";
+# Quering the server about its properties:
+#
+GetServiceDescription(GapServer);
+GetAllowedHeads(GapServer);
+# Ask GAP to compute something
+#
+# Evaluate 20! in GAP.
+CallService(GapServer, "scscp_transient_1", "WS_Factorial", [20]);
+# Is 26562357 prime?
+CallService(GapServer, "scscp_transient_1", "IsPrimeInt", [26562357]);
+# Find the library number (ID) of the group in the GAP Small Groups Library
+CallService(GapServer, "scscp_transient_1", "WS_IdGroup", [permgroup(4, {[[1, 2], [3, 4]], [[1, 4], [2, 3]]})]);
+# Find the number of conjugacy classes of the permutation group
+CallService(GapServer, "scscp_transient_1", "NrConjugacyClasses", [permgroup(4, {[[1, 2], [3, 4]], [[1, 4], [2, 3]]})]);
+# Check that two-groups are non-isomorphic since they have different IDs in the GAP Small Group Library (using private CD fpgroup1 by A. Konovalov)
+G := grelgroup({a, b}, {[b, b], [a, b, 1/a, 1/b], [a, a, a, a, a, a, a, a]});
+CallService(GapServer, "scscp_transient_1", "WS_IdGroup", [G]);
+G := grelgroup({a, b}, {[b, b], [a, b, a, b], [a, a, a, a, a, a, a, a]});
+CallService(GapServer, "scscp_transient_1", "WS_IdGroup", [G]);
+m1 := Matrix([[0, 1, 0, 0, 0], [1, 0, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 1, 0], [0, 0, 0, 0, 1]]);
+m2 := Matrix([[0, 0, 1, 0, 0], [1, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 0, 0, 0, 1], [0, 0, 0, 1, 0]]);
+# Find the library number of the group generated by the two matrices from above
+# (using the procedure which accepts the list generators of the group and not the group itself):
+CallService(GapServer, "scscp_transient_1", "GroupIdentificationService", [[m1, m2]]);
+# Now create a remote group generated by two matrices and get a cookie pointing to it so we will be able to use it in further procedure calls:
+res := CallService(GapServer, "scscp_transient_1", "MatrixGroup", [[m1, m2]], output = cookie);
+# The cookie returned by the previous command may be now substituted in procedure calls.
+# For example, since the remote object is a group, it is already a valid argument for  WS_IdGroup:
+CallService(GapServer, "scscp_transient_1", "WS_IdGroup", [res]);
+# In the next example we compute remotely the Sylow 2-subgroup of the group from the previous example, and then get its order:
+sylow2 := CallService(GapServer, "scscp_transient_1", "SylowSubgroup", [res, 2], output = cookie);
+CallService(GapServer, "scscp_transient_1", "Size", [sylow2]);
+
+#
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..c662b1d
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,26 @@
+gap-scscp (2.1.4+ds-1) unstable; urgency=low
+
+  * Initial release (Closes: #738011).
+  * Debianization:
+    - debian/copyright in DEP-5 format;
+    - debian/control:
+      - debhelper build-dep to >= 9;
+      - Standards Version 3.9.5;
+      - Vcs-* headers.
+    - debian/source, format 3.0 (quilt);
+    - debian/watch file;
+    - debian/repack, repack script to clean up and gain size;
+    - debian/rules:
+      - full and minal dh integration;
+      - get-orig-source uscan based target which downloads the currently
+        packaged upstream tarball and repacks it;
+      - default target which basically queries package status with uscan
+        -- output in DEHS format;
+    - gpg-signature check support, neutralize.
+    - daemon script gapd slightly improved, mainly for a better incorporation
+      within an initscript machinery, and documented though a manpage;
+    - initscript for GAP SCSCP server written from scratch;
+    - systemwide configuration files for GAP SCSCP server and clients
+      place in /etc/scscp/gap (Closes: #740737).
+
+ -- Jerome Benoit <calculus at rezozer.net>  Thu, 28 Aug 2014 18:07:19 +0000
diff --git a/debian/clean b/debian/clean
new file mode 100644
index 0000000..9f1c84e
--- /dev/null
+++ b/debian/clean
@@ -0,0 +1,16 @@
+gapd
+gapd.8
+doc/chap*.txt
+doc/chap*.html
+doc/chooser.html
+doc/manual.{tex,aux,out,brf,toc,log,bbl,blg,ind,idx,ilg}
+doc/manual.{pnr,six,lab}
+doc/manual.pdf
+doc/lefttoc.css
+doc/manual.{css,js}
+doc/nocolorprompt.css
+doc/ragged.css
+doc/rainbow.js
+doc/times.css
+doc/toggless.{css,js}
+tst/scscp??.tst
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..d5bad4d
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,25 @@
+Source: gap-scscp
+Section: math
+Priority: optional
+Maintainer: Debian Science Maintainers <debian-science-maintainers at lists.alioth.debian.org>
+Uploaders: Jerome Benoit <calculus at rezozer.net>
+Build-Depends:
+ debhelper (>= 9), help2man,
+ gap, gap-gapdoc, gap-io,
+ texlive-latex-recommended, texlive-fonts-recommended, texlive-latex-extra
+Standards-Version: 3.9.5
+Homepage: http://www.gap-system.org/Packages/scscp.html
+Vcs-Git: git://anonscm.debian.org/debian-science/packages/gap-scscp.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=debian-science/packages/gap-scscp.git
+
+Package: gap-scscp
+Provides: gap-pkg-scscp
+Architecture: all
+Depends: ${misc:Depends}, adduser, gap, gap-gapdoc, gap-io, gap-openmath
+Description: SCSCP protocol in GAP
+ GAP is a system for computational discrete algebra with particular
+ emphasis on computational group theory, but which has already proved
+ useful also in other areas.
+ .
+ This package implements the Symbolic Computation Software
+ Composability Protocol (SCSCP) for GAP.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..9160c98
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,37 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0
+Upstream-Name: GAP package SCSCP
+Upstream-Contact:
+ Alexander Konovalov <alexk at mcs.st-andrews.ac.uk>
+ Steve Linton <sal at cs.st-andrews.ac.uk>
+Source: http://www.gap-system.org/Packages/scscp.html
+Comment:
+ The upstream source tarball is repacked to drop off the regenarated
+ material, namely the documentation, to substantially reduce the size.
+
+Files: *
+Copyright:
+ 2007-2014 Alexander Konovalov <alexk at mcs.st-andrews.ac.uk>
+ 2007-2014 Steve Linton <sal at cs.st-andrews.ac.uk>
+License: GPL-2+
+
+Files: debian/*
+Copyright:
+ 2014 Jerome Benoit <calculus at rezozer.net>
+License: GPL-2+
+
+License: GPL-2+
+ This package 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 2 of the License, or
+ (at your option) any later version.
+ .
+ This package 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 package. If not, see <http://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
diff --git a/debian/etc/config.g b/debian/etc/config.g
new file mode 100644
index 0000000..4346ec7
--- /dev/null
+++ b/debian/etc/config.g
@@ -0,0 +1,85 @@
+###########################################################################
+##
+#W /etc/scscp/gap/config.g                                           Debian
+##
+###########################################################################
+
+###########################################################################
+#
+# General parameters
+#
+
+# setting the default InfoLevels
+SetInfoLevel(InfoSCSCP,0);
+SetInfoLevel(InfoMasterWorker,0);
+
+# If the SuppressOpenMathReferences is set to true, then
+# OMPutReference (lib/openmath.gi) will put the actual
+# OpenMath code for an object whenever it has id or not.
+# This might be needed for compatibility with some systems.
+# This parameter was set to false in the OpenMath package.
+# Uncomment the next line, if you need to change it.
+# SuppressOpenMathReferences := true;
+
+###########################################################################
+#
+# Default parameters for the server mode:
+# * if the server is started using the initscript /etc/init.d/gapd, they may
+#   be overwritten by the default parameters set in /etc/default/gapd;
+# * if the server is started using the script /usr/sbin/gapd, they can be
+#   overwritten by values passed through options (see gapd(8)).
+#
+
+# setting the default hostname to be used in the server mode. May be:
+# * "localhost" or specific string
+# * Hostname(); to determine it automatically
+# * true to listen all network interfaces
+# Uncomment needed line below.
+
+SCSCPserverAddress := "localhost";
+# SCSCPserverAddress := Hostname();
+# SCSCPserverAddress := true;
+
+# setting the default port
+SCSCPserverPort := 26133;
+
+# If SCSCPserverAcceptsOnlyTransientCD is true, the server
+# will accept only procedures from scscp_transient_1 CD.
+# otherwise calls like scscp1.procedure_call(integer2.euler(n))
+# will be also possible (however, it is possible to have a
+# designated procedure EvaluateOpenMathCode to evaluate
+# arbitrary OpenMath code.
+#
+# If you run a public service it is strongly recommended to set
+# this parameter to 'true'
+#
+SCSCPserverAcceptsOnlyTransientCD := true;
+
+# The server may have a backlog of SCSCPqueueLength connections:
+# if the client will try to connect while the server is busy, it
+# will be placed in the queue if the current length of the queue
+# is shorter than SCSCPqueueLength. Otherwise, the connection will
+# be refused.
+SCSCPqueueLength := 5;
+
+# setting the name of the service, for example,
+# "GAP SCSCP service", "Group identification service" etc.
+SCSCPserviceName:="GAP SCSCP service";
+
+# setting information about the version of the service,
+# which may combine packages versions, timestamp when
+# the server was started, and other information
+SCSCPserviceVersion:= Concatenation(
+	"GAP ", GAPInfo.Version,
+	" + SCSCP ", GAPInfo.PackagesInfo.scscp[1].Version );
+
+# setting the default description, which may include, for example,
+# functions exposed, description of resources, contact details of
+# service provider, and any other useful information
+SCSCPserviceDescription:=
+  "Started with the configuration file /etc/scscp/gap/server.g ";
+
+###########################################################################
+##
+#E
+##
diff --git a/debian/etc/configpar.g b/debian/etc/configpar.g
new file mode 100644
index 0000000..af75e86
--- /dev/null
+++ b/debian/etc/configpar.g
@@ -0,0 +1,42 @@
+###########################################################################
+##
+#W /etc/scscp/gap/configpar.g                                        Debian
+##
+###########################################################################
+
+# This file contains global variable SCSCPservers which
+# specifies hosts and ports to search for SCSCP services.
+#
+# 1) To avoid errors, all services must have the called
+#    SCSCP procedure installed and available under the
+#    same name.
+#
+# 2) SCSCPservers is a proper GAP list, so you can use GAP
+#    language constructions to generate it for a range
+#    of port numbers, for example, for specify SCSCP servers
+#    at the the beowulf cluster with hostnames from bwlf01 to
+#    bwlf16 and 4 cores per node you may use:
+#
+#    nrnodes:=16;
+#    nrcores:=4;
+#    SCSCPservers := Cartesian (
+#      List( [1..nrnodes], i->
+#        Concatenation(
+#          "bwlf",
+#          Concatenation( List([1..2-Length(String(i))], i->"0") ),
+#          String(i) ) ),
+#      [26133 .. 26133+nrcores-1] );
+#
+# 3) It is better to arrange services in this list in a way
+#    that faster services and services with shorter latency
+#    will be located in the beginning of the list, this will
+#    optimise the initial placement of tasks and will speed
+#    up computation when the number of tasks is smaller than
+#    the number of services.
+#
+SCSCPservers:= List( [26133..26134], i-> [ "localhost",  i ] );
+
+###########################################################################
+##
+#E
+##
diff --git a/debian/etc/server.g b/debian/etc/server.g
new file mode 100644
index 0000000..99b93bb
--- /dev/null
+++ b/debian/etc/server.g
@@ -0,0 +1,93 @@
+#############################################################################
+##
+#W /etc/scscp/gap/server.g                                             Debian
+##
+#############################################################################
+
+#############################################################################
+#
+# This is a simple sample SCSCP server configuration file.
+#
+#############################################################################
+
+#############################################################################
+#
+# The service provider can start the server just by the command
+# $ gap /etc/scscp/gap/server.g
+#
+#############################################################################
+
+#############################################################################
+#
+# Load necessary packages and read external files.
+# Put here and other commands if needed.
+#
+#############################################################################
+
+LogTo(); # to close log file if it was opened from .gaprc
+LoadPackage("scscp");
+
+#############################################################################
+#
+# Procedures and functions available for the SCSCP server
+# (you can also install procedures contained in other files,
+# including standard GAP procedures and functions) by adding
+# appropriate calls to InstallSCSCPprocedure below.
+#
+#############################################################################
+
+
+#############################################################################
+SCSCPadditionService:=function(a,b)
+return a+b;
+end;
+
+#############################################################################
+#
+# Installation of procedures to make them available for WS
+# (you can also install procedures contained in other files,
+# including standard GAP procedures and functions)
+#
+#############################################################################
+
+# Simple procedures for tests and demos
+InstallSCSCPprocedure( "Identity", x -> x, "Identity procedure for tests", 1, 1 );
+InstallSCSCPprocedure( "WS_Factorial", Factorial, "See ?Factorial in GAP", 1, 1 );
+InstallSCSCPprocedure( "addition", SCSCPadditionService, "to add two integers", 2, 2 );
+InstallSCSCPprocedure( "WS_Phi", Phi, "Euler's totient function, see ?Phi in GAP", 1, 1 );
+InstallSCSCPprocedure( "Length", Length, 1, 1 );
+InstallSCSCPprocedure( "Size", Size, 1, 1 );
+InstallSCSCPprocedure( "IsPrimeInt", IsPrimeInt, 1, 1 );
+InstallSCSCPprocedure( "NextPrimeInt", NextPrimeInt, 1, 1 );
+InstallSCSCPprocedure( "PrevPrimeInt", PrevPrimeInt, 1, 1 );
+
+
+###########################################################################
+# Series of factorisation methods from the GAP package FactInt
+if LoadPackage("factint") = true then
+  InstallSCSCPprocedure("WS_FactorsTD", FactorsTD,
+	  "FactorsTD from FactInt package, see ?FactorsTD in GAP", 1, 2 );
+  InstallSCSCPprocedure("WS_FactorsPminus1", FactorsPminus1,
+	  "FactorsPminus1 from FactInt package, see ?FactorsPminus1 in GAP", 1, 4 );
+  InstallSCSCPprocedure("WS_FactorsPplus1", FactorsPplus1,
+	  "FactorsPplus1 from FactInt package, see ?FactorsPplus1 in GAP", 1, 4 );
+  InstallSCSCPprocedure("WS_FactorsECM", FactorsECM,
+	  "FactorsECM from FactInt package, see ?FactorsECM in GAP", 1, 5 );
+  InstallSCSCPprocedure("WS_FactorsCFRAC", FactorsCFRAC,
+	  "FactorsCFRAC from FactInt package, see ?FactorsCFRAC in GAP", 1, 1 );
+  InstallSCSCPprocedure("WS_FactorsMPQS", FactorsMPQS,
+	  "FactorsMPQS from FactInt package, see ?FactorsMPQS in GAP", 1, 1 );
+fi;
+
+#############################################################################
+#
+# Finally, we start the SCSCP server.
+#
+#############################################################################
+
+RunSCSCPserver( SCSCPserverAddress, SCSCPserverPort );
+
+#############################################################################
+##
+#E
+##
diff --git a/debian/gap-scscp.README.Debian b/debian/gap-scscp.README.Debian
new file mode 100644
index 0000000..a351370
--- /dev/null
+++ b/debian/gap-scscp.README.Debian
@@ -0,0 +1,16 @@
+GAP SCSCP for Debian GNU/Linux
+==============================
+
+Enabling GAP SCSCP server
+-------------------------
+The GAP SCSCP server has to be enabled in /etc/default/gapd
+to get started; to enable it set START_GAPD to anything else
+than NO/no; by default it is disabled.
+
+Systemwide configuration for GAP SCSCP server and clients
+---------------------------------------------------------
+The configuration folder /etc/scscp/gap is meant to be the place
+for systemwide configuration files for GAP SCSCP server and clients.
+
+
+ -- Jerome Benoit <calculus at rezozer.net>  Thu, 28 Aug 2014 18:08:17 +0000
diff --git a/debian/gap-scscp.dir b/debian/gap-scscp.dir
new file mode 100644
index 0000000..3920612
--- /dev/null
+++ b/debian/gap-scscp.dir
@@ -0,0 +1 @@
+/etc/scscp/gap
diff --git a/debian/gap-scscp.doc-base b/debian/gap-scscp.doc-base
new file mode 100644
index 0000000..898e9ec
--- /dev/null
+++ b/debian/gap-scscp.doc-base
@@ -0,0 +1,12 @@
+Document: gap-scscp
+Title: SCSCP
+Author:
+ Alexander Konovalov
+ Steve Linton
+Abstract:
+ The GAP package SCSCP implements the Symbolic Computation Software
+ Composability protocol for the computational algebra system GAP.
+Section: Science/Mathematics
+
+Format: pdf
+Files: /usr/share/doc/gap-scscp/doc/manual.pdf
diff --git a/debian/gap-scscp.docs b/debian/gap-scscp.docs
new file mode 100644
index 0000000..e845566
--- /dev/null
+++ b/debian/gap-scscp.docs
@@ -0,0 +1 @@
+README
diff --git a/debian/gap-scscp.gapd.default b/debian/gap-scscp.gapd.default
new file mode 100644
index 0000000..40edadd
--- /dev/null
+++ b/debian/gap-scscp.gapd.default
@@ -0,0 +1,10 @@
+# GAP SCSCP server default file sourced by the initscript `/etc/init.d/gapd'.
+#
+
+# To enable gapd via the initscript set START_GAPD=YES (init script variable)
+START_GAPD=NO
+
+# Options for gapd
+# see gapd(8) for details
+##GAPD_OPTIONS="-l -p 26133 -t log --infolevel 0"
+GAPD_OPTIONS=""
diff --git a/debian/gap-scscp.gapd.init b/debian/gap-scscp.gapd.init
new file mode 100644
index 0000000..41f7c57
--- /dev/null
+++ b/debian/gap-scscp.gapd.init
@@ -0,0 +1,198 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          gapd
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: GAP SCSCP server
+# Description:       SCSCP server for the GAP Computer Algebraic System
+### END INIT INFO
+
+#
+# Author: Jerome Benoit <calculus at rezozer.net>
+#
+
+# Do NOT "set -e"
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="GAP SCSCP server"
+NAME=gapd
+REALNAME=gap
+DAEMON=/usr/sbin/gapd
+DAEMONUSER=_gapd
+DAEMONARGS="-t log"
+RUNDIR=/var/run/gapd
+LOCKFILE=$RUNDIR/gapd.lock
+PIDFILE=$RUNDIR/gapd.pid
+WKSFILE=$RUNDIR/gapd.wks
+LOGDIR=/var/log/gapd
+LOGFILE=$LOGDIR/gapd.log
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+# Exit if the DAEMONUSER does not exist
+if ! getent passwd | grep -q "^$DAEMONUSER:"; then exit 0 ; fi
+
+# Cleanup enviroment
+unset TMPDIR TMP TEMPDIR TEMP LANG LANGUAGE
+
+# Reset TMPDIR
+export TMPDIR=$(su -l $DAEMONUSER -c 'printenv TMPDIR')
+[ "$TMPDIR" ] || unset TMPDIR
+
+# Read configuration variable file if it is present
+GAPD_OPTIONS=""
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+DAEMONARGS="$DAEMONARGS $GAPD_OPTIONS"
+
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+
+# Define LSB log_* functions.
+. /lib/lsb/init-functions
+
+# START_GAPD meant to be set up in /etc/default/$NAME
+case "$START_GAPD" in
+  NO|no)
+    START_GAPD=NO
+  ;;
+  *)
+    START_GAPD=YES
+  ;;
+esac
+
+daemon_mkdir()
+{
+	local dmod=$1
+	local ddir=$2
+	mkdir --parents $ddir
+	chmod $dmod $ddir
+	chown $DAEMONUSER $ddir
+	chgrp $DAEMONUSER $ddir
+}
+
+daemon_touch_log()
+{
+	touch $LOGFILE
+	chmod 0640 $LOGFILE
+	chown $DAEMONUSER $LOGFILE
+	chgrp $DAEMONUSER $LOGFILE
+}
+
+do_start()
+{
+	# Return
+	#   0 if daemon has been started
+	#   1 if daemon was already running
+	#   2 if daemon could not be started
+	#   4 if daemon is disabled
+
+	[ "$START_GAPD" = "NO"  ] && return 4
+
+	local counter=60
+	local WORKSPACE
+
+	daemon_mkdir 0700 $RUNDIR
+	daemon_mkdir 0750 $LOGDIR
+
+	daemon_touch_log
+
+	start-stop-daemon --start --quiet --chuid $DAEMONUSER --pidfile $PIDFILE --startas $DAEMON --test > /dev/null 2>&1 || return 1
+
+	WORKSPACE=$(mktemp --quiet --tmpdir --directory gapd-XXXXXXXXXXX) > /dev/null 2>&1 || return 2
+	chown $DAEMONUSER $WORKSPACE
+	chgrp $DAEMONUSER $WORKSPACE
+	export TMPDIR=$WORKSPACE
+	echo $WORKSPACE > $WKSFILE
+
+	start-stop-daemon --start --quiet --chuid $DAEMONUSER --chdir $WORKSPACE --pidfile $PIDFILE --startas $DAEMON -- $DAEMONARGS > /dev/null 2>&1 || return 2
+
+	while [ -f ${LOCKFILE} -a 0 -lt $counter ]; do
+		sleep 0.5
+		counter=$((counter - 1))
+	done
+
+	return 0
+}
+
+do_stop()
+{
+	# Return
+	#   0 if daemon has been stopped
+	#   1 if daemon was already stopped
+	#   2 if daemon could not be stopped
+	#   other if a failure occurred
+
+	local WORKSPACE
+
+	start-stop-daemon --stop --quiet --user $DAEMONUSER --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $REALNAME
+	RETVAL="$?"
+	[ "$RETVAL" = 2 ] && return 2
+
+	sleep 0.25
+
+	start-stop-daemon --stop --quiet --user $DAEMONUSER --oknodo --retry=0/30/KILL/5 --exec $DAEMON
+	[ "$?" = 2 ] && return 2
+
+	if [ -f $WKSFILE ]; then
+		WORKSPACE=$(cat $WKSFILE)
+		if [ -d $WORKSPACE ]; then
+			rm -rf $WORKSPACE
+		fi
+		rm -f $WKSFILE
+	fi
+	rm -f $PIDFILE
+
+	return "$RETVAL"
+}
+
+case "$1" in
+  start)
+	[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+	do_start
+	case "$?" in
+		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+		4) [ "$VERBOSE" != no ] && { log_progress_msg "disabled, see /etc/default/gapd" ; log_end_msg 255 ; } ;;
+	esac
+	;;
+  stop)
+	[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+	do_stop
+	case "$?" in
+		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+	esac
+	;;
+  status)
+	status_of_proc -p $PIDFILE "$DAEMON" "$NAME" && exit 0 || exit $?
+	;;
+  restart|force-reload)
+	log_daemon_msg "Restarting $DESC" "$NAME"
+	do_stop
+	case "$?" in
+	  0|1)
+		do_start
+		case "$?" in
+			0) log_end_msg 0 ;;
+			1) log_end_msg 1 ;; # Old process is still running
+			*) log_end_msg 1 ;; # Failed to start
+		esac
+		;;
+	  *)
+		# Failed to stop
+		log_end_msg 1
+		;;
+	esac
+	;;
+  *)
+	echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
+	exit 3
+	;;
+esac
+
+:
diff --git a/debian/gap-scscp.gapd.logrotate b/debian/gap-scscp.gapd.logrotate
new file mode 100644
index 0000000..2832fef
--- /dev/null
+++ b/debian/gap-scscp.gapd.logrotate
@@ -0,0 +1,9 @@
+/var/log/gapd/gapd.log {
+	size 8M
+	missingok
+	rotate 5
+	compress
+	delaycompress
+	notifempty
+	create 0640 _gapd _gapd
+}
diff --git a/debian/gap-scscp.install b/debian/gap-scscp.install
new file mode 100644
index 0000000..8ec740e
--- /dev/null
+++ b/debian/gap-scscp.install
@@ -0,0 +1,13 @@
+gapd usr/sbin
+debian/etc/config.g debian/etc/configpar.g debian/etc/server.g etc/scscp/gap
+config.g configpar.g usr/share/gap/pkg/scscp/example
+PackageInfo.g init.g read.g usr/share/gap/pkg/scscp
+lib/* usr/share/gap/pkg/scscp/lib
+par/* usr/share/gap/pkg/scscp/par
+tracing/* usr/share/gap/pkg/scscp/tracing
+tst/* usr/share/gap/pkg/scscp/tst
+doc/*.txt doc/*.html doc/manual.six doc/manual.pdf usr/share/gap/pkg/scscp/doc
+doc/img/*.jpg usr/share/gap/pkg/scscp/doc/img
+demo/* usr/share/gap/pkg/scscp/demo
+example/* usr/share/gap/pkg/scscp/example
+debian/adhoc/demo/* usr/share/gap/pkg/scscp/demo
diff --git a/debian/gap-scscp.links b/debian/gap-scscp.links
new file mode 100644
index 0000000..cc5d90b
--- /dev/null
+++ b/debian/gap-scscp.links
@@ -0,0 +1,5 @@
+etc/scscp/gap/config.g usr/share/gap/pkg/scscp/config.g
+etc/scscp/gap/configpar.g usr/share/gap/pkg/scscp/configpar.g
+usr/share/gap/pkg/scscp/doc usr/share/doc/gap-scscp/doc
+usr/share/gap/pkg/scscp/example usr/share/doc/gap-scscp/example
+usr/share/gap/pkg/scscp/demo usr/share/doc/gap-scscp/demo
diff --git a/debian/gap-scscp.lintian-overrides b/debian/gap-scscp.lintian-overrides
new file mode 100644
index 0000000..fc882fe
--- /dev/null
+++ b/debian/gap-scscp.lintian-overrides
@@ -0,0 +1 @@
+no-upstream-changelog
diff --git a/debian/gap-scscp.manpages b/debian/gap-scscp.manpages
new file mode 100644
index 0000000..c8bed27
--- /dev/null
+++ b/debian/gap-scscp.manpages
@@ -0,0 +1 @@
+gapd.8
diff --git a/debian/gap-scscp.postinst b/debian/gap-scscp.postinst
new file mode 100644
index 0000000..42a027c
--- /dev/null
+++ b/debian/gap-scscp.postinst
@@ -0,0 +1,16 @@
+#!/bin/sh
+# postinst script for gap-scscp
+set -e
+DAEMONUSER=_gapd
+case "${1}" in
+	configure)
+		if ! getent passwd | grep -q "^${DAEMONUSER}:" ; then
+			echo -n "Adding ${DAEMONUSER} system account..."
+			adduser --quiet --system --group --force-badname --shell /bin/sh --home /var/lib/${DAEMONUSER#_} --gecos "GAP SCSCP server daemon" ${DAEMONUSER}
+			echo " done"
+		fi
+		;;
+	*)
+		;;
+esac
+#DEBHELPER#
diff --git a/debian/gap-scscp.postrm b/debian/gap-scscp.postrm
new file mode 100644
index 0000000..eaf38c6
--- /dev/null
+++ b/debian/gap-scscp.postrm
@@ -0,0 +1,27 @@
+#!/bin/sh
+# postrm script for gap-scscp
+set -e
+DAEMONUSER=_gapd
+#DEBHELPER#
+case "${1}" in
+	remove)
+		rm -rf /var/run/${DAEMONUSER#_}
+		;;
+	purge)
+		rm -rf /var/run/${DAEMONUSER#_}
+		if getent passwd | grep -q "^${DAEMONUSER}:" ; then
+			echo -n "Removing ${DAEMONUSER} system account..."
+			if [ -x "$(command -v deluser)" ]; then
+				DAEMONHOME=$(getent passwd | sed -e '/^'${DAEMONUSER}':/!d' | cut -d: -f6)
+				deluser --quiet --system ${DAEMONUSER} || true
+				rm -rf ${DAEMONHOME}
+				rm -rf /var/log/${DAEMONUSER#_}
+				echo " done"
+			else
+				echo " aborted because deluser command was not found" >&2
+			fi
+		fi
+		;;
+	*)
+		;;
+esac
diff --git a/debian/makedoc.g b/debian/makedoc.g
new file mode 100644
index 0000000..e4a5f37
--- /dev/null
+++ b/debian/makedoc.g
@@ -0,0 +1,4 @@
+# debian/makedoc.g -- GAP script
+SetPackagePath("scscp",".");
+LoadPackage("scscp");;
+Read("lib/buildman.g");
diff --git a/debian/man/gapd.h2m b/debian/man/gapd.h2m
new file mode 100644
index 0000000..be447b4
--- /dev/null
+++ b/debian/man/gapd.h2m
@@ -0,0 +1,50 @@
+[FILES]
+.TP
+.I /etc/scscp/gap/server.g
+This file is the GAP SCSCP server configuration file
+on Debian system:
+it
+loads all necessary packages,
+reads all needed code,
+installs all procedures which will be exposed to the client
+and finally starts the SCSCP server itself.
+.TP
+.I /etc/scscp/gap/config.g
+This file sets the default parameters needed by the GAP SCSCP package;
+it is fully commented.
+.TP
+.I /etc/scscp/gap/
+This directory is meant to be the default location
+on Debian system
+for all systemwide configuration material needed by
+the GAP SCSCP server
+and any GAP SCSCP client.
+
+[AUTHORS]
+Alexander Konovalov and Steve Linton.
+The GAP Daemon script
+.BR gapd
+was slightly improved
+with backward compatibility
+and documented hereby
+by Jerome Benoit
+on behalf of the Debian Science Team
+(August 2014).
+
+[COPYRIGHT]
+Copyright \(co 2007-2014 by Alexander Konovalov and Steve Linton
+
+GAP SCSCP package 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 2 of the License, or (at your option) any later version.
+
+[SEE ALSO]
+.BR gap (1),
+.BR hostname (1)
+
+The complete manual
+for the GAP SCSCP package
+is available at
+/usr/share/gap/pkg/scscp/doc
+or via the GAP online help system.
diff --git a/debian/repack b/debian/repack
new file mode 100755
index 0000000..3c5b6c4
--- /dev/null
+++ b/debian/repack
@@ -0,0 +1,109 @@
+#!/bin/bash
+
+PACKAGE_NAME=gap-scscp
+
+set -e
+set -u
+
+usage() {
+	echo "Usage: repack --upstream-version <ver> <downloaded file>"
+	exit 1
+	}
+
+if [ "$#" != "3" ]; then
+	usage
+fi
+if [ "$1" != "--upstream-version" ]; then
+	usage
+fi
+if [ ! -f "$3" ]; then
+	if [ -n "$3" ]; then
+		echo "$3 doesn't exist"
+	fi
+	usage
+fi
+UPSTREAM_VERSION="$2"
+UPSTREAM_TARBALLZZ="$3"
+
+DEBIAN_SUFFIX="+ds"
+####DEBIAN_ENCAPSULATEDFOLDERNAME="${PACKAGE_NAME}-usrc"
+
+DEBIAN_UVERSION=${UPSTREAM_VERSION}${DEBIAN_SUFFIX}
+DEBIAN_ROOTFOLDERNAME="${PACKAGE_NAME}-${DEBIAN_UVERSION}.orig"
+DEBIAN_TARBALLXZ="$(dirname $UPSTREAM_TARBALLZZ)/${PACKAGE_NAME}_${DEBIAN_UVERSION}.orig.tar.xz"
+
+REPACK_TMPDIR=`mktemp -d ./repackXXXXXX`
+REPACK_TMPDIR=$(readlink -f "$REPACK_TMPDIR")
+trap "/bin/rm -rf \"$REPACK_TMPDIR\"" QUIT INT EXIT
+
+message() {
+	echo
+	echo "-- -- $1"
+	echo
+	}
+
+message "Repackaging $UPSTREAM_TARBALLZZ"
+
+UPSTREAM_ROOTFOLDER="${REPACK_TMPDIR}/unpacked"
+mkdir "${UPSTREAM_ROOTFOLDER}"
+tar -C "${UPSTREAM_ROOTFOLDER}" -xf "${UPSTREAM_TARBALLZZ}" || unzip -d "${UPSTREAM_ROOTFOLDER}" "${UPSTREAM_TARBALLZZ}"
+if [ `ls -1 "${UPSTREAM_ROOTFOLDER}" | wc -l` -eq 1 ]; then
+	UPSTREAM_ROOTFOLDER="${UPSTREAM_ROOTFOLDER}/`ls -1 "${UPSTREAM_ROOTFOLDER}"`"
+fi
+
+DEBIAN_ROOTFOLDER="${REPACK_TMPDIR}/${DEBIAN_ROOTFOLDERNAME}"
+## repack
+####set -f
+REPACK_WORKING_FOLDER=$(pwd)
+cd "${UPSTREAM_ROOTFOLDER}"
+
+####. "${REPACK_WORKING_FOLDER}/debian/repack.local"
+## wipe out
+## clean up
+rm --verbose --force -- doc/chap*.txt
+rm --verbose --force -- doc/chap*.html
+rm --verbose --force -- doc/chooser.html
+rm --verbose --force -- doc/manual.{tex,aux,out,brf,toc,log,bbl,blg,ind,idx,ilg}
+rm --verbose --force -- doc/manual.{pnr,six,lab}
+rm --verbose --force -- doc/manual.pdf
+rm --verbose --force -- doc/lefttoc.css
+rm --verbose --force -- doc/manual.{css,js}
+rm --verbose --force -- doc/nocolorprompt.css
+rm --verbose --force -- doc/ragged.css
+rm --verbose --force -- doc/rainbow.js
+rm --verbose --force -- doc/times.css
+rm --verbose --force -- doc/toggless.{css,js}
+rm --verbose --force -- tst/scscp??.tst
+#:
+
+cd ${REPACK_WORKING_FOLDER}
+set +f
+## end
+####if [ -n "${DEBIAN_ENCAPSULATEDFOLDERNAME}" ]; then
+####	mkdir "${DEBIAN_ROOTFOLDER}"
+####	mv "${UPSTREAM_ROOTFOLDER}" "${DEBIAN_ROOTFOLDER}/${DEBIAN_ENCAPSULATEDFOLDERNAME}"
+####else
+	mv "${UPSTREAM_ROOTFOLDER}" "${DEBIAN_ROOTFOLDER}"
+####fi
+
+REPACK_TARBALL="${REPACK_TMPDIR}/repacked.tar"
+REPACK_TARBALLXZ="${REPACK_TARBALL}.xz"
+( cd "${REPACK_TMPDIR}" && \
+	find -L "${DEBIAN_ROOTFOLDERNAME}" -xdev -type f -print | sort | \
+	tar -T-  --owner=root --group=root --mode=a+rX --create --file "${REPACK_TARBALL}" \
+	)
+xz -9e < "${REPACK_TARBALL}" > "${REPACK_TARBALLXZ}"
+mv "${REPACK_TARBALLXZ}" "${DEBIAN_TARBALLXZ}"
+
+message "Testing ${DEBIAN_TARBALLXZ}"
+
+xz --verbose --test "${DEBIAN_TARBALLXZ}"
+
+message "Printing information about ${DEBIAN_TARBALLXZ}"
+
+xz --verbose --list "${DEBIAN_TARBALLXZ}"
+
+message "Quitting"
+
+##
+## eos
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..60b5dfa
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,31 @@
+#!/usr/bin/make -f
+
+GAP=/usr/bin/gap
+
+DEB_PKG_VERSION ?= $(shell dpkg-parsechangelog | sed -n -e '/^Version:/s/Version: //p')
+
+H2MFLAGS = \
+	--manual="GAP SCSCP package" \
+	--source="GAP SCSCP (Debian $(DEB_PKG_VERSION))" \
+	--no-info
+
+default:
+	@uscan --no-conf --dehs --report || true
+
+%:
+	dh $@
+
+override_dh_auto_build:
+	sed 's/@DEB_PKG_VERSION@/$(DEB_PKG_VERSION)/g' debian/sbin/gapd.in > gapd
+	chmod a+x gapd
+	help2man $(H2MFLAGS) -s 8 -n "GAP Daemon" -I debian/man/gapd.h2m -o gapd.8 ./gapd
+	cat debian/makedoc.g | $(GAP) -A -q -T
+
+override_dh_installinit:
+	dh_installinit --name gapd
+
+override_dh_installlogrotate:
+	dh_installlogrotate --name gapd
+
+get-orig-source:
+	uscan --no-conf --download-current-version --verbose
diff --git a/debian/sbin/gapd.in b/debian/sbin/gapd.in
new file mode 100755
index 0000000..069f17c
--- /dev/null
+++ b/debian/sbin/gapd.in
@@ -0,0 +1,312 @@
+#!/bin/sh
+###########################################################################
+scriptversion="2.1.4 (Debian @DEB_PKG_VERSION@)"
+###########################################################################
+##
+#W gapd                   The SCSCP package             Alexander Konovalov
+#W                                                             Steve Linton
+##
+## gapd [-h host] [-a] [-l] [-u] [-p port] [-t]
+##
+## The following options may be used to overwrite the default method to
+## specify the hostname to run GAP SCSCP server, stated in scscp/config.g :
+##
+## 1) if '-h host' is specified, then the server will be started at 'host'.
+##    'host' may be given as machine name with or without domain or even as
+##    'localhost', though we have -l option for that purpose
+##
+## 2) if '-a' is specified, then the output of the call to 'hostname' will
+##    be used as the SCSCP server address
+##
+## 3) if '-l' is specified, then the server will be started at localhost
+##    and will not accept any incoming connections from the outside
+##
+## 4) if '-u' is specified, the server will be started in a "universal"
+##    mode and will accept all incoming connections
+##
+## The options 1-4 above are incompatible, so in case several of them will
+## be given, only the option with the biggest number will be used
+##
+## If none of the options 1-4 above is stated, the hostname for the server
+## will be taken from the scscp/config.g file
+##
+## Additionally, you may use the following options:
+##
+## 5) if '-p port' is specified, this will overwrite the default port for
+##    the SCSCP server given in scscp/config.g
+##
+## 6) if '-t' is specified then the output will be redirected to a
+##    temporary file, which name will be displayed on screen during
+##    startup. Otherwise, by default it will be redirected to /dev/null
+##
+###########################################################################
+##
+##  modified on behalf of Debian by Jerome Benoit <calculus at rezozer.net>
+##
+###########################################################################
+scriptname=${0##*/}
+###########################################################################
+##
+## PART 0. DAEMON VARIABLES
+##
+###########################################################################
+##
+CONFDIR=/etc/scscp/gap
+RUNDIR=/var/run/gapd
+LOGDIR=/var/log/gapd
+LOCKFILE=$RUNDIR/gapd.lock
+PIDFILE=$RUNDIR/gapd.pid
+LOGFILE=$LOGDIR/gapd.log
+##
+###########################################################################
+
+###########################################################################
+## USAGE
+###########################################################################
+##
+## usage string formatted with help2man in mind
+usage="\
+Usage: $scriptname [-h HOST|-a|-l|-u] [-p PORT] [-t [MODE]] \
+[--infolevel[-scscp|-master] LEVEL] [--help] [--version]
+
+GAP Daemon - GAP SCSCP server daemon
+
+Options:
+   -h HOST\tStart at host HOST: HOST may be given as machine name with or
+          \twithout domain or as 'localhost' (see option -l for that purpose).
+   -a     \tSet server address to the one given by hostname(1).
+   -l     \tStart at localhost: reject incoming any connection from the outside.
+   -u     \tStart in \`universal' mode: accept all incoming connections.
+
+   -p PORT\tSet server port to PORT, default port set in \`${CONFDIR}/config.g'.
+
+   -t MODE\tRedirect the server session output according to the following MODEs:
+          \tMODE=no sink the output to \`/dev/null' (default behaviour);
+          \tMODE=log redirect the output to \`${LOGFILE}';
+          \tMODE=yes redirect the output to a temporary file, which name is displayed
+          \t(and printed to \`${LOGFILE}' for granted users);
+          \tthe implicit mode is MODE=yes for backward compatibility.
+
+   --infolevel-scscp LEVEL  \tSet the GAP InfoLevel for SCSCP to LEVEL.
+   --infolevel-master LEVEL \tSet the GAP InfoLevel for MasterWorker to LEVEL.
+   --infolevel LEVEL        \tIndiscriminately set the GAP InfoLevel_s to LEVEL.
+
+   --help    \tPrint this help text and exit.
+   --version \tOutput version information and exit.
+
+"
+##
+###########################################################################
+
+###########################################################################
+##
+## PART 1. MODIFY PATHS IF NEEDED
+##
+###########################################################################
+##
+##  Define the local call of GAP and call options, if necessary, for
+##  example, memory usage, start with the workspace etc. The path may be
+##  relative (to start from this directory) or absolute.
+##
+CGAP=/usr/bin/gap
+GAP="$CGAP -b -r"
+##
+###########################################################################
+##
+##  Define the configuration file for the SCSCP server. Note that since GAP
+##  reads the configuration file immediately before starting SCSCP server,
+##  you may redefine in it all variables that were set to their default
+##  values in scscp/config.g and scscp/configpar.g files (explicitly or
+##  reading your appropriately modified private copies of that files).
+##  The path may be relative (to start from this directory) or absolute.
+##
+SCSCP_CONFIG=${CONFDIR}/server.g
+##
+##
+###########################################################################
+
+###########################################################################
+##
+## PART 2. YOU NEED NOT TO MODIFY ANYTHING BELOW
+##
+###########################################################################
+##
+##  Parse the arguments.
+##
+autohost="no"
+localhost="no"
+unimode="no"
+use_temp_file="no"
+host=";"
+port=";"
+infolevel_scscp=0
+infolevel_master=0
+
+option="yes"
+while [ $option = "yes" ]; do
+  option="no"
+  case $1 in
+    -a) shift; option="yes"; autohost="yes";;
+    -h) shift; option="yes"; host=":=\""$1"\";"; shift;;
+    -l) shift; option="yes"; localhost="yes";;
+    -u) shift; option="yes"; unimode="yes";;
+    -p) shift; option="yes"; port=":="$1";"; shift;;
+    -t) shift; option="yes";
+        if [ 0 -lt $# ]; then
+          case "$1" in
+            -*) ;;
+					  *)
+              case "$1" in
+                l|lo|log) use_temp_file="log" ;;
+                n|no) use_temp_file="no" ;;
+                y|ye|yes|*) use_temp_file="yes" ;;
+              esac
+						  shift
+              ;;
+          esac
+				else
+				  use_temp_file="yes"
+				fi
+				;;
+		--infolevel-scscp) shift; option="yes"; infolevel_scscp=$1; shift;;
+		--infolevel-master) shift; option="yes"; infolevel_master=$1; shift;;
+		--infolevel) shift; option="yes";
+				infolevel_scscp=$1; shift; infolevel_master=$infolevel_scscp;;
+		--help) echo "$usage"; exit $?;;
+		--version) echo "$scriptname $scriptversion"; exit $?;;
+  esac
+done
+
+if [ -n ${TMPDIR} -a ! -w ${TMPDIR} ]; then
+	unset TMPDIR
+fi
+
+case "$use_temp_file" in
+	log)
+		OUTFILE=${LOGFILE}
+		;;
+	yes)
+		OUTFILE=$(mktemp --quiet --tmpdir gapd-XXXXXXXXXXX.log)
+		if [ -w ${LOGFILE} ]; then
+			cat >> ${LOGFILE} <<- EOM
+				#############################################################
+				#D  log: ${OUTFILE}
+				EOM
+		fi
+		echo "Starting SCSCP server with output to ${OUTFILE}"
+		;;
+	*)
+		OUTFILE="/dev/null"
+		;;
+esac
+
+if [ $autohost = "yes" ]; then
+	host=":=Hostname();"
+fi;
+
+if [ $localhost = "yes" ]; then
+	host=":=false;"
+fi;
+
+if [ $unimode = "yes" ]; then
+	host=":=true;"
+fi;
+
+if [ $infolevel_scscp -lt 0 ]; then
+	infolevel_scscp=0
+fi;
+
+if [ $infolevel_master -lt 0 ]; then
+	infolevel_master=0
+fi;
+
+# Check whether ${OUTFILE} is writable
+if [ -e ${OUTFILE} ]; then
+	if [ ! -w ${OUTFILE} ]; then
+		echo "the GAP daemon gapd can not write to the file ${OUTFILE}" 1>&2
+		exit 2
+	fi
+else
+	OUTFOLDER=$(dirname ${OUTFILE})
+	if [ ! -w ${OUTFOLDER} ]; then
+		echo "the GAP daemon gapd can not write into the folder ${OUTFILE}" 1>&2
+		exit 2
+	fi
+fi
+
+# Check whether the GAP system is available
+if [ ! -x $CGAP ]; then
+	echo "the GAP command-line interface $CGAP can not be executed" 1>&2
+	exit 2
+fi
+
+# Check whether the server configuration file is readable
+if [ ! -r "${SCSCP_CONFIG}" ]; then
+	echo "the GAP SCSCP server configuration file ${SCSCP_CONFIG} can not be read" 1>&2
+	exit 2
+fi
+
+# Check whether the GAP daemon gapd is already launching
+if [ -f ${LOCKFILE} ]; then
+	echo "the GAP daemon gapd may already launch as ${LOCKFILE} exists" 1>&2
+	exit 1
+fi
+touch ${LOCKFILE}
+
+# Check whether the GAP SCSCP server is already running
+if [ -f ${PIDFILE} ]; then
+	echo "the GAP SCSCP server may already run as ${PIDFILE} exists" 1>&2
+	rm -f ${LOCKFILE}
+	exit 1
+fi
+
+cat >> ${OUTFILE} <<- EOM
+	#############################################################
+	#D  script: ${0} (${scriptversion})
+	#D  date: $(date -u +%Y%m%dT%H%M%S.%NZ)
+	#D  host: $(hostname)
+	#D  user: $(id -un)
+	#D  infolevel: SCSCP: ${infolevel_scscp}
+	#D  infolevel: MasterWorker: ${infolevel_master}
+	#D  TMPDIR: ${TMPDIR}
+	EOM
+
+exec $GAP -q >> ${OUTFILE} 2>&1 <<-EOGS &
+	GAPDPrePare:=function()
+		local PIDFILE;
+		Print("#I  GAPD: preparing\c");
+		PIDFILE:=OutputTextFile("${PIDFILE}",false);
+		if PIDFILE <> fail then
+			PrintTo(PIDFILE,GETPID(),"\n");
+			CloseStream(PIDFILE);
+			RemoveFile("${LOCKFILE}");
+			Print(".\n\c");
+			return true;
+		fi;
+		RemoveFile("${LOCKFILE}");
+		return fail;
+	end;;
+	GAPDPostPare:=function()
+		Print("#I  GAPD: postparing\c");
+		RemoveFile("${PIDFILE}");
+		Print(".\n\c");
+	end;;
+	InstallAtExit(GAPDPostPare);
+	if GAPDPrePare() = fail then
+		QUIT_GAP();
+	fi;
+	LoadPackage("scscp");;
+	SetInfoLevel(InfoSCSCP,${infolevel_scscp});
+	SetInfoLevel(InfoMasterWorker,${infolevel_master});
+	SCSCPserverAddress${host};
+	SCSCPserverPort${port};
+	Read("${SCSCP_CONFIG}");
+	if SCSCPserverStatus=fail then
+			QUIT_GAP();
+	fi;
+EOGS
+
+###########################################################################
+##
+#E
+##
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides
new file mode 100644
index 0000000..8b06cb1
--- /dev/null
+++ b/debian/source/lintian-overrides
@@ -0,0 +1 @@
+debian-watch-may-check-gpg-signature
diff --git a/debian/source/options b/debian/source/options
new file mode 100644
index 0000000..22a4de9
--- /dev/null
+++ b/debian/source/options
@@ -0,0 +1,2 @@
+compression = xz
+compression-level = 9
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..e27b66a
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,4 @@
+version=3
+opts=dversionmangle=s/\+ds// \
+ftp://ftp.gap-system.org/pub/gap/gap4/tar.bz2/packages/scscp-([\d\.]+)\.tar\.bz2 \
+debian bash debian/repack

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/gap-scscp.git



More information about the debian-science-commits mailing list