summaryrefslogtreecommitdiff
path: root/packages/p910nd
diff options
context:
space:
mode:
authorTim Ellis <ole@raptor.site>2009-01-24 23:51:08 +0000
committerTim Ellis <ole@raptor.site>2009-01-24 23:51:08 +0000
commit4a6aecfe09aebbe621f5599c66ecd5f82789d743 (patch)
treeedb8909de0cd76d8958fe7305e9f99575ed4e0bb /packages/p910nd
parent4bec73f2d7f21795cfaa7ac1d2d3e9f3e077d529 (diff)
p910nd: Add p910nd, a great little print utility for small devices
Diffstat (limited to 'packages/p910nd')
-rw-r--r--packages/p910nd/files/avahi9
-rwxr-xr-xpackages/p910nd/files/p910nd.init38
-rw-r--r--packages/p910nd/p910nd_0.92.bb42
3 files changed, 89 insertions, 0 deletions
diff --git a/packages/p910nd/files/avahi b/packages/p910nd/files/avahi
new file mode 100644
index 0000000000..313bc14a4d
--- /dev/null
+++ b/packages/p910nd/files/avahi
@@ -0,0 +1,9 @@
+<service-group>
+ <name replace-wildcards="yes">foonas p910nd on %h</name>
+ <service protocol="any">
+ <host-name></host-name>
+ <type>_pdl-datastream._tcp</type>
+ <port>9100</port>
+ <txt-record>product=foonas network printer</txt-record>
+ </service>
+</service-group>
diff --git a/packages/p910nd/files/p910nd.init b/packages/p910nd/files/p910nd.init
new file mode 100755
index 0000000000..e5693e911b
--- /dev/null
+++ b/packages/p910nd/files/p910nd.init
@@ -0,0 +1,38 @@
+#! /bin/sh
+#
+# This is an init script for openembedded
+# Copy it to /etc/init.d/p910nd and type
+# > update-rc.d p910nd defaults 60
+#
+#
+
+
+test -f /usr/sbin/p910nd || exit 0
+
+test -d /var/spool/p910nd || mkdir -p /var/spool/p910nd
+
+case "$1" in
+ start)
+ echo -n "Starting p910nd printer daemon: p910nd"
+ /usr/sbin/p910nd -b -f /dev/usb/lp0 0
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping p910nd printer daemon: p910nd"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/p9100d
+ echo "."
+ ;;
+ restart)
+ echo -n "Stopping p910nd printer daemon: p910nd"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/p9100d
+ sleep 2
+ echo -n " ... Starting p910nd printer daemon: p910nd "
+ /usr/sbin/p910nd -b -f /dev/usb/lp0 0
+ echo "."
+ ;;
+ *)
+ echo "Usage: /etc/init.d/p910nd {start|stop|restart}"
+ exit 1
+esac
+
+exit 0
diff --git a/packages/p910nd/p910nd_0.92.bb b/packages/p910nd/p910nd_0.92.bb
new file mode 100644
index 0000000000..afca8aa3c0
--- /dev/null
+++ b/packages/p910nd/p910nd_0.92.bb
@@ -0,0 +1,42 @@
+DESCRIPTION = "A small network printer daemon for embedded situations that passes the job directly to the printer."
+SECTION = "console/utils"
+HOMEPAGE = "http://p910nd.sourceforge.net/"
+LICENSE = "GPLv2"
+SECTION = "console/utils"
+PR = "r0"
+RRECOMMENDS = "avahi"
+
+inherit update-rc.d
+
+INITSCRIPT_NAME = "p910nd"
+INITSCRIPT_PARAMS = "defaults 60 "
+
+SRC_URI = "http://internap.dl.sourceforge.net/sourceforge/p910nd/p910nd-0.92.tar.bz2 \
+ file://p910nd.init \
+ file://avahi"
+
+do_compile () {
+ ${CC} -o p910nd p910nd.c
+}
+
+# The avahi stuff makes it work with bonjour printing
+do_install () {
+ install -D -m 0755 ${S}/p910nd ${D}${sbindir}/p910nd
+ install -D -m 0644 ${S}/p910nd.conf ${D}${sysconfdir}/p910nd.conf
+ install -D -m 0755 ${WORKDIR}/p910nd.init ${D}${sysconfdir}/init.d/p910nd
+ install -D -m 0755 ${WORKDIR}/avahi ${D}${sysconfdir}/avahi/services/p910nd.service
+}
+
+pkg_postinst_append() {
+#!/bin/sh
+
+if [ "x$D" != "x" ] ; then
+ exit 1
+fi
+
+# If avahi is already running reload it to pickup the p910nd config
+PAV=`pidof avahi-daemon`
+if [ "x$PAV" != "x" ] ; then
+ /etc/init.d/avahi-daemon reload
+fi
+}