commit:     d0d685768daab8011c44f8675b7978d4474ef312
Author:     Aisha Tammy <gentoo <AT> aisha <DOT> cc>
AuthorDate: Mon Jan 11 16:07:35 2021 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
CommitDate: Mon Jan 11 16:30:34 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=d0d68576

net-misc/purritobin: add init file

Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Aisha Tammy <gentoo <AT> aisha.cc>

 net-misc/purritobin/files/purritobin.initd              | 16 ++++++++++++++++
 net-misc/purritobin/files/purritobin.service            | 17 +++++++++++++++++
 ...rritobin-0.3.3.ebuild => purritobin-0.3.3-r1.ebuild} | 15 ++++++++++++---
 net-misc/purritobin/purritobin-9999.ebuild              | 15 ++++++++++++---
 4 files changed, 57 insertions(+), 6 deletions(-)

diff --git a/net-misc/purritobin/files/purritobin.initd 
b/net-misc/purritobin/files/purritobin.initd
new file mode 100644
index 00000000..8c070466
--- /dev/null
+++ b/net-misc/purritobin/files/purritobin.initd
@@ -0,0 +1,16 @@
+#!/sbin/openrc-run
+# Copyright 2020-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+name="PurritoBin"
+description="ultra fast, minimalistic command line paste-bin"
+
+command="/usr/bin/purrito"
+command_background=true
+command_args="${ARGS:- -d /var/www/purritobin/}"
+pidfile="/run/${RC_SVCNAME}.pid"
+command_user="purritobin:purritobin"
+
+depend() {
+        need net
+}

diff --git a/net-misc/purritobin/files/purritobin.service 
b/net-misc/purritobin/files/purritobin.service
new file mode 100644
index 00000000..1a55dbcd
--- /dev/null
+++ b/net-misc/purritobin/files/purritobin.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=PurritoBin
+After=network.target
+
+[Service]
+SyslogIdentifier=purritobin
+Restart=always
+RestartSec=5
+Type=simple
+User=purritobin
+Group=purritobin
+WorkingDirectory=/var/www/purritobin
+ExecStart=/usr/bin/purritobin
+TimeoutStopSec=30
+
+[Install]
+WantedBy=multi-user.target

diff --git a/net-misc/purritobin/purritobin-0.3.3.ebuild 
b/net-misc/purritobin/purritobin-0.3.3-r1.ebuild
similarity index 63%
rename from net-misc/purritobin/purritobin-0.3.3.ebuild
rename to net-misc/purritobin/purritobin-0.3.3-r1.ebuild
index 37179319..fd9c6136 100644
--- a/net-misc/purritobin/purritobin-0.3.3.ebuild
+++ b/net-misc/purritobin/purritobin-0.3.3-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2019-2020 Gentoo Authors
+# Copyright 2019-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -6,7 +6,7 @@ EAPI=7
 DESCRIPTION="minimalistic commandline pastebin"
 HOMEPAGE="https://bsd.ac";
 
-inherit toolchain-funcs
+inherit systemd toolchain-funcs
 
 if [[ ${PV} == 9999 ]]; then
        inherit git-r3
@@ -20,7 +20,11 @@ fi
 LICENSE="ISC"
 SLOT="0"
 
-RDEPEND="net-libs/usockets[ssl]"
+RDEPEND="
+       net-libs/usockets[ssl]
+       acct-user/purritobin
+       acct-group/purritobin
+"
 DEPEND="${RDEPEND}
        www-apps/uwebsockets
 "
@@ -32,5 +36,10 @@ src_configure() {
 
 src_install() {
        emake PREFIX="/usr" MANDIR="/usr/share/man" DESTDIR="${ED}" install
+       insinto /var/www/purritobin
+       doins frontend/paste.html
+       fowners purritobin:purritobin /var/www/purritobin
+       newinitd "${FILESDIR}"/purritobin.initd purritobin
+       systemd_dounit "${FILESDIR}"/purritobin.service
        einstalldocs
 }

diff --git a/net-misc/purritobin/purritobin-9999.ebuild 
b/net-misc/purritobin/purritobin-9999.ebuild
index 37179319..fd9c6136 100644
--- a/net-misc/purritobin/purritobin-9999.ebuild
+++ b/net-misc/purritobin/purritobin-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2019-2020 Gentoo Authors
+# Copyright 2019-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -6,7 +6,7 @@ EAPI=7
 DESCRIPTION="minimalistic commandline pastebin"
 HOMEPAGE="https://bsd.ac";
 
-inherit toolchain-funcs
+inherit systemd toolchain-funcs
 
 if [[ ${PV} == 9999 ]]; then
        inherit git-r3
@@ -20,7 +20,11 @@ fi
 LICENSE="ISC"
 SLOT="0"
 
-RDEPEND="net-libs/usockets[ssl]"
+RDEPEND="
+       net-libs/usockets[ssl]
+       acct-user/purritobin
+       acct-group/purritobin
+"
 DEPEND="${RDEPEND}
        www-apps/uwebsockets
 "
@@ -32,5 +36,10 @@ src_configure() {
 
 src_install() {
        emake PREFIX="/usr" MANDIR="/usr/share/man" DESTDIR="${ED}" install
+       insinto /var/www/purritobin
+       doins frontend/paste.html
+       fowners purritobin:purritobin /var/www/purritobin
+       newinitd "${FILESDIR}"/purritobin.initd purritobin
+       systemd_dounit "${FILESDIR}"/purritobin.service
        einstalldocs
 }

Reply via email to