diff --git a/srcpkgs/PopCorn-Server b/srcpkgs/PopCorn-Server new file mode 120000 index 00000000000..254bd5d89fb --- /dev/null +++ b/srcpkgs/PopCorn-Server @@ -0,0 +1 @@ +PopCorn/ \ No newline at end of file diff --git a/srcpkgs/PopCorn/files/popcorn/conf b/srcpkgs/PopCorn/files/popcorn/conf new file mode 100644 index 00000000000..ac2813fe9d3 --- /dev/null +++ b/srcpkgs/PopCorn/files/popcorn/conf @@ -0,0 +1,2 @@ +SERVER=popcorn.voidlinux.org +PORT=8001 diff --git a/srcpkgs/PopCorn/files/popcorn/run b/srcpkgs/PopCorn/files/popcorn/run new file mode 100755 index 00000000000..5c04764966d --- /dev/null +++ b/srcpkgs/PopCorn/files/popcorn/run @@ -0,0 +1,7 @@ +#!/bin/sh + +[ -r ./conf ] && . ./conf + +mkdir -p /etc/popcorn +chown -R _popcorn:_popcorn /etc/popcorn +exec chpst -u _popcorn:_popcorn popcorn --server $SERVER --port $PORT diff --git a/srcpkgs/PopCorn/files/statrepo/conf b/srcpkgs/PopCorn/files/statrepo/conf new file mode 100644 index 00000000000..ac6c6963bba --- /dev/null +++ b/srcpkgs/PopCorn/files/statrepo/conf @@ -0,0 +1,2 @@ +PORT=8001 +KEY=RESET_KEY diff --git a/srcpkgs/PopCorn/files/statrepo/run b/srcpkgs/PopCorn/files/statrepo/run new file mode 100755 index 00000000000..39f25cce212 --- /dev/null +++ b/srcpkgs/PopCorn/files/statrepo/run @@ -0,0 +1,5 @@ +#!/bin/sh + +[ -r ./conf ] && . ./conf + +exec chpst -u _popcorn:_popcorn statrepo --port $PORT --reset_key $KEY diff --git a/srcpkgs/PopCorn/template b/srcpkgs/PopCorn/template new file mode 100644 index 00000000000..204578d15ff --- /dev/null +++ b/srcpkgs/PopCorn/template @@ -0,0 +1,44 @@ +# Template file for 'PopCorn' +pkgname=PopCorn +version=0.2 +revision=1 +build_style=go +go_import_path="github.com/the-maldridge/popcorn" +go_package="${go_import_path}/cmd/popcorn ${go_import_path}/cmd/popcornctl ${go_import_path}/cmd/statrepo" +hostmakedepends="dep" +short_desc="Package statistics system" +maintainer="Michael Aldridge " +license="MIT" +homepage="https://github.com/the-maldridge/PopCorn" +distfiles="https://github.com/the-maldridge/PopCorn/archive/v${version}.tar.gz" +checksum=eb5623f72a59eec7de84e625cbfb58677fc59fc7cfe0e5e52e50f9288eb9abe8 + +system_accounts="_popcorn" +_popcorn_homedir="/var/lib/popcorn" +make_dirs="/var/lib/popcorn 0755 _popcorn _popcorn + /etc/popcorn 0755 _popcorn _popcorn" +conf_files="/etc/sv/popcorn/conf" + +pre_build() { + cd $GOSRCPATH + dep ensure + cd $wrksrc +} + +post_install() { + vlicense LICENSE + vsv popcorn + vsv statrepo +} + +PopCorn-Server_package() { + short_desc+=" - Server" + depends="${sourcepkg}>=${version}_${revision}" + conf_files="/etc/sv/statrepo/conf" + pkg_install() { + vmove usr/bin/statrepo + vmove usr/bin/popcornctl + + vmove etc/sv/statrepo + } +}