diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2014-06-01 14:19:56 +0200 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2014-06-01 14:19:56 +0200 |
commit | e6434c75937b55eb7103de972e18ce2872e0797e (patch) | |
tree | 9424815b84bb177714ec143837ebda8084b3ebf1 /main | |
parent | c870cee6f509f6a7f21fc919906cfbc8fd2e698c (diff) | |
download | aports-e6434c75937b55eb7103de972e18ce2872e0797e.tar.bz2 aports-e6434c75937b55eb7103de972e18ce2872e0797e.tar.xz |
testing/ympd: move to main
Diffstat (limited to 'main')
-rw-r--r-- | main/ympd/APKBUILD | 59 | ||||
-rw-r--r-- | main/ympd/musl-missing-errorh.patch | 80 | ||||
-rw-r--r-- | main/ympd/ympd.confd | 5 | ||||
-rw-r--r-- | main/ympd/ympd.initd | 13 | ||||
-rw-r--r-- | main/ympd/ympd.pre-install | 3 |
5 files changed, 160 insertions, 0 deletions
diff --git a/main/ympd/APKBUILD b/main/ympd/APKBUILD new file mode 100644 index 0000000000..74ce47d9a8 --- /dev/null +++ b/main/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/main/ympd/musl-missing-errorh.patch b/main/ympd/musl-missing-errorh.patch new file mode 100644 index 0000000000..960ca3fc11 --- /dev/null +++ b/main/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/main/ympd/ympd.confd b/main/ympd/ympd.confd new file mode 100644 index 0000000000..2f9bf69683 --- /dev/null +++ b/main/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/main/ympd/ympd.initd b/main/ympd/ympd.initd new file mode 100644 index 0000000000..cb54d6345c --- /dev/null +++ b/main/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/main/ympd/ympd.pre-install b/main/ympd/ympd.pre-install new file mode 100644 index 0000000000..0455be2acd --- /dev/null +++ b/main/ympd/ympd.pre-install @@ -0,0 +1,3 @@ +#!/bin/sh +adduser -H -D -s /sbin/nologin -G audio ympd 2>/dev/null +exit 0 |