From 956812b472ed19d0cbe41efb93738c2fb79d817a Mon Sep 17 00:00:00 2001 From: jcorporation Date: Thu, 24 May 2018 17:10:11 +0100 Subject: [PATCH] Renamed project to myMPD --- .travis.yml | 18 ---- CMakeLists.txt | 10 +-- Dockerfile | 13 --- contrib/init.debian | 108 ------------------------ contrib/{ympd.default => mympd.default} | 4 +- contrib/mympd.service | 18 ++++ contrib/ympd.freebsd | 28 ------ contrib/ympd.service | 18 ---- contrib/ympd.spec | 71 ---------------- ympd.1 => mympd.1 | 22 +++-- 10 files changed, 38 insertions(+), 272 deletions(-) delete mode 100644 .travis.yml delete mode 100644 Dockerfile delete mode 100755 contrib/init.debian rename contrib/{ympd.default => mympd.default} (78%) create mode 100644 contrib/mympd.service delete mode 100755 contrib/ympd.freebsd delete mode 100644 contrib/ympd.service delete mode 100644 contrib/ympd.spec rename ympd.1 => mympd.1 (52%) diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4b2afb9..0000000 --- a/.travis.yml +++ /dev/null @@ -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 - diff --git a/CMakeLists.txt b/CMakeLists.txt index ae7084e..4bdb2c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index c89b804..0000000 --- a/Dockerfile +++ /dev/null @@ -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 \ No newline at end of file diff --git a/contrib/init.debian b/contrib/init.debian deleted file mode 100755 index 6b328f0..0000000 --- a/contrib/init.debian +++ /dev/null @@ -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 - -. /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 - diff --git a/contrib/ympd.default b/contrib/mympd.default similarity index 78% rename from contrib/ympd.default rename to contrib/mympd.default index 479a2e2..8e32161 100644 --- a/contrib/ympd.default +++ b/contrib/mympd.default @@ -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 diff --git a/contrib/mympd.service b/contrib/mympd.service new file mode 100644 index 0000000..9325300 --- /dev/null +++ b/contrib/mympd.service @@ -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 diff --git a/contrib/ympd.freebsd b/contrib/ympd.freebsd deleted file mode 100755 index 532a90c..0000000 --- a/contrib/ympd.freebsd +++ /dev/null @@ -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" diff --git a/contrib/ympd.service b/contrib/ympd.service deleted file mode 100644 index 8cf2542..0000000 --- a/contrib/ympd.service +++ /dev/null @@ -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 diff --git a/contrib/ympd.spec b/contrib/ympd.spec deleted file mode 100644 index 9438c21..0000000 --- a/contrib/ympd.spec +++ /dev/null @@ -1,71 +0,0 @@ -# -# spec file for package ympd -# -# Copyright (c) 2014 Markus S. -# -# 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 . - -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 diff --git a/ympd.1 b/mympd.1 similarity index 52% rename from ympd.1 rename to mympd.1 index c8160a6..e797305 100644 --- a/ympd.1 +++ b/mympd.1 @@ -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 \ No newline at end of file