From: Arne Fitzenreiter Date: Sat, 24 Feb 2024 15:39:59 +0000 (+0100) Subject: mpd: move scripts and config from mpfire to mpd X-Git-Tag: v2.29-core185~161 X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff_plain;h=3de42257d00724f578d2f374ce47a70082edf42a mpd: move scripts and config from mpfire to mpd this allows to use mpd without mpfire installed. Signed-off-by: Arne Fitzenreiter --- diff --git a/config/backup/includes/mpd b/config/backup/includes/mpd new file mode 100644 index 0000000000..a570a8d1cf --- /dev/null +++ b/config/backup/includes/mpd @@ -0,0 +1,4 @@ +/etc/asound.state +/var/ipfire/mpd/db/ +/var/ipfire/mpd/mpd.conf +/var/ipfire/mpd/mpd_state diff --git a/config/backup/includes/mpfire b/config/backup/includes/mpfire index 4ea18a2a1a..a21e77a6f6 100644 --- a/config/backup/includes/mpfire +++ b/config/backup/includes/mpfire @@ -1,6 +1,2 @@ -/etc/asound.state -/var/ipfire/mpfire/db/ -/var/ipfire/mpfire/mpd.conf -/var/ipfire/mpfire/mpd_state /var/ipfire/mpfire/settings /var/ipfire/mpfire/webradio diff --git a/config/mpfire/mpd.conf b/config/mpd/mpd.conf similarity index 93% rename from config/mpfire/mpd.conf rename to config/mpd/mpd.conf index d66481ecfd..c4aabdf0b4 100644 --- a/config/mpfire/mpd.conf +++ b/config/mpd/mpd.conf @@ -5,7 +5,7 @@ ##################### REQUIRED ########################### port "6600" music_directory "/var/mp3" -playlist_directory "/var/ipfire/mpfire" +playlist_directory "/var/ipfire/mpd" log_file "/var/log/mpd.log" pid_file "/var/run/mpd.pid" ########################################################## @@ -18,7 +18,7 @@ pid_file "/var/run/mpd.pid" # # Location of DB file # -db_file "/var/ipfire/mpfire/db/mpd.db" +db_file "/var/ipfire/mpd/db/mpd.db" # # The state file (if set) will be a file # for storing all current information @@ -27,7 +27,7 @@ db_file "/var/ipfire/mpfire/db/mpd.db" # to recreate your last MPD session after # restart. # -state_file "/var/ipfire/mpfire/mpd_state" +state_file "/var/ipfire/mpd/mpd_state" # ########################################################## @@ -104,12 +104,6 @@ audio_output { # audio_buffer_size "2048" # -# This means exactly what it says, it will -# buffer your file up to the percentage of -# the buffer before it begins playing. -# -buffer_before_play "25%" -# ########################################################## @@ -189,9 +183,6 @@ connection_timeout "60" # filesystem_charset "UTF-8" # -# The encoding that ID3v1 tags should be converted from. -# -id3v1_encoding "UTF-8" metadata_to_use "artist,album,title,track,name,comment,date,genre" # ################################################################ diff --git a/config/mpfire/mpfire.pl b/config/mpfire/mpfire.pl index 66413145de..15abd78932 100644 --- a/config/mpfire/mpfire.pl +++ b/config/mpfire/mpfire.pl @@ -87,7 +87,7 @@ sub shuffle(){ } sub checkplaylist(){ - my $Datei = "/var/ipfire/mpfire/playlist.m3u"; + my $Datei = "/var/ipfire/mpd/playlist.m3u"; my @Info = stat($Datei); if ( $Info[7] eq '' || $Info[7] eq '0' ){print "There is no playlist";exit(1);} } diff --git a/config/rootfiles/packages/gnump3d b/config/rootfiles/packages/gnump3d index 4679c87b1b..ab1f0282cb 100644 --- a/config/rootfiles/packages/gnump3d +++ b/config/rootfiles/packages/gnump3d @@ -387,4 +387,5 @@ usr/share/gnump3d var/cache/gnump3d var/cache/gnump3d/serving var/log/gnump3d +#var/mp3 var/mp3/info diff --git a/config/rootfiles/packages/mpd b/config/rootfiles/packages/mpd index 85501238ba..828ae31e17 100644 --- a/config/rootfiles/packages/mpd +++ b/config/rootfiles/packages/mpd @@ -8,3 +8,10 @@ usr/bin/mpd #usr/share/icons/hicolor/scalable/apps/mpd.svg var/log/mpd.error.log var/log/mpd.log +var/ipfire/backup/addons/includes/mpd +#var/ipfire/mpd +#var/ipfire/mpd/db +var/ipfire/mpd/db/info +var/ipfire/mpd/mpd.conf +var/ipfire/mpd/playlist.m3u +var/mp3/info diff --git a/config/rootfiles/packages/mpfire b/config/rootfiles/packages/mpfire index ec0ea43959..ab12bde032 100644 --- a/config/rootfiles/packages/mpfire +++ b/config/rootfiles/packages/mpfire @@ -27,15 +27,9 @@ var/ipfire/menu.d/EX-mpfire.menu var/ipfire/mpfire var/ipfire/mpfire/bin var/ipfire/mpfire/bin/mpfire.pl -#var/ipfire/mpfire/db -var/ipfire/mpfire/db/info -var/ipfire/mpfire/mpd.conf -var/ipfire/mpfire/playlist.m3u var/ipfire/mpfire/settings var/ipfire/mpfire/webradio -var/mp3/info usr/local/bin/mpfirectrl srv/web/ipfire/cgi-bin/mpfire.cgi srv/web/ipfire/html/images/mpfire var/ipfire/menu.d/EX-mpfire.menu -#var/mp3 diff --git a/html/cgi-bin/mpfire.cgi b/html/cgi-bin/mpfire.cgi index ea83d1db17..5685053e66 100644 --- a/html/cgi-bin/mpfire.cgi +++ b/html/cgi-bin/mpfire.cgi @@ -214,11 +214,11 @@ if ( $mpfiresettings{'ACTION'} eq "scan" ){ delete $mpfiresettings{'PAGE'}; delete $mpfiresettings{'FRAME'}; &General::writehash("${General::swroot}/mpfire/settings", \%mpfiresettings); - open(DATEI, "<${General::swroot}/mpfire/mpd.conf") || die "Datei nicht gefunden"; + open(DATEI, "<${General::swroot}/mpd/mpd.conf") || die "Datei nicht gefunden"; my @Zeilen = ; close(DATEI); - open(DATEI, ">${General::swroot}/mpfire/mpd.conf") || die "Datei nicht gefunden"; + open(DATEI, ">${General::swroot}/mpd/mpd.conf") || die "Datei nicht gefunden"; foreach (@Zeilen){ if ( $_ =~ /music_directory/){ print DATEI "music_directory \"".$mpfiresettings{'MUSICDIR'}."\"\n"; diff --git a/lfs/mpd b/lfs/mpd index a9807b3cda..06aea9e3dc 100644 --- a/lfs/mpd +++ b/lfs/mpd @@ -1,7 +1,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007-2023 IPFire Team # +# Copyright (C) 2007-2024 IPFire Team # # # # 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 # @@ -34,7 +34,7 @@ DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/${THISAPP} TARGET = $(DIR_INFO)/$(THISAPP) PROG = mpd -PAK_VER = 33 +PAK_VER = 35 # SUP_ARCH = aarch64 x86_64 DEPS = alsa avahi faad2 ffmpeg flac lame libmad libshout libogg libid3tag libvorbis opus soxr fmt @@ -105,6 +105,16 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) #install initscripts $(call INSTALL_INITSCRIPTS,$(SERVICES)) + -mkdir -p /var/ipfire/mpd/db + touch /var/ipfire/mpd/playlist.m3u + install -v -m 664 $(DIR_SRC)/config/mpd/mpd.conf /var/ipfire/mpd/ + echo "Folder for mpd database" > /var/ipfire/mpd/db/info + -mkdir -p /var/mp3 + echo "Folder for music files" > /var/mp3/info + chown root.nobody /var/ipfire/mpd/{mpd.conf,playlist.m3u} + chmod 664 /var/ipfire/mpd/playlist.m3u + install -v -m 644 $(DIR_SRC)/config/backup/includes/mpd /var/ipfire/backup/addons/includes/mpd + @rm -rf $(DIR_APP) touch /var/log/mpd.error.log touch /var/log/mpd.log diff --git a/lfs/mpfire b/lfs/mpfire index 590cf31ef3..54551a0b6d 100644 --- a/lfs/mpfire +++ b/lfs/mpfire @@ -1,7 +1,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007-2019 IPFire Team # +# Copyright (C) 2007-2024 IPFire Team # # # # 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 # @@ -32,7 +32,7 @@ THISAPP = mpfire-$(VER) DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) PROG = mpfire -PAK_VER = 16 +PAK_VER = 17 DEPS = mpd mpc @@ -61,17 +61,11 @@ dist: $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) - -mkdir -p /var/ipfire/mpfire/{bin,db} - touch /var/ipfire/mpfire/{settings,playlist.m3u} + -mkdir -p /var/ipfire/mpfire/bin + touch /var/ipfire/mpfire/settings install -v -m 755 $(DIR_SRC)/config/mpfire/mpfire.pl /var/ipfire/mpfire/bin - install -v -m 664 $(DIR_SRC)/config/mpfire/mpd.conf /var/ipfire/mpfire/ install -v -m 644 $(DIR_SRC)/config/mpfire/webradio /var/ipfire/mpfire/ - echo "Folder for mpd database" > /var/ipfire/mpfire/db/info - -mkdir -p /var/mp3 - echo "Folder for music files" > /var/mp3/info - chown root.nobody /var/ipfire/mpfire/{mpd.conf,playlist.m3u} chown nobody.nobody /var/ipfire/mpfire/{settings,webradio} - chmod 664 /var/ipfire/mpfire/playlist.m3u chmod 755 /srv/web/ipfire/html/images/mpfire install -v -m 644 $(DIR_SRC)/config/backup/includes/mpfire /var/ipfire/backup/addons/includes/mpfire -mkdir -p /usr/lib/perl5/site_perl/5.36.0/Audio/ diff --git a/src/paks/mpd/install.sh b/src/paks/mpd/install.sh new file mode 100644 index 0000000000..05b0592c6a --- /dev/null +++ b/src/paks/mpd/install.sh @@ -0,0 +1,32 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire 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. # +# # +# IPFire 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 IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007-2024 IPFire-Team . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +extract_files +ln -svf /etc/init.d/mpd /etc/rc.d/rc3.d/S65mpd +ln -svf /etc/init.d/mpd /etc/rc.d/rc0.d/K35mpd +ln -svf /etc/init.d/mpd /etc/rc.d/rc6.d/K35mpd +ln -svf /var/ipfire/mpd/mpd.conf /etc/mpd.conf +touch /var/log/mpd.log +restore_backup ${NAME} +/etc/init.d/mpd start diff --git a/src/paks/mpd/uninstall.sh b/src/paks/mpd/uninstall.sh new file mode 100644 index 0000000000..7b86ae393d --- /dev/null +++ b/src/paks/mpd/uninstall.sh @@ -0,0 +1,28 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire 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. # +# # +# IPFire 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 IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007-2024 IPFire-Team . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +/etc/init.d/mpd stop +make_backup ${NAME} +remove_files +rm -f /etc/rc.d/rc*.d/???mpd /var/log/mpd.error.log /var/log/mpd.log /etc/mpd.conf diff --git a/src/paks/mpd/update.sh b/src/paks/mpd/update.sh new file mode 100644 index 0000000000..31d1d77cc5 --- /dev/null +++ b/src/paks/mpd/update.sh @@ -0,0 +1,27 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire 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. # +# # +# IPFire 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 IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007-2024 IPFire-Team . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +extract_backup_includes +./uninstall.sh +./install.sh diff --git a/src/paks/mpfire/install.sh b/src/paks/mpfire/install.sh index f8f833de96..541a25ca2e 100644 --- a/src/paks/mpfire/install.sh +++ b/src/paks/mpfire/install.sh @@ -17,20 +17,11 @@ # along with IPFire; if not, write to the Free Software # # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # # -# Copyright (C) 2007-2011 IPFire-Team . # +# Copyright (C) 2007-2024 IPFire-Team . # # # ############################################################################ # . /opt/pakfire/lib/functions.sh extract_files -ln -svf /etc/init.d/mpd /etc/rc.d/rc3.d/S65mpd -ln -svf /etc/init.d/mpd /etc/rc.d/rc0.d/K35mpd -ln -svf /etc/init.d/mpd /etc/rc.d/rc6.d/K35mpd -ln -svf /var/ipfire/mpfire/mpd.conf /etc/mpd.conf chmod 755 /srv/web/ipfire/html/images/mpfire -touch /var/log/mpd.log restore_backup ${NAME} -# comment removed option from config -sed -i -e "s|^error_file|#error_file|g" /var/ipfire/mpfire/mpd.conf -# -/etc/init.d/mpd start diff --git a/src/paks/mpfire/uninstall.sh b/src/paks/mpfire/uninstall.sh index 7dec707ee2..ed7e6a821c 100644 --- a/src/paks/mpfire/uninstall.sh +++ b/src/paks/mpfire/uninstall.sh @@ -17,12 +17,10 @@ # along with IPFire; if not, write to the Free Software # # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # # -# Copyright (C) 2007 IPFire-Team . # +# Copyright (C) 2007-2024 IPFire-Team . # # # ############################################################################ # . /opt/pakfire/lib/functions.sh -/etc/init.d/mpd stop make_backup ${NAME} remove_files -rm -f /etc/rc.d/rc*.d/???mpd /var/log/mpd.error.log /var/log/mpd.log /etc/mpd.conf diff --git a/src/paks/mpfire/update.sh b/src/paks/mpfire/update.sh index 99776659c3..31d1d77cc5 100644 --- a/src/paks/mpfire/update.sh +++ b/src/paks/mpfire/update.sh @@ -17,7 +17,7 @@ # along with IPFire; if not, write to the Free Software # # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # # -# Copyright (C) 2007-2020 IPFire-Team . # +# Copyright (C) 2007-2024 IPFire-Team . # # # ############################################################################ #