From fc4a92ad209a004b3dc1ba19c086943832174909 Mon Sep 17 00:00:00 2001 From: Fritz Elfert Date: Mon, 3 Feb 2003 22:17:11 +0000 Subject: - More elaborated debian config --- debian/control | 2 +- debian/plptools.config | 47 +++++++++++++++++++++++++++-- debian/plptools.postinst | 67 +++++++++++++++++++++++++++++++++++++++++ debian/plptools.templates | 76 ++++++++++++++++++++++++++++++++++++++++++----- 4 files changed, 181 insertions(+), 11 deletions(-) (limited to 'debian') diff --git a/debian/control b/debian/control index e118c0f..db567d7 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Standards-Version: 3.5.6.1 Package: plptools Architecture: any -Depends: ${shlibs:Depends}, debconf +Depends: ${shlibs:Depends}, debconf (>= 1.0) Description: Access a Psion PDA over a serial link This package lets you access Psion drives over a serial link. You can mount them, pseudo NFS style, access them FTP-like, use a local diff --git a/debian/plptools.config b/debian/plptools.config index 6fe411f..8c2b002 100644 --- a/debian/plptools.config +++ b/debian/plptools.config @@ -4,8 +4,51 @@ set -e # Use debconf baby . /usr/share/debconf/confmodule -# minimalistic for now ;-) -db_text medium plptools/customize || true +db_input medium plptools/ncpd/start || true db_go +db_get plptools/ncpd/start +if [ "$RET" = "true" ] ; then + db_input medium plptools/ncpd/serial || true + db_go + db_input medium plptools/ncpd/listenat || true + db_go + db_get plptools/ncpd/listenat + SEENREM=false + case "$RET" in + 0.0.0.0) + ;; + 127.0.0.1) + ;; + 0.0.0.0:7501) + ;; + 127.0.0.1:7501) + ;; + *) + SEENREM=true + db_set plptools/frontends/remoteaddr "$RET" + esac + db_fset plptools/frontends/remoteaddr seen $SEENREM +else + db_fset plptools/frontends/remoteaddr seen false +fi + +db_input medium plptools/plpnfsd/start || true +db_go +db_input medium plptools/plpnfsd/suid || true +db_go + +db_input medium plptools/plpprintd/start || true +db_go +db_get plptools/plpprintd/start +if [ "$RET" = "true" ] ; then + db_input medium plptools/plpprintd/printqueue || true + db_go +fi + +db_get plptools/ncpd/start +if [ "$RET" = "false" ] ; then + db_input medium plptools/frontends/remoteaddr || true + db_go +fi exit 0 diff --git a/debian/plptools.postinst b/debian/plptools.postinst index 6b5db45..97c6825 100644 --- a/debian/plptools.postinst +++ b/debian/plptools.postinst @@ -25,6 +25,73 @@ set -e case "$1" in configure) + START_NCPD=no + START_PLPNFSD=no + START_PLPPRINTD=no + NCPD_ARGS= + PLPNFSD_ARGS= + PLPPRINTD_ARGS= + FREM= + db_get plptools/ncpd/start + if [ "$RET" = "true" ] ; then + START_NCPD=yes + db_get plptools/ncpd/serial + if [ "$RET" != "/dev/ttyS0" ] ; then + NCPD_ARGS="$NCPD_ARGS -s $RET" + fi + db_get plptools/ncpd/listenat + case "$RET" in + 127.0.0.1) + ;; + 127.0.0.1:7501) + ;; + *) + NCPD_ARGS="$NCPD_ARGS -p $RET" + ;; + esac + else + db_get plptools/frontends/remoteaddr + case "$RET" in + 127.0.0.1) + ;; + 127.0.0.1:7501) + ;; + *) + FREM="-p $RET" + ;; + esac + fi + db_get plptools/plpnfsd/start + if [ "$RET" = "true" ] ; then + START_PLPNFSD=yes + PLPNFSD_ARGS="$FREM" + fi + db_get plptools/plpprintd/start + if [ "$RET" = "true" ] ; then + START_PLPPRINTD=yes + PLPPRINTD_ARGS="$FREM" + db_get plptools/plpprintd/printqueue + if [ "$RET" != "psion" ] ; then + PLPPRINTD_ARGS="$PLPPRINTD_ARGS -s \"lpr -P$RET\"" + fi + fi + cp /etc/plptools.conf /etc/plptools.conf.$$ + cat /etc/plptools.conf.$$ | sed \ + -e "s@START_NCPD=.*@START_NCPD=$START_NCPD@" \ + -e "s@START_PLPNFSD=.*@START_PLPNFSD=$START_PLPNFSD@" \ + -e "s@START_PLPPRINTD=.*@START_PLPPRINTD=$START_PLPPRINTD@" \ + -e "s@NCPD_ARGS=.*@NCPD_ARGS=\"$NCPD_ARGS\"@" \ + -e "s@PLPNFSD_ARGS=.*@PLPNFSD_ARGS=\"$PLPNFSD_ARGS\"@" \ + -e "s@PLPPRINTD_ARGS=.*@PLPPRINTD_ARGS=\"$PLPPRINTD_ARGS\"@" \ + > /etc/plptools.conf \ + && rm -f /etc/plptools.conf.$$ \ + || mv /etc/plptools.conf.$$ /etc/plptools.conf || : + db_get plptools/plpnfsd/suid + if [ "$RET" = "true" ] ; then + chmod u+s /usr/sbin/plpnfsd + else + chmod u-s /usr/sbin/plpnfsd + fi ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/plptools.templates b/debian/plptools.templates index 01232e0..dfa0b7f 100644 --- a/debian/plptools.templates +++ b/debian/plptools.templates @@ -9,12 +9,72 @@ Description: Customize /etc/plptools.conf . Both daemons are disabled by default. You can enable them by editing /etc/plptools.conf. -Description-de: Anpassung von /etc/plptools.conf - Zusätzlich zum Haupt-Daemon "ncpd", stellt das Packet plptools zwei - optionale Daemonen zur Verfügung: + +Template: plptools/ncpd/start +Type: boolean +Default: true +Description: Should ncpd being started during boot? + Normally, ncpd - the daemon which handles the serial connection to a + Psion - is started on boot-up. If you intend to connect your Psion to + another machine on the net and NEVER will use it locally, you can + disable this here. + +Template: plptools/ncpd/serial +Type: string +Default: /dev/ttyS0 +Description: Specify serial line to be used + By default, the Psion is expected to be connected to the first serial + line (COM1:) of your machine. You can change this here. + +Template: plptools/ncpd/listenat +Type: string +Default: 127.0.0.1 +Description: Specify the IP address and port for ncpd + If you intend to use the plptools front-ends from other machines, you + can specify 0.0.0.0 or the IP address of your machine here. Normal + users should keep the default 127.0.0.1! . - plpnfsd (zum Einhängen von Psion-Laufwerken - ähnlich wie NFS) - plpprintd (zum Drucken via PC von einem Psion Serie 5) - . - Beide Daemonen sind standardmäßig abgeschaltet. Sie können aktiviert weden, - indem die Datei /etc/plptools.conf editiert wird. + Note, that THIS IS A SECURITY THREAT as no authentication and no + encryption is used! DO NOT USE THIS on machines which are accessible + from the Internet! + +Template: plptools/plpnfsd/start +Type: boolean +Default: false +Description: Should plpnfsd being started during boot? + If plpnfsd is started during boot-up, it will wait for a Psion being + connected and then automatically mount that Psion. Since this is + done as root, non-privileged users will not have access to the + mounted directory. If you have a single-user machine, you probably + want to start plpnfsd manually when you need it. + +Template: plptools/plpnfsd/suid +Type: boolean +Default: false +Description: Set SUID-root bit of plpnfsd? + For convenience on a single-user machine, plpnfsd can be installed with + the setuid bit enabled. This allows any local user to mount and unmount + a connected Psion. Be warned, that THIS IS A SECURITY THREAT to your + machine. NEVER ENABLE THIS ON A MULTIUSER MACHINE. + +Template: plptools/plpprintd/start +Type: boolean +Default: false +Description: Should plpprintd being started during boot? + If you intend to use the Psion's "Print via PC" feature, you can + enable this option. You must have a working print queue which + is capable of printing Postscript in order to use this feature. + +Template: plptools/plpprintd/printqueue +Type: string +Default: psion +Description: Specify the print queue to be used + Please enter the name of the print queue you want to use for + printing from the Psion. + +Template: plptools/frontends/remoteaddr +Type: string +Description: Specify remote host to be contacted + Since you have ncpd either disabled or listening on a non-standard + address, you should specify the address for the frontents again. + -- cgit v1.2.3