1
0
mirror of https://github.com/SuperBFG7/ympd synced 2024-12-26 19:10:25 +00:00

Renamed project to myMPD

This commit is contained in:
jcorporation 2018-05-24 17:10:11 +01:00
parent 2c27cbc037
commit 956812b472
10 changed files with 38 additions and 272 deletions

View File

@ -1,18 +0,0 @@
language: c
sudo: required
dist: trusty
compiler:
- gcc
- clang
before_install:
- sudo apt-get -qq update
- sudo apt-get install -y libmpdclient-dev cmake
- mkdir build
- cd build
- cmake -D CMAKE_BUILD_TYPE=DEBUG ..
script: make

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 2.6)
project (ympd C)
project (mympd C)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/")
set(CPACK_PACKAGE_VERSION_MAJOR "1")
set(CPACK_PACKAGE_VERSION_MINOR "0")
@ -70,11 +70,11 @@ if(NOT WITH_DYNAMIC_ASSETS)
list(APPEND SOURCES src/http_server.c assets.c)
endif()
add_executable(ympd ${SOURCES})
target_link_libraries(ympd ${LIBMPDCLIENT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES})
add_executable(mympd ${SOURCES})
target_link_libraries(mympd ${LIBMPDCLIENT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES})
install(TARGETS ympd DESTINATION bin)
install(FILES ympd.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1)
install(TARGETS mympd DESTINATION bin)
install(FILES mympd.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1)
if(WITH_DYNAMIC_ASSETS)
install(DIRECTORY htdocs DESTINATION share/${PROJECT_NAME})
endif()

View File

@ -1,13 +0,0 @@
FROM alpine:3.5
WORKDIR /app/build
COPY . /app
RUN apk add --no-cache g++ make cmake libmpdclient-dev openssl-dev
RUN cmake ..
RUN make
FROM alpine:3.5
RUN apk add --no-cache libmpdclient openssl
EXPOSE 8080
COPY --from=0 /app/build/ympd /usr/bin/ympd
COPY --from=0 /app/build/mkdata /usr/bin/mkdata
CMD ympd

View File

@ -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

View File

@ -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
View 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

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -1,14 +1,15 @@
.\" Manpage for ympd.
.\" Contact andy@ympd.org to correct errors or typos.
.TH man 1 "19 Oct 2014" "1.2.3" "ympd man page"
.\" Manpage for myMPD.
.\" Contact mail@jcgames.de to correct errors or typos.
.TH man 1 "24 May 2018" "1.0.0" "myMPD man page"
.SH NAME
ympd \- Standalone MPD Web GUI written in C, utilizing Websockets and Bootstrap/JS
myMPD \- Standalone MPD Web GUI written in C, utilizing Websockets and Bootstrap/JS
.SH SYNOPSIS
ympd [OPTION]...
mympd [OPTION]...
.SH 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.
myMPD is a lightweight MPD web client that runs without a dedicated webserver or interpreter.
It's tuned for minimal resource usage and requires only very litte dependencies.
myMPD is a fork of ympd.
ympd is based in part on the work of the mongoose http server (https://github.com/cesanta/mongoose)
.SH OPTIONS
.TP
\fB\-h\fR, \fB\-\-host HOST\fR
@ -17,6 +18,9 @@ connect to mpd at host, defaults to localhost
\fB\-p\fR, \fB\-\-port PORT\fR
connect to mpd at port, defaults to 6600
.TP
\fB\-l\fR, \fB\-\-localport PORT\fR
skip authorization for local port
.TP
\fB\-w\fR, \fB\-\-webport PORT\fR
specifies the port for the webserver to listen to, defaults to 8080
.TP
@ -34,6 +38,6 @@ print all valid options and exits
.SH BUGS
No known bugs.
.SH AUTHOR
Andrew Karpow (andy@ndyk.de)
Juergen Mang (mail@jcgames.de)
http://www.ympd.org
https://github.com/jcorporation/ympd