summaryrefslogtreecommitdiffstats
path: root/remote/modules/printergui
diff options
context:
space:
mode:
Diffstat (limited to 'remote/modules/printergui')
l---------remote/modules/printergui/data/etc/systemd/system/network.target.wants/printergui.service1
-rw-r--r--remote/modules/printergui/data/etc/systemd/system/printergui.service8
-rwxr-xr-xremote/modules/printergui/data/opt/openslx/scripts/systemd-printergui_preparation20
-rw-r--r--remote/modules/printergui/printergui.build17
-rw-r--r--remote/modules/printergui/printergui.conf2
5 files changed, 42 insertions, 6 deletions
diff --git a/remote/modules/printergui/data/etc/systemd/system/network.target.wants/printergui.service b/remote/modules/printergui/data/etc/systemd/system/network.target.wants/printergui.service
new file mode 120000
index 00000000..40453c80
--- /dev/null
+++ b/remote/modules/printergui/data/etc/systemd/system/network.target.wants/printergui.service
@@ -0,0 +1 @@
+../printergui.service \ No newline at end of file
diff --git a/remote/modules/printergui/data/etc/systemd/system/printergui.service b/remote/modules/printergui/data/etc/systemd/system/printergui.service
new file mode 100644
index 00000000..8b00514c
--- /dev/null
+++ b/remote/modules/printergui/data/etc/systemd/system/printergui.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Printergui - bwLehrpool printing system
+Requires=network.target graphical.target
+After=network.target
+Before=cups.service
+
+[Service]
+ExecStart=/opt/openslx/scripts/systemd-printergui_preparation
diff --git a/remote/modules/printergui/data/opt/openslx/scripts/systemd-printergui_preparation b/remote/modules/printergui/data/opt/openslx/scripts/systemd-printergui_preparation
new file mode 100755
index 00000000..33a861e6
--- /dev/null
+++ b/remote/modules/printergui/data/opt/openslx/scripts/systemd-printergui_preparation
@@ -0,0 +1,20 @@
+#!/bin/ash
+
+ERR=0
+SRCDIR=/usr/lib/cups/backend
+DESTDIR=/opt/openslx/cups/backend
+PRINTPWGUI=/opt/openslx/cups/printpwgui
+
+if [ ! -d "$DESTDIR" ]; then
+ mkdir -p "$DESTDIR" || exit 1
+fi
+
+mv "$SRCDIR"/* "$DESTDIR"
+
+cd "$SRCDIR"
+for i in "$DESTDIR"/*; do
+ ln -sf "$PRINTPWGUI" $(basename "$i")
+done
+
+exit 0
+
diff --git a/remote/modules/printergui/printergui.build b/remote/modules/printergui/printergui.build
index 5803d8e8..2ee49154 100644
--- a/remote/modules/printergui/printergui.build
+++ b/remote/modules/printergui/printergui.build
@@ -2,19 +2,24 @@
fetch_source() {
git clone "${REQUIRED_GIT}" src
+ cd src
+ git checkout "$REQUIRED_COMMIT"
+ cd ..
}
build() {
local SRCDIR="${MODULE_DIR}/src/"
+ local DESTDIR="$MODULE_BUILD_DIR/opt/openslx/cups"
- mkdir -p "$MODULE_BUILD_DIR/opt/openslx/bin"
- cd "${MODULE_BUILD_DIR}/opt/openslx/bin" || perror "Could not cd!"
- pinfo "Running qmake"
- qmake "$SRCDIR/src/printergui.pro" -r -spec linux-g++ || perror "'qmake' failed (e.g. not installed)."
+ mkdir -p "$DESTDIR"
+ cd "$DESTDIR" || perror "Could not cd to $DESTDIR!"
+ pinfo "Running cmake"
+ cmake "$SRCDIR/" || perror "'cmake' failed (e.g. not installed)."
pinfo "Running make"
make || perror "'make' failed."
+ chmod 0700 "$DESTDIR/printpwgui" # So picky cupsd won't drop privileges to lp
}
post_copy() {
- mkdir -p "${TARGET_BUILD_DIR}/var/spool/STANDARD"
- chmod a+rwt "${TARGET_BUILD_DIR}/var/spool/STANDARD"
+ :
}
+
diff --git a/remote/modules/printergui/printergui.conf b/remote/modules/printergui/printergui.conf
index 26203a80..17203d3e 100644
--- a/remote/modules/printergui/printergui.conf
+++ b/remote/modules/printergui/printergui.conf
@@ -1,6 +1,8 @@
REQUIRED_GIT="git://git.openslx.org/openslx-ng/printergui.git"
+REQUIRED_COMMIT="HEAD"
REQUIRED_BINARIES="
printergui
+ printpwgui
"
REQUIRED_SYSTEM_FILES="
"