debian/0000755000000000000000000000000012146724166007177 5ustar debian/mpd-sima.postrm0000755000000000000000000000347412130043657012157 0ustar #!/bin/sh # postrm script for mpd-sima # # see: dh_installdeb(1) set -e do_mpd_sima_purge () { for i in $(dpkg-statoverride --list | grep "^mpd-sima " | cut -s -d " " -f 4); do if dpkg-statoverride --list --quiet "$i" >/dev/null; then dpkg-statoverride --force --quiet --remove "$i" fi done # delete user if getent passwd mpd-sima >/dev/null; then if [ -x /usr/sbin/deluser ]; then deluser --system mpd-sima fi fi # delete group if getent group mpd-sima >/dev/null; then if [ -x /usr/sbin/delgroup ]; then delgroup mpd-sima fi fi # remove log files rm -rf /var/log/mpd-sima # remove the configuration file itself rm -f /etc/mpd-sima.cfg rm -f /etc/default/mpd-sima # remove the database rm -rf /var/lib/mpd-sima } # summary of how this script can be called: # * `remove' # * `purge' # * `upgrade' # * `failed-upgrade' # * `abort-install' # * `abort-install' # * `abort-upgrade' # * `disappear' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; purge) do_mpd_sima_purge ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 debian/mpd-sima.logrotate0000644000000000000000000000013612130043657012620 0ustar /var/log/mpd-sima/*.log { weekly missingok rotate 7 compress notifempty copytruncate } debian/mpd-sima.links0000644000000000000000000000014212130043657011735 0ustar /usr/share/mpd-sima/mpd_sima /usr/bin/mpd-sima /usr/share/mpd-sima/simadb_cli /usr/bin/simadb_cli debian/changelog0000644000000000000000000000601312146724103011040 0ustar mpd-sima (0.10.0-2) unstable; urgency=low * Set package priority to optional. -- Geoffroy Youri Berret Tue, 21 May 2013 18:35:59 +0200 mpd-sima (0.10.0-1) experimental; urgency=low * Add weak dependencies on MPD in init script (Closes: #687426) * Set minimum MPD version in Suggests field * New upstream version 0.10.0 (LP: #1056738) * Bumped Standards-Version to 3.9.4.0 * Adjust Build-Depends * init script ensure creation of /run/mpd-sima -- Geoffroy Youri Berret Thu, 07 Mar 2013 00:38:02 +0100 mpd-sima (0.9.2-2) unstable; urgency=low * Bumped python-mpd version (needed for idle MPD command) * Fixed unwanted config file creation in postinst script (Closes: #673793) -- Geoffroy Youri Berret Mon, 21 May 2012 14:29:03 +0200 mpd-sima (0.9.2-1) unstable; urgency=low * New Upstream version 0.9.2 * Default similarity is now 15% * Add "Enhances" field to control file * Create database during installation (Closes: #637192) * Fixed short name license in copyright file. * Add missing status command to init script. * Use symlinks instead of shell wrappers in /usr/bin * Manuals are no longuer built with the package Upstream provides them. * Bumped Standards-Version to 3.9.3 Update copyright Format field with proper URL -- Geoffroy Youri Berret Mon, 27 Feb 2012 18:57:49 +0100 mpd-sima (0.8.0-2) unstable; urgency=low * Fix a typo in init script (Closes: #636595) -- Geoffroy Youri Berret Mon, 08 Aug 2011 11:30:10 +0200 mpd-sima (0.8.0-1) unstable; urgency=low * New upstream release (Closes: #628911) * Migrate to dh_python2 * Move packaging to multimedia packaging team (add myself to Uploaders) * Update upstream project URL * Bumped Standards-Version to 3.9.2, no changes needed * Add init script to run the service system wide (user mpd-sima) * Add lsb-base and adduser dependencies * copyright file converted to dep5 standard -- Geoffroy Youri Berret Wed, 03 Aug 2011 21:13:43 +0200 mpd-sima (0.7.2-1) unstable; urgency=low * New upstream release -- Geoffroy Youri Berret Sun, 30 Jan 2011 13:45:08 +0100 mpd-sima (0.7.1-1) unstable; urgency=low * New upstream release -- Geoffroy Youri Berret Sun, 23 Jan 2011 14:57:18 +0100 mpd-sima (0.7.0-1) unstable; urgency=low * New upstream release * Fixes incorrect Vcs-* entries in control file * Add bash completion * Rename package as mpd-sima to fit upstream project name -- Geoffroy Youri Berret Sun, 12 Dec 2010 11:50:30 +0100 sima (0.6.1-1) unstable; urgency=low * New upstream release * Clean up debian/rules file (use dh_installchangelogs) * Enhance shell wrappers * Enhance watch file -- Geoffroy Youri Berret Sat, 13 Nov 2010 09:46:42 +0100 sima (0.6.0-1) unstable; urgency=low * Initial release. (Closes: #594085) -- Geoffroy Youri Berret Thu, 02 Sep 2010 12:28:55 +0200 debian/mpd-sima.dirs0000644000000000000000000000004212130043657011555 0ustar var/lib/mpd-sima var/log/mpd-sima debian/mpd-sima.manpages0000644000000000000000000000006612130043657012415 0ustar data/mpd-sima.1 data/simadb_cli.1 data/mpd-sima.cfg.5 debian/watch0000644000000000000000000000012212130043657010213 0ustar version=3 http://sima.azylum.org/source/mpd_sima_([\d\.]+)\.tar.xz debian uupdate debian/compat0000644000000000000000000000000212130043657010365 0ustar 7 debian/copyright0000644000000000000000000000514112130043657011123 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: MPD_sima Upstream-Contact: http://codingteam.net/project/sima Source: . ./debian/watch file refers to another location which is the actual place where subversion tags are exported and made available from at the forge download page http://codingteam.net/project/sima/download Files: * Copyright: Copyright 2009-2012 Jack Kaliko Copyright 2010 Eric Casteleijn Copyright 2007, 2009 Sander Marechal Copyright 2008 Rick van Hattem License: GPL-3+ Files: launch.sh Makefile src/mpd_sima src/simadb_cli data/* src/utils/* Copyright: Copyright 2009-2012, Geoffroy Youri Berret License: GPL-3+ Files: src/lib/daemon.py Comment: Daemon code is meant to be public domain. Its original author stated so as a fallback or default for not having licenced its code and because of the few simple lines it was. The upstream author decided to use GPL for its modifications. http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ Copyright: Copyright 2010-2012 Geoffroy Youri Berret Copyright 2007, 2009 Sander Marechal License: GPL-3+ Files: src/lib/tracks.py src/lib/simadb.py src/lib/simafm.py src/lib/simafm.py Comment: The throttle decorator in simafm.py is copyrighted to Eric Casteleijn. Rick van Hattem owns copyrights in simadb.py for database management. Copyright: Copyright 2009-2012 Jack Kaliko Copyright 2010 Eric Casteleijn Copyright 2008 Rick van Hattem License: GPL-3+ Files: debian/* Copyright: Copyright 2010-2013 Geoffroy Youri Berret License: GPL-3+ License: GPL-3+ This program 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 3 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 . . On Debian systems, the full text of the GNU General Public License version 3 can be found in the file `/usr/share/common-licenses/GPL-3'. debian/mpd-sima.bash-completion0000644000000000000000000000004512130043657013703 0ustar data/mpd_sima.completion.sh mpd-sima debian/mpd-sima.default0000644000000000000000000000033512130043657012245 0ustar ## Defaults for the mpd-sima init script, sourced by /etc/init.d/mpd-sima on Debian ## systems. Comment and change values as needed. ## Change this to prevent mpd-sima from being started at startup START_MPD_SIMA=true debian/source/0000755000000000000000000000000012130043657010467 5ustar debian/source/format0000644000000000000000000000001412130043657011675 0ustar 3.0 (quilt) debian/README.Debian0000644000000000000000000000225712130043657011236 0ustar MPD_sima for Debian =================== LAUNCH AS A DAEMON: ------------------- MDP_sima is installed as a service running under special user "mpd-sima". The init script within /etc/init.d/ will launch it as a daemon with the following configuration and database files: configuration: /etc/mpd-sima.cfg database: /var/lib/mpd-sima/sima.db Launch MPD_sima using: invoke-rc.d mpd-sima start LAUNCH IT FROM YOUR USER ACCOUNT: --------------------------------- MPD_sima can also be executed from regular user accounts with mpd-sima command. The default locations for files in this case are usually users home directory: $HOME/{.config/mpd-sima,.local/share/mpd-sima} Please refer to the manual mpd-sima(1) for further details. NOTA BENE: ---------- If you run MPD_sima system wide (as a daemon) and you need to edit the database from another user account, remember that utility command simadb_cli will look in your $HOME directory for the database instead of the location defined for the daemon (the daemon uses /var/lib/mpd-sima/sima.db). Please refer to the manual simadb_cli(1) for further details. -- Geoffroy Youri Berret Sat, 09 Apr 2011 10:49:24 +0200 debian/rules0000755000000000000000000000075012130043657010251 0ustar #!/usr/bin/make -f # %: dh $@ --with bash_completion,python2 override_dh_installchangelogs: dh_installchangelogs doc/Changelog # Previous version of MPD_sima (< 0.7) did not have any installation script. # With 0.7 appears a Makefile but I kept using dh to install the source. # This is why debian/rules overrides upstream Makefile calls (clean, install # and build) # # Prevent calling upstream make targets override_dh_auto_clean: override_dh_auto_install: override_dh_auto_build: debian/control0000644000000000000000000000220412146724103010567 0ustar Source: mpd-sima Section: sound Priority: optional Maintainer: Debian Multimedia Maintainers Uploaders: Geoffroy Youri Berret Build-Depends: debhelper (>= 7.0.50~) Build-Depends-Indep: python, bash-completion X-Python-Version: >=2.6 Standards-Version: 3.9.4.0 Vcs-Git: git://git.debian.org/pkg-multimedia/mpd-sima.git Vcs-browser: http://git.debian.org/?p=pkg-multimedia/mpd-sima.git;a=summary Homepage: http://codingteam.net/project/sima Package: mpd-sima Architecture: all Depends: ${misc:Depends}, ${python:Depends}, python-mpd (>= 0.3), adduser, lsb-base Suggests: mpd (>= 0.14) Provides: mpd-client Enhances: mpd Description: Automagically add titles to MPD playlist MPD_Sima is a Python script meant to feed your MPD playlist with tracks from artists similar to your currently playing track, provided that these artists are found in MPD library. Similar artists are fetched from last.fm. . MPD_sima can queue track, top track or whole album for similar artists. . This client allows you to never run out of music when your playlist queue is getting short. debian/mpd-sima.install0000644000000000000000000000006312130043657012265 0ustar debian/mpd-sima.cfg /etc src/* /usr/share/mpd-sima debian/mpd-sima.examples0000644000000000000000000000001712130043657012434 0ustar doc/examples/* debian/mpd-sima.init0000755000000000000000000000676412130311722011572 0ustar #! /bin/sh ### BEGIN INIT INFO # Provides: mpd-sima # Required-Start: $remote_fs $local_fs # Required-Stop: $remote_fs $local_fs # Should-Start: mpd # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Starts and daemonize MPD_sima # Description: Starts and daemonize MPD_sima ### END INIT INFO # Author: Geoffroy Youri Berret # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="MPD_sima autoqueue utility" NAME=mpd-sima USER=$NAME DAEMON="/usr/bin/$NAME" PIDFILE="/run/$NAME/pid" LOGFILE="/var/log/mpd-sima/mpd-sima.log" VARDIR="/var/lib/mpd-sima/" CONF="/etc/mpd-sima.cfg" DAEMON_ARGS="--daemon --var_dir=$VARDIR \ --pid=$PIDFILE \ --config=$CONF \ --log=$LOGFILE" # 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 . /lib/init/vars.sh # Define LSB log_* functions. # Depend on lsb-base (>= 3.2-14) to ensure that this file is present # and status_of_proc is working. . /lib/lsb/init-functions # Ensure /run/mpd-sima is there, cf. Debian policy 9.4.1 # http://www.debian.org/doc/debian-policy/ch-opersys.html#s-fhs-run if [ ! -d "$(dirname $PIDFILE)" ]; then mkdir "$(dirname $PIDFILE)" chown $USER:$USER "$(dirname $PIDFILE)" chmod 755 "$(dirname $PIDFILE)" fi # # Function that starts the daemon/service # do_start() { log_daemon_msg "Starting $DESC" "$NAME " # Return # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started [ -e $PIDFILE ] && PID=$(cat "$PIDFILE") if ( [ -e $PIDFILE ] && ps -p $PID 1>&2 > /dev/null ) then log_action_end_msg 1 "already running, PID's $PID" exit 0 elif ( [ -w $PIDFILE ] ) then log_warning_msg "PID file found while ${NAME} is not running, removing file." rm $PIDFILE fi if [ "$START_MPD_SIMA" != "true" ]; then log_action_msg "Not starting mpd-sima: disabled by /etc/default/$NAME". exit 0 fi # Controling presence of $VARDIR if [ ! -d "$VARDIR" ]; then mkdir -m 0775 $VARDIR chown $USER:$USER $VARDIR fi start-stop-daemon --start --chuid $USER --quiet --exec $DAEMON -- $DAEMON_ARGS || return 2 [ -e "$PIDFILE" ] && chown $USER $PIDFILE return 0 } # # Function that stops the daemon/service # do_stop() { log_daemon_msg "Stopping $DESC" "$NAME " if !([ -w $PIDFILE ]) then log_warning_msg "PID file not found" return 0 fi start-stop-daemon --stop --oknodo --chuid $USER --user=$USER --pidfile="$PIDFILE" --retry=30 || return 1 return 0 } case "$1" in start) do_start case "$?" in 0|1) log_end_msg 0 ;; 2) log_end_msg 1 ;; esac ;; stop) do_stop case "$?" in 0) log_end_msg 0 ;; 1) log_end_msg 1 ;; esac ;; status) status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME" ;; restart|force-reload) do_stop case "$?" in 0) log_end_msg 0 do_start case "$?" in 0) log_end_msg 0 ;; *) log_end_msg 1 ;; # Failed to start esac ;; *) # Failed to stop log_end_msg 1 ;; esac ;; *) echo "Usage: invoke-rc.d $NAME {start|stop|status|restart|force-reload}" >&2 exit 3 ;; esac debian/mpd-sima.NEWS0000644000000000000000000000074512130043657011402 0ustar mpd-sima (0.9.2-1) unstable; urgency=low On purge the database will be removed, please backup /var/lib/mpd-sima/sima.db if you want to keep it. Default similarity value is now 15% (previously 20%). The dynamic similarity feature now allows a lower threshold for similarity, it will reduce loops over the same artists. If you want to tweak this value please edit /etc/mpd-sima.cfg -- Geoffroy Youri Berret Mon, 26 Mar 2012 15:18:21 +0200 debian/mpd-sima.docs0000644000000000000000000000007512130043657011552 0ustar doc/FAQ doc/README.mpd_sima doc/README.simadb_cli doc/THANKS debian/mpd-sima.cfg0000644000000000000000000000255612130043657011367 0ustar # # For complete list of options availble please refer to documentation # /usr/share/doc/mpd-sima/examples/all_settings.cfg # ########################## MPD SECTION ################################ # [MPD] host = localhost port = 6600 # comment password field if not set #password = s3cre1 # ####################################################################### ####################################################################### # # ## LOGGING FACILITY ## [log] # pick verbosity in : debug, info, warning, error # default, if not specify, is "info" # *DEBUG LEVEL WILL PRINT OUT YOUR MPD PASSWORD* verbosity = info ## [sima] ## Queue Mode ## # The default is to queue random tracks from similar artists. # ## QUEUE_MODE # type: string # Possible values: # track : Will queue tracks from similar artists. # album : Will queue whole album from similar artists. # top : Will queue top tracks from similar artists. queue_mode = track ## SIMILARITY # type: integer in [0 100] # Similarity as a percentage of similarity for the artist the code is # looking for. similarity = 15 ## ## CONSUME # type integer # How many played tracks to keep in the playlist. # Crop the playlist to maintain it to a fixed length. # Set to 0 to keep all played tracks. # consume = 0 ## # ####################### END OF CONFIGURATION ########################## # vim: syntax=cfg fileencoding=utf-8 debian/mpd-sima.postinst0000755000000000000000000000463412130311722012504 0ustar #!/bin/sh # postinst script for mpd-sima # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package do_mpd_sima_adduser () { # add group if ! getent group mpd-sima >/dev/null ; then addgroup --quiet --system mpd-sima fi # add user if ! getent passwd mpd-sima >/dev/null; then echo -n "Creating system user 'mpd-sima'" adduser --quiet --ingroup mpd-sima --system --no-create-home --home /var/lib/mpd-sima mpd-sima && echo "." fi } do_mpd_sima_perms () { for i in /var/log/mpd-sima; do if ! dpkg-statoverride --list --quiet "$i" >/dev/null; then dpkg-statoverride --force --quiet --update --add mpd-sima mpd-sima 0755 "$i" fi done # mpd-sima group should have write access to database to ease users access for i in /var/lib/mpd-sima /var/lib/mpd-sima/sima.db; do if ! dpkg-statoverride --list --quiet "$i" >/dev/null; then dpkg-statoverride --force --quiet --update --add mpd-sima mpd-sima 0775 "$i" fi done } do_mpd_sima_conf () { if ! dpkg-statoverride --list --quiet "/etc/mpd-sima.cfg" >/dev/null; then dpkg-statoverride --force --quiet --update \ --add mpd-sima mpd-sima 0600 "/etc/mpd-sima.cfg" fi } do_mpd_sima_create_db () { if [ ! -e "/var/lib/mpd-sima/sima.db" ] ; then echo -n "Creating database" mpd-sima --create-db --config="/etc/mpd-sima.cfg" --var_dir="/var/lib/mpd-sima" >/dev/null && echo "." fi } case "$1" in configure) do_mpd_sima_create_db do_mpd_sima_adduser do_mpd_sima_perms do_mpd_sima_conf ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0