]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
mpd: move scripts and config from mpfire to mpd
authorArne Fitzenreiter <arne_f@ipfire.org>
Sat, 24 Feb 2024 15:39:59 +0000 (16:39 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Sat, 24 Feb 2024 15:39:59 +0000 (16:39 +0100)
this allows to use mpd without mpfire installed.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
16 files changed:
config/backup/includes/mpd [new file with mode: 0644]
config/backup/includes/mpfire
config/mpd/mpd.conf [moved from config/mpfire/mpd.conf with 93% similarity]
config/mpfire/mpfire.pl
config/rootfiles/packages/gnump3d
config/rootfiles/packages/mpd
config/rootfiles/packages/mpfire
html/cgi-bin/mpfire.cgi
lfs/mpd
lfs/mpfire
src/paks/mpd/install.sh [new file with mode: 0644]
src/paks/mpd/uninstall.sh [new file with mode: 0644]
src/paks/mpd/update.sh [new file with mode: 0644]
src/paks/mpfire/install.sh
src/paks/mpfire/uninstall.sh
src/paks/mpfire/update.sh

diff --git a/config/backup/includes/mpd b/config/backup/includes/mpd
new file mode 100644 (file)
index 0000000..a570a8d
--- /dev/null
@@ -0,0 +1,4 @@
+/etc/asound.state
+/var/ipfire/mpd/db/
+/var/ipfire/mpd/mpd.conf
+/var/ipfire/mpd/mpd_state
index 4ea18a2a1aedb1dcdf6089347dc0601fe126d0f4..a21e77a6f6fa6988e6866784932323cce3d323df 100644 (file)
@@ -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
similarity index 93%
rename from config/mpfire/mpd.conf
rename to config/mpd/mpd.conf
index d66481ecfdd6ef7ad33755a70876961f0b637f01..c4aabdf0b4bcfb4c10e5135cce6e6673fba500df 100644 (file)
@@ -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"
 #
 ################################################################
index 66413145de61a1545bd4ac992a3801d6f7168f39..15abd78932143678bc40eada4a173555a95c5be0 100644 (file)
@@ -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);}
 }
index 4679c87b1b6d000b3c2865b77b69c3c8244ce013..ab1f0282cb94810c3a3aaf31bf2cfd0b98fb6510 100644 (file)
@@ -387,4 +387,5 @@ usr/share/gnump3d
 var/cache/gnump3d
 var/cache/gnump3d/serving
 var/log/gnump3d
+#var/mp3
 var/mp3/info
index 85501238bad8638c0d0c0bcedc5b4e95890b3577..828ae31e17aeda0a7f50c99eecde8ae6dffad63f 100644 (file)
@@ -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
index ec0ea439595360676095a29dc677c974e79f00bf..ab12bde03275ece6a8e66068b5969c320e2128d9 100644 (file)
@@ -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
index ea83d1db17f2e3b8fdc5b0beb6ed15c2d348071d..5685053e668fd3f80b9ea0abdd8a0c1c4c3edf21 100644 (file)
@@ -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 = <DATEI>;
        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 a9807b3cda1ef790aa7a0b4873663eb01e2c3a5a..06aea9e3dc3b5db466a5acc4dcee554305fed1c1 100644 (file)
--- a/lfs/mpd
+++ b/lfs/mpd
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2023  IPFire Team  <info@ipfire.org>                     #
+# Copyright (C) 2007-2024  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # 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
index 590cf31ef315178f2f591227c987e12b991a3f3e..54551a0b6d02c4df08e9e1095102441fa5d206a6 100644 (file)
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2019  IPFire Team  <info@ipfire.org>                     #
+# Copyright (C) 2007-2024  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # 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 (file)
index 0000000..05b0592
--- /dev/null
@@ -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 <info@ipfire.org>.                   #
+#                                                                          #
+############################################################################
+#
+. /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 (file)
index 0000000..7b86ae3
--- /dev/null
@@ -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 <info@ipfire.org>.                   #
+#                                                                          #
+############################################################################
+#
+. /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 (file)
index 0000000..31d1d77
--- /dev/null
@@ -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 <info@ipfire.org>.                   #
+#                                                                          #
+############################################################################
+#
+. /opt/pakfire/lib/functions.sh
+extract_backup_includes
+./uninstall.sh
+./install.sh
index f8f833de969b633acf8239ce6246f68f1afaf519..541a25ca2e30b1b97cfdd2d5e556c8e228e4e86e 100644 (file)
 # 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 <info@ipfire.org>.                   #
+# Copyright (C) 2007-2024 IPFire-Team <info@ipfire.org>.                   #
 #                                                                          #
 ############################################################################
 #
 . /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
index 7dec707ee22c69c4c39eb91fe44b38cb122e6fc0..ed7e6a821c779a67b6d8ab3d791e23063d984c4b 100644 (file)
 # 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 <info@ipfire.org>.                        #
+# Copyright (C) 2007-2024 IPFire-Team <info@ipfire.org>.                   #
 #                                                                          #
 ############################################################################
 #
 . /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
index 99776659c31ca813c685a8c1c983df98896933e9..31d1d77cc591bccc5fe45f54922e7ccdb9ecd69e 100644 (file)
@@ -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 <info@ipfire.org>.                   #
+# Copyright (C) 2007-2024 IPFire-Team <info@ipfire.org>.                   #
 #                                                                          #
 ############################################################################
 #