aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--testing/ympd/APKBUILD59
-rw-r--r--testing/ympd/musl-missing-errorh.patch80
-rw-r--r--testing/ympd/ympd.confd5
-rw-r--r--testing/ympd/ympd.initd13
-rw-r--r--testing/ympd/ympd.pre-install3
5 files changed, 160 insertions, 0 deletions
diff --git a/testing/ympd/APKBUILD b/testing/ympd/APKBUILD
new file mode 100644
index 0000000000..74ce47d9a8
--- /dev/null
+++ b/testing/ympd/APKBUILD
@@ -0,0 +1,59 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer:
+pkgname=ympd
+pkgver=1.2.2
+pkgrel=0
+pkgdesc="A standalone MPD Web GUI"
+url="http://www.ympd.org/"
+arch="all"
+license="GPL2"
+depends=""
+depends_dev="libmpdclient-dev"
+makedepends="$depends_dev cmake"
+install="$pkgname.pre-install"
+subpackages="$pkgname-doc"
+source="ympd-${pkgver}.tar.gz::https://github.com/notandy/ympd/archive/v1.2.2.tar.gz
+ musl-missing-errorh.patch
+ $pkgname.initd
+ $pkgname.confd"
+
+_builddir="$srcdir/$pkgname-$pkgver"
+
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+ mkdir build || return 1
+}
+
+build() {
+ cd "$_builddir"/build
+ cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr
+ make || return 1
+}
+
+package() {
+ cd "$_builddir"/build
+ make DESTDIR="$pkgdir/" install || return 1
+ install -D -m755 "$srcdir"/$pkgname.initd \
+ "$pkgdir"/etc/init.d/$pkgname || return 1
+ install -D -m644 "$srcdir"/$pkgname.confd \
+ "$pkgdir"/etc/conf.d/$pkgname || return 1
+}
+
+md5sums="b1e33f8de8249a5229d4e25bd739095b ympd-1.2.2.tar.gz
+9b8da2890287a459fb9cbf2bc225da28 musl-missing-errorh.patch
+d6158ed50f19e9d4caa276b18e8535ef ympd.initd
+9a71d20477e801cefd8398d1216bde9d ympd.confd"
+sha256sums="4643a4e0983feb2762a94071f264c107e46507d61baa23f705676b0aeab17dcb ympd-1.2.2.tar.gz
+fc0d7f76edd9b46359fdb697615b528b806a29d9498bdc74ec02b65584b18682 musl-missing-errorh.patch
+898c720a65358fe8f4f06e6dcf8cf92970d7b368d8b17619edbc5883eb25e8d3 ympd.initd
+ea2eb0ae943cee4e6036f48f4cc5f31141447bbd685bda796261e3572da26e1c ympd.confd"
+sha512sums="0a671886c06744e92b1393a1a14eb08f322ad3b9a00ee057d057d91bf7755eaf0f58ad15e4f1811c8b403ff4cd70b66ab213398dd22b8fe3563e325f58306265 ympd-1.2.2.tar.gz
+9a55e34f73ba73e85ee9ad1feab3571f944ada4e6c7adbe619e851929aee7254bccb0fbf37668b2c32676daae92922db358350997c15701653f40cd61798f62a musl-missing-errorh.patch
+c64f0f615cd238cf9d756ba7e153786cb80e0d29416281a60619643ff696cd67095659e0fa771997dc72bcc1cae6aeb2eb1ce43488eb5d26b33dd0216b69e9a4 ympd.initd
+a2c87d45acfe46efbaea6636a6ea592d17054de7fa6820b26ddd61875700dae268f0ca11a1065c38ea86d910fb54566eb454bbb755ed758e3ff71db4464689c1 ympd.confd"
diff --git a/testing/ympd/musl-missing-errorh.patch b/testing/ympd/musl-missing-errorh.patch
new file mode 100644
index 0000000000..960ca3fc11
--- /dev/null
+++ b/testing/ympd/musl-missing-errorh.patch
@@ -0,0 +1,80 @@
+--- ympd-1.2.2/htdocs/mkdata.c
++++ ympd-1.2.2/htdocs/mkdata.c
+@@ -7,7 +7,11 @@
+
+ #include <stdlib.h>
+ #include <stdio.h>
++#if HAVE_ERROR_H
+ #include <error.h>
++#else
++#include <stdarg.h>
++#endif
+ #include <errno.h>
+ #include <string.h>
+
+@@ -53,6 +57,60 @@
+ return "text/plain";
+ }
+
++/*
++ * Program name.
++ */
++#ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME
++# ifdef HAVE___PROGNAME
++extern char *__progname;
++# define program_invocation_short_name __progname
++# else
++# ifdef HAVE_GETEXECNAME
++# define program_invocation_short_name \
++ prog_inv_sh_nm_from_file(getexecname(), 0)
++# else
++# define program_invocation_short_name \
++ prog_inv_sh_nm_from_file(__FILE__, 1)
++# endif
++static char prog_inv_sh_nm_buf[256];
++static inline char *prog_inv_sh_nm_from_file(char *f, char stripext)
++{
++ char *t;
++
++ if ((t = strrchr(f, '/')) != NULL)
++ t++;
++ else
++ t = f;
++
++ strncpy(prog_inv_sh_nm_buf, t, sizeof(prog_inv_sh_nm_buf) - 1);
++ prog_inv_sh_nm_buf[sizeof(prog_inv_sh_nm_buf) - 1] = '\0';
++
++ if (stripext && (t = strrchr(prog_inv_sh_nm_buf, '.')) != NULL)
++ *t = '\0';
++
++ return prog_inv_sh_nm_buf;
++}
++# endif
++#endif
++
++#ifndef HAVE_ERROR_H
++/* Emulate the error() function from glibc */
++__attribute__((__format__(__printf__, 3, 4)))
++static void error(int status, int errnum, const char *format, ...)
++{
++ va_list argp;
++ fprintf(stderr, "%s: ", program_invocation_short_name);
++ va_start(argp, format);
++ vfprintf(stderr, format, argp);
++ va_end(argp);
++ if (errnum != 0)
++ fprintf(stderr, ": error code %d", errnum);
++ fprintf(stderr, "\n");
++ if (status != 0)
++ exit(status);
++}
++#endif
++
+ int main(int argc, char *argv[])
+ {
+ int i, j, buf;
+@@ -92,3 +150,4 @@
+ fputs(footer, stdout);
+ return EXIT_SUCCESS;
+ }
++
diff --git a/testing/ympd/ympd.confd b/testing/ympd/ympd.confd
new file mode 100644
index 0000000000..2f9bf69683
--- /dev/null
+++ b/testing/ympd/ympd.confd
@@ -0,0 +1,5 @@
+ympd_user="ympd"
+ympd_host="localhost"
+ympd_port="6600"
+ympd_webport="8080"
+ympd_pid="/var/run/ympd.pid"
diff --git a/testing/ympd/ympd.initd b/testing/ympd/ympd.initd
new file mode 100644
index 0000000000..cb54d6345c
--- /dev/null
+++ b/testing/ympd/ympd.initd
@@ -0,0 +1,13 @@
+#!/sbin/runscript
+
+name=ympd
+command=/usr/bin/$name
+command_args="-u $ympd_user -h $ympd_host -p $ympd_port -w $ympd_webport"
+command_background=YES
+pidfile=$ympd_pid
+
+depend() {
+ use logger dns
+ need net
+ after firewall
+}
diff --git a/testing/ympd/ympd.pre-install b/testing/ympd/ympd.pre-install
new file mode 100644
index 0000000000..0455be2acd
--- /dev/null
+++ b/testing/ympd/ympd.pre-install
@@ -0,0 +1,3 @@
+#!/bin/sh
+adduser -H -D -s /sbin/nologin -G audio ympd 2>/dev/null
+exit 0