diff options
author | Adan Calderon <adancalderon@gmail.com> | 2024-05-21 09:04:05 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2024-05-21 10:29:59 +0700 |
commit | da07d7620422e529e542c0a03a4c0a2d8ea5b905 (patch) | |
tree | ef74daa705218d7ca85709f51e5de218b3d2a146 | |
parent | b4ea9312d8ff4c4047121d5e7495701287ccfb69 (diff) | |
download | slackbuilds-da07d7620422e529e542c0a03a4c0a2d8ea5b905.tar.gz slackbuilds-da07d7620422e529e542c0a03a4c0a2d8ea5b905.tar.xz |
system/PrintNode: Added (Remote Printing for Web Apps).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r-- | system/PrintNode/PrintNode.SlackBuild | 64 | ||||
-rw-r--r-- | system/PrintNode/PrintNode.info | 10 | ||||
-rw-r--r-- | system/PrintNode/README | 15 | ||||
-rwxr-xr-x | system/PrintNode/rc.PrintNode | 92 | ||||
-rw-r--r-- | system/PrintNode/slack-desc | 19 |
5 files changed, 200 insertions, 0 deletions
diff --git a/system/PrintNode/PrintNode.SlackBuild b/system/PrintNode/PrintNode.SlackBuild new file mode 100644 index 0000000000..5be01ae998 --- /dev/null +++ b/system/PrintNode/PrintNode.SlackBuild @@ -0,0 +1,64 @@ +#!/bin/bash + +# Slackware Package build script for installer of PrintNode + +# Copyright 2024 Adan Calderon | adancalderon@gmail.com +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) +PRGNAM=PrintNode +OS=ubuntu-20.04 +ARCH=x86_64 +VERSION=${VERSION:-4.27.17} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +set -e +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION-$OS-$ARCH +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION-$OS-$ARCH.tar.gz +mv $PRGNAM-$VERSION-$OS-$ARCH $PRGNAM-$VERSION +cd $PRGNAM-$VERSION 2>/dev/null +chown -R root:root . +mkdir -p $PKG/install +mkdir -p $PKG/$PRGNAM +mkdir -p $PKG/etc/rc.d +cp -a * $PKG/$PRGNAM +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/rc.PrintNode > $PKG/etc/rc.d/rc.PrintNode + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/system/PrintNode/PrintNode.info b/system/PrintNode/PrintNode.info new file mode 100644 index 0000000000..a96e54e5d0 --- /dev/null +++ b/system/PrintNode/PrintNode.info @@ -0,0 +1,10 @@ +PRGNAM="PrintNode" +VERSION="4.27.17" +HOMEPAGE="https://www.printnode.com" +DOWNLOAD="https://dl.printnode.com/client/printnode/4.27.17/PrintNode-4.27.17-ubuntu-20.04-x86_64.tar.gz" +MD5SUM="b92c7a81b9c726715b9c18e14c2a54a6" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Adan Calderon" +EMAIL="adancalderon@gmail.com" diff --git a/system/PrintNode/README b/system/PrintNode/README new file mode 100644 index 0000000000..e7e1583f52 --- /dev/null +++ b/system/PrintNode/README @@ -0,0 +1,15 @@ +PrintNode is a hosted printing service that can help you quickly, +easily and securely add remote printing to your application. +You can submit print jobs with PDF documents or links to PDF files. +PrintNode also supports RAW printing. + +Edit /etc/rc.d/rc.PrintNode with correct values for +COMPUTERNAME, EMAIL, and PASSWORD + +make sure chmod 755 /etc/rc.d/rc.PrintNode is performed + +Add the following to rc.local for startup: + +if [ -x /etc/rc.d/rc.PrintNode ]; then + /etc/rc.d/rc.PrintNode start +fi diff --git a/system/PrintNode/rc.PrintNode b/system/PrintNode/rc.PrintNode new file mode 100755 index 0000000000..bd1ccc74df --- /dev/null +++ b/system/PrintNode/rc.PrintNode @@ -0,0 +1,92 @@ +#!/bin/sh + +user="" #<--- EDIT THIS LINE IF YOU WANT TO RUN AS A SPECIFIC USER +COMPUTERNAME=somehostname +EMAIL=someone@somewhere.com +PASSWORD=mysecretpassword +dir="/PrintNode" +cmd="/PrintNode/PrintNode --headless --shutdown-on-sigint --web-interface --remove-scales-support --computer-name=$COMPUTERNAME --email=$EMAIL --password=$PASSWORD" + +name=`basename $0` +pid_file="/var/run/$name.pid" +stdout_log="/var/log/$name.log" +stderr_log="/var/log/$name.err" + +get_pid() { + cat "$pid_file" +} + +is_running() { + [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1 +} + +case "$1" in + start) + if is_running; then + echo "Already started" + else + echo "Starting $name" + cd "$dir" + if [ -z "$user" ]; then + sudo $cmd >> "$stdout_log" 2>> "$stderr_log" & + else + sudo su -l "$user" -c "$cmd" >> "$stdout_log" 2>> "$stderr_log" & + fi + echo $! > "$pid_file" + if ! is_running; then + echo "Unable to start, see $stdout_log and $stderr_log" + exit 1 + fi + fi + ;; + stop) + if is_running; then + echo -n "Stopping $name.." + kill `get_pid` + for i in {1..10} + do + if ! is_running; then + break + fi + + echo -n "." + sleep 1 + done + echo + + if is_running; then + echo "Not stopped; may still be shutting down or shutdown may have failed" + exit 1 + else + echo "Stopped" + if [ -f "$pid_file" ]; then + rm "$pid_file" + fi + fi + else + echo "Not running" + fi + ;; + restart) + $0 stop + if is_running; then + echo "Unable to stop, will not attempt to start" + exit 1 + fi + $0 start + ;; + status) + if is_running; then + echo "Running" + else + echo "Stopped" + exit 1 + fi + ;; + *) + echo "Usage: $0 {start|stop|restart|status}" + exit 1 + ;; +esac + +exit 0 diff --git a/system/PrintNode/slack-desc b/system/PrintNode/slack-desc new file mode 100644 index 0000000000..6a31b57744 --- /dev/null +++ b/system/PrintNode/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +PrintNode: PrintNode (Remote Printing for Web Apps) +PrintNode: +PrintNode: PrintNode is a hosted printing service that can help you quickly, +PrintNode: easily and securely add remote printing to your application. +PrintNode: You can submit print jobs with PDF documents or links to PDF files. +PrintNode: PrintNode also supports RAW printing. +PrintNode: +PrintNode: Edit /etc/rc.d/rc.PrintNode with correct values +PrintNode: Add rc.PrintNode to rc.local for startup +PrintNode: +PrintNode: Homepage: https://www.printnode.com |