mirror of
https://github.com/SuperBFG7/ympd
synced 2025-10-23 18:07:42 +00:00
Renamed project to myMPD
This commit is contained in:
@@ -1,108 +0,0 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: ympd
|
||||
# Required-Start: $remote_fs mpd
|
||||
# Required-Stop: $remote_fs mpd
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Daemonized version of ympd.
|
||||
# Description: Enable service provided by ympd.
|
||||
### END INIT INFO
|
||||
#Author: Andrew Karpow <andy@ndyk.de>
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
||||
DESC="ympd Daemon"
|
||||
NAME=ympd
|
||||
DAEMON=/usr/bin/$NAME
|
||||
PIDFILE=/var/run/$NAME.pid
|
||||
SCRIPTNAME=/etc/init.d/$NAME
|
||||
LOG_OUT=/var/log/$NAME.out
|
||||
LOG_ERR=/var/log/$NAME.err
|
||||
YMPD_USER=nobody
|
||||
MPD_HOST=localhost
|
||||
MPD_PORT=6600
|
||||
WEB_PORT=8080
|
||||
DIRBLE_API_TOKEN=2e223c9909593b94fc6577361a
|
||||
#DIGEST=--digest /path/to/htdigest
|
||||
#LOCALPORT=8080
|
||||
|
||||
|
||||
# Exit if the package is not installed
|
||||
[ -x "$DAEMON" ] || exit 0
|
||||
|
||||
# Read configuration variable file if it is present
|
||||
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
|
||||
|
||||
# Load the VERBOSE setting and other rcS variables
|
||||
[ -f /etc/default/rcS ] && . /etc/default/rcS
|
||||
|
||||
DAEMON_OPT="--user $YMPD_USER --mpdpass '$MPD_PASSWORD' --webport $WEB_PORT --host $MPD_HOST --port $MPD_PORT --dirbletoken $DIRBLE_API_TOKEN $DIGEST $LOCALPORT"
|
||||
|
||||
do_start()
|
||||
{
|
||||
start-stop-daemon --start --background --quiet --pidfile $PIDFILE --make-pidfile \
|
||||
--exec $DAEMON --test > /dev/null || return 1
|
||||
start-stop-daemon --start --background --quiet --pidfile $PIDFILE --make-pidfile \
|
||||
--exec $DAEMON -- $DAEMON_OPT || return 2
|
||||
}
|
||||
|
||||
do_stop()
|
||||
{
|
||||
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
|
||||
RETVAL="$?"
|
||||
|
||||
[ "$RETVAL" = 2 ] && return 2
|
||||
rm -f $PIDFILE
|
||||
return "$RETVAL"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
|
||||
do_start
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
stop)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
do_stop
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
status)
|
||||
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
|
||||
;;
|
||||
restart|force-reload)
|
||||
#
|
||||
# If the "reload" option is implemented then remove the
|
||||
# 'force-reload' alias
|
||||
#
|
||||
log_daemon_msg "Restarting $DESC" "$NAME"
|
||||
do_stop
|
||||
case "$?" in
|
||||
0|1)
|
||||
do_start
|
||||
case "$?" in
|
||||
0) log_end_msg 0 ;;
|
||||
1) log_end_msg 1 ;; # Old process is still running
|
||||
*) log_end_msg 1 ;; # Failed to start
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
# Failed to stop
|
||||
log_end_msg 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
|
@@ -1,7 +1,7 @@
|
||||
MPD_HOST=localhost
|
||||
MPD_PORT=6600
|
||||
MPD_PASSWORD=
|
||||
WEB_PORT=8080
|
||||
YMPD_USER=nobody
|
||||
WEB_PORT=80
|
||||
MYMPD_USER=nobody
|
||||
#DIGEST=--digest /path/to/htdigest
|
||||
#LOCALPORT=--localport 8080
|
18
contrib/mympd.service
Normal file
18
contrib/mympd.service
Normal file
@@ -0,0 +1,18 @@
|
||||
[Unit]
|
||||
Description=myMPD server daemon
|
||||
Requires=network.target local-fs.target
|
||||
|
||||
[Service]
|
||||
Environment=MPD_HOST=localhost
|
||||
Environment=MPD_PORT=6600
|
||||
Environment=MPD_PASSWORD=
|
||||
Environment=WEB_PORT=80
|
||||
Environment=MYMPD_USER=nobody
|
||||
Environment=DIGEST=
|
||||
Environment=LOCALPORT=
|
||||
EnvironmentFile=/etc/default/mympd
|
||||
ExecStart=/usr/bin/ympd --user $MYMPD_USER --webport $WEB_PORT --host $MPD_HOST --port $MPD_PORT $DIGEST $LOCALPORT
|
||||
Type=simple
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@@ -1,28 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# PROVIDE: ympd
|
||||
# REQUIRE: DAEMON musicpd
|
||||
# KEYWORD: shutdown
|
||||
|
||||
# Add the following line to /etc/rc.conf to enable ympd:
|
||||
#
|
||||
# ympd_enable="YES"
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="ympd"
|
||||
rcvar="${name}_enable"
|
||||
command="/usr/local/bin/${name}"
|
||||
pidfile="/var/run/${name}.pid"
|
||||
start_cmd="ympd_start"
|
||||
|
||||
load_rc_config "${name}"
|
||||
: ${ympd_enable:="NO"}
|
||||
|
||||
ympd_start()
|
||||
{
|
||||
check_startmsgs && echo "Starting ${name}."
|
||||
/usr/sbin/daemon -f -p "${pidfile}" "${command}" "${rc_flags}"
|
||||
}
|
||||
|
||||
run_rc_command "$1"
|
@@ -1,18 +0,0 @@
|
||||
[Unit]
|
||||
Description=ympd server daemon
|
||||
Requires=network.target local-fs.target
|
||||
|
||||
[Service]
|
||||
Environment=MPD_HOST=localhost
|
||||
Environment=MPD_PORT=6600
|
||||
Environment=MPD_PASSWORD=
|
||||
Environment=WEB_PORT=8080
|
||||
Environment=YMPD_USER=nobody
|
||||
Environment=DIGEST=
|
||||
Environment=LOCALPORT=
|
||||
EnvironmentFile=/etc/default/ympd
|
||||
ExecStart=/usr/bin/ympd --user $YMPD_USER --webport $WEB_PORT --host $MPD_HOST --port $MPD_PORT $DIGEST $LOCALPORT
|
||||
Type=simple
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@@ -1,71 +0,0 @@
|
||||
#
|
||||
# spec file for package ympd
|
||||
#
|
||||
# Copyright (c) 2014 Markus S. <kamikazow@web.de>
|
||||
#
|
||||
# This file is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Name: ympd
|
||||
Version: 1.2.2
|
||||
Release: 0%{?dist}
|
||||
Summary: ympd is a lightweight MPD (Music Player Daemon) web client
|
||||
Group: Applications/Multimedia
|
||||
License: GPL
|
||||
URL: http://www.ympd.org/
|
||||
|
||||
# For this spec file to work, the ympd sources must be located in a directory
|
||||
# named ympd-1.2.2 (with "1.2.2" being the version number defined above).
|
||||
# If the sources are compressed in another format than ZIP, change the
|
||||
# file extension accordingly.
|
||||
Source0: %{name}-%{version}.zip
|
||||
|
||||
# Package names only verified with Fedora.
|
||||
# Should the packages in your distro be named dirrerently,
|
||||
# see http://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto
|
||||
# %if 0%{?fedora}
|
||||
BuildRequires: cmake
|
||||
BuildRequires: unzip
|
||||
BuildRequires: libmpdclient-devel
|
||||
Requires: libmpdclient
|
||||
# %endif
|
||||
|
||||
%description
|
||||
ympd is a lightweight MPD (Music Player Daemon) web client that runs without
|
||||
a dedicated webserver or interpreters like PHP, NodeJS or Ruby.
|
||||
It's tuned for minimal resource usage and requires only very litte dependencies.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
mkdir build
|
||||
pushd build
|
||||
%cmake .. -DCMAKE_INSTALL_PREFIX_PATH=%{_prefix}
|
||||
make PREFIX=%{_prefix} %{?_smp_mflags}
|
||||
popd
|
||||
|
||||
%install
|
||||
pushd build
|
||||
%{make_install}
|
||||
popd
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc LICENSE README.md
|
||||
%{_bindir}/%{name}
|
||||
%{_mandir}/man[^3]/*
|
||||
|
||||
|
||||
%changelog
|
Reference in New Issue
Block a user