From aed0bea1da25697f0b576fc63e2d7d78450592ae Mon Sep 17 00:00:00 2001 From: Trevor Batley Date: Sat, 7 Sep 2024 20:34:52 +1000 Subject: [PATCH] initial commit of file from CVS for smeserver-madsonic on Sat Sep 7 20:34:52 AEST 2024 --- .gitignore | 4 + Makefile | 21 ++++ README.md | 17 ++- contriborbase | 1 + createlinks | 31 +++++ .../db/accounts/defaults/madsonic/Target | 1 + .../db/accounts/defaults/madsonic/type | 1 + .../db/configuration/defaults/madsonic/Name | 1 + .../db/configuration/defaults/madsonic/status | 1 + .../db/configuration/defaults/madsonic/type | 1 + .../e-smith/events/actions/madsonic-fixperms | 5 + .../templates.metadata/etc/sysconfig/madsonic | 1 + .../etc/httpd/conf/httpd.conf/99madsonic | 34 ++++++ .../templates/etc/rsyslog.conf/32madsonic | 3 + .../etc/sysconfig/madsonic/40madsonic | 81 +++++++++++++ root/var/madsonic/conversion/audio/.gitignore | 0 root/var/madsonic/conversion/video/.gitignore | 0 root/var/madsonic/lucene30/album/.gitignore | 0 root/var/media/incoming/.gitignore | 0 root/var/media/playlists/backup/.gitignore | 0 root/var/media/playlists/export/.gitignore | 0 root/var/media/playlists/import/.gitignore | 0 root/var/media/podcast/.gitignore | 0 root/var/www/backend/validateLicense.view | 1 + smeserver-madsonic.spec | 111 ++++++++++++++++++ 25 files changed, 313 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 contriborbase create mode 100644 createlinks create mode 100644 root/etc/e-smith/db/accounts/defaults/madsonic/Target create mode 100644 root/etc/e-smith/db/accounts/defaults/madsonic/type create mode 100644 root/etc/e-smith/db/configuration/defaults/madsonic/Name create mode 100644 root/etc/e-smith/db/configuration/defaults/madsonic/status create mode 100644 root/etc/e-smith/db/configuration/defaults/madsonic/type create mode 100644 root/etc/e-smith/events/actions/madsonic-fixperms create mode 100644 root/etc/e-smith/templates.metadata/etc/sysconfig/madsonic create mode 100644 root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/99madsonic create mode 100644 root/etc/e-smith/templates/etc/rsyslog.conf/32madsonic create mode 100644 root/etc/e-smith/templates/etc/sysconfig/madsonic/40madsonic create mode 100644 root/var/madsonic/conversion/audio/.gitignore create mode 100644 root/var/madsonic/conversion/video/.gitignore create mode 100644 root/var/madsonic/lucene30/album/.gitignore create mode 100644 root/var/media/incoming/.gitignore create mode 100644 root/var/media/playlists/backup/.gitignore create mode 100644 root/var/media/playlists/export/.gitignore create mode 100644 root/var/media/playlists/import/.gitignore create mode 100644 root/var/media/podcast/.gitignore create mode 100644 root/var/www/backend/validateLicense.view create mode 100644 smeserver-madsonic.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cbb3a13 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.rpm +*.log +*spec-20* +*.tar.gz diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ea8f5c9 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +# Makefile for source rpm: smeserver-madsonic +# $Id: Makefile,v 1.1 2020/12/20 05:50:10 brianr Exp $ +NAME := smeserver-madsonic +SPECFILE = $(firstword $(wildcard *.spec)) + +define find-makefile-common +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +endef + +MAKEFILE_COMMON := $(shell $(find-makefile-common)) + +ifeq ($(MAKEFILE_COMMON),) +# attept a checkout +define checkout-makefile-common +test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 +endef + +MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) +endif + +include $(MAKEFILE_COMMON) diff --git a/README.md b/README.md index 4984a9f..971bcb2 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,16 @@ -# smeserver-madsonic +# smeserver-madsonic -SMEServer Koozali developed git repo for smeserver-madsonic smecontribs \ No newline at end of file +SMEServer Koozali developed git repo for smeserver-madsonic smecontribs + +## Wiki +
https://wiki.koozali.org/Madsonic +
https://wiki.koozali.org/Madsonic-howto + +## Bugzilla +Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=smeserver-madsonic&product=SME%20Contribs&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED) + +## Description + +
*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.* +*Once it has been checked, then this comment will be deleted* +
diff --git a/contriborbase b/contriborbase new file mode 100644 index 0000000..9b7fd51 --- /dev/null +++ b/contriborbase @@ -0,0 +1 @@ +contribs10 diff --git a/createlinks b/createlinks new file mode 100644 index 0000000..bfb7926 --- /dev/null +++ b/createlinks @@ -0,0 +1,31 @@ +#!/usr/bin/perl -w + +use esmith::Build::CreateLinks qw(:all); + +#################### +# links to add + +# templates to expand + templates2events( "/etc/sysconfig/madsonic" , qw( conf-madsonic bootstrap-console-save console-save post-upgrade)); + templates2events( "/etc/httpd/conf/httpd.conf" , qw( conf-madsonic )); + +# services to launch on event + safe_symlink("restart", "root/etc/e-smith/events/conf-madsonic/services2adjust/madsonic"); + safe_symlink("restart", "root/etc/e-smith/events/conf-madsonic/services2adjust/httpd-e-smith"); + +my $event= "smeserver-madsonic-update"; + safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/madsonic"); + safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith"); + safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/rsyslog"); + templates2events( "/etc/sysconfig/madsonic" , $event); + templates2events( "/etc/httpd/conf/httpd.conf" , $event); + templates2events( "/etc/rsyslog.conf" , $event); + event_actions( $event, "madsonic-fixperms" => "05"); + +use esmith::Build::Backup qw(:all); +backup_includes("smeserver-madsonic", qw( +/var/madsonic/db/ +/var/madsonic/madsonic.properties +/var/madsonic/madsonic.log +/var/madsonic/madsonic_sh.log +)); diff --git a/root/etc/e-smith/db/accounts/defaults/madsonic/Target b/root/etc/e-smith/db/accounts/defaults/madsonic/Target new file mode 100644 index 0000000..e6c167a --- /dev/null +++ b/root/etc/e-smith/db/accounts/defaults/madsonic/Target @@ -0,0 +1 @@ +http://localhost:4041/madsonic \ No newline at end of file diff --git a/root/etc/e-smith/db/accounts/defaults/madsonic/type b/root/etc/e-smith/db/accounts/defaults/madsonic/type new file mode 100644 index 0000000..c7e3841 --- /dev/null +++ b/root/etc/e-smith/db/accounts/defaults/madsonic/type @@ -0,0 +1 @@ +ProxyPass \ No newline at end of file diff --git a/root/etc/e-smith/db/configuration/defaults/madsonic/Name b/root/etc/e-smith/db/configuration/defaults/madsonic/Name new file mode 100644 index 0000000..147d097 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/madsonic/Name @@ -0,0 +1 @@ +madsonic \ No newline at end of file diff --git a/root/etc/e-smith/db/configuration/defaults/madsonic/status b/root/etc/e-smith/db/configuration/defaults/madsonic/status new file mode 100644 index 0000000..26ed6c9 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/madsonic/status @@ -0,0 +1 @@ +enabled \ No newline at end of file diff --git a/root/etc/e-smith/db/configuration/defaults/madsonic/type b/root/etc/e-smith/db/configuration/defaults/madsonic/type new file mode 100644 index 0000000..ce93fac --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/madsonic/type @@ -0,0 +1 @@ +service \ No newline at end of file diff --git a/root/etc/e-smith/events/actions/madsonic-fixperms b/root/etc/e-smith/events/actions/madsonic-fixperms new file mode 100644 index 0000000..6e01323 --- /dev/null +++ b/root/etc/e-smith/events/actions/madsonic-fixperms @@ -0,0 +1,5 @@ +#!/bin/bash + +chown madsonic:madsonic -R /var/media +chown madsonic:madsonic -R /var/madsonic/* +chown madsonic:root /var/madsonic/madsonic.properties /var/madsonic/madsonic.log diff --git a/root/etc/e-smith/templates.metadata/etc/sysconfig/madsonic b/root/etc/e-smith/templates.metadata/etc/sysconfig/madsonic new file mode 100644 index 0000000..6bbf39b --- /dev/null +++ b/root/etc/e-smith/templates.metadata/etc/sysconfig/madsonic @@ -0,0 +1 @@ +PERMS=0755 diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/99madsonic b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/99madsonic new file mode 100644 index 0000000..b4b76ab --- /dev/null +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/99madsonic @@ -0,0 +1,34 @@ +# needed local webserver to alow madsonic.test configuration +Listen 127.0.0.1:8082 + + ServerName www.madsonic.org + ServerAlias madsonic.org beta.madsonic.org + DocumentRoot /var/www/backend/ + + Alias /backend/validateLicense.view /var/www/backend/validateLicense.view + Alias /backend/validateLicenseKey.view /var/www/backend/validateLicense.view + Alias /backend/version.view /var/www/backend/validateLicense.view + + AddType text/plain .view + order allow,deny + allow from all + Require all granted + + +Listen 127.0.0.1:8090 + + ServerName www.madsonic.org + ServerAlias madsonic.org beta.madsonic.org + DocumentRoot /var/www/backend/ + Alias /backend/redirect/register.view /var/www/backend/validateLicense.view + Alias /backend/redirect/unregister.view /var/www/backend/validateLicense.view + Alias /backend/redirect/test.view /var/www/backend/validateLicense.view + Alias /backend/version.view /var/www/backend/validateLicense.view + + + AddType text/plain .view + order allow,deny + allow from all + Require all granted + + diff --git a/root/etc/e-smith/templates/etc/rsyslog.conf/32madsonic b/root/etc/e-smith/templates/etc/rsyslog.conf/32madsonic new file mode 100644 index 0000000..b5a4dd6 --- /dev/null +++ b/root/etc/e-smith/templates/etc/rsyslog.conf/32madsonic @@ -0,0 +1,3 @@ +# we do not log the service unit content outside of journald +#to see actual madsonic log see /var/madsonic/madsonic.log and /var/madsonic/madsonic_sh.log +:programname, isequal, "madsonic" ~ diff --git a/root/etc/e-smith/templates/etc/sysconfig/madsonic/40madsonic b/root/etc/e-smith/templates/etc/sysconfig/madsonic/40madsonic new file mode 100644 index 0000000..a6fc910 --- /dev/null +++ b/root/etc/e-smith/templates/etc/sysconfig/madsonic/40madsonic @@ -0,0 +1,81 @@ +# +# This is the configuration file for the Madsonic service +# (/etc/init.d/madsonic) +# +# To change the startup parameters of Madsonic, modify +# the MADSONIC_ARGS variable below. +# +# Type "/usr/share/madsonic/madsonic.sh --help" on the command line to read an +# explanation of the different options. +# +# For example, to specify that Madsonic should use port 80 (for http) +# and 443 (for https), and use a Java init memory heap size of 192 MB, +# and use a Java max memory heap size of 384 MB +# use the following: +# +# MADSONIC_ARGS="--port=80 --https-port=443 --init-memory=192 --max-memory=384" + + +#MADSONIC_ARGS="{ +$madhome = $madsonic{'home'} || "/var/madsonic"; +$madhost = $madsonic{'host'} || "0.0.0.0"; +$madport = $madsonic{'port'} || "4041"; +$madpath = $madsonic{'path'} || "/madsonic"; +$madhttps_port = $madsonic{'https_port'} || "0"; +$madinitmem = $madsonic{'InitMemory'} || "200"; +$madmem = $madsonic{'MaxMemory'} || "350"; +$madpid = $madsonic{'PIDfile'} || ""; +$madmusic = $madsonic{'Music_Folder'} || "/var/media"; +$madpod = $madsonic{'Podcast_Folder'} || "/var/media/podcast"; +$madinco = $madsonic{'Inco_Folder'} || "/var/media/incoming"; +$madimpo = $madsonic{'Impo_Folder'} || "/var/media/playlists/import"; +$madexpo = $madsonic{'Expo_Folder'} || "/var/media/playlists/export"; +$madback = $madsonic{'Back_Folder'} || "/var/media/playlists/backup"; +$madtest = $madsonic{'TestMode'} || "false"; +$madgzip = $madsonic{'gzip'} || "true"; +$madtrans = $madsonic{'TranscodeFolder'} || "/var/madsonic/transcode"; +use DateTime::TimeZone; +$madtz= $madsonic{"timezone"} || DateTime::TimeZone->new( name => 'local' )->name(); + +$OUT .= "--max-memory=$madmem --context-path='$madpath'"; + +$OUT .= " --home='$madhome'" unless $madhome eq "/var/madsonic"; +$OUT .= " --host='$madhost'" unless $madhost eq "0.0.0.0"; +$OUT .= " --port='$madport'" unless $madport == "4040"; +$OUT .= " --https-port='$madhttps_port'" unless $madhttps_port eq "0"; +$OUT .= " --pidfile='$madpid'" unless $madpid eq ""; +$OUT .= " --default-music-folder='$madmusic'" unless $madmusic eq "/var/media"; +$OUT .= " --default-podcast-folder='$madpod'" unless $madpod eq "/var/media/podcast"; +$OUT .= " --default-playlist-import-folder='$madimpo'" unless $madimpo eq "/var/media/playlists/import"; +$OUT .= " --default-playlist-export-folder='$madexpo'" unless $madexpo eq "/var/media/playlists/export"; +$OUT .= " --default-playlist-backup-folder='$madback'" unless $madback eq "/var/media/playlists/backup"; +$OUT .= " --init-memory=$madinitmem"; +$OUT .= " --max-memory=$madmem"; +}" + + +# The user which should run the Mabsonic process. Default "root". +# Note that non-root users are by default not allowed to use ports +# below 1024. Also make sure to grant the user write permissions in +# the music directories, otherwise changing album art and tags will fail. + +MADSONIC_USER=madsonic + +###for madsonic.service +MADSONIC_HOME={$madhome} +MADSONIC_HOST={$madhost} +MADSONIC_PORT={$madport} +MADSONIC_HTTPS_PORT={$madhttps_port} +MADSONIC_CONTEXT_PATH={$madpath} +MADSONIC_MAX_MEMORY={$madmem} +MADSONIC_DEFAULT_MUSIC_FOLDER={$madmusic} +MADSONIC_DEFAULT_UPLOAD_FOLDER={$madinco} +MADSONIC_DEFAULT_PODCAST_FOLDER={$madpod} +MADSONIC_DEFAULT_PLAYLIST_IMPORT_FOLDER={$madimpo} +MADSONIC_DEFAULT_PLAYLIST_EXPORT_FOLDER={$madexpo} +MADSONIC_DEFAULT_PLAYLIST_BACKUP_FOLDER={$madback} +MADSONIC_DEFAULT_TRANSCODE_FOLDER={$madtrans} +MADSONIC_DEFAULT_TIMEZONE={$madtz} +MADSONIC_GZIP={$madgzip} +MADSONIC_TEST={$madtest} + diff --git a/root/var/madsonic/conversion/audio/.gitignore b/root/var/madsonic/conversion/audio/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/root/var/madsonic/conversion/video/.gitignore b/root/var/madsonic/conversion/video/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/root/var/madsonic/lucene30/album/.gitignore b/root/var/madsonic/lucene30/album/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/root/var/media/incoming/.gitignore b/root/var/media/incoming/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/root/var/media/playlists/backup/.gitignore b/root/var/media/playlists/backup/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/root/var/media/playlists/export/.gitignore b/root/var/media/playlists/export/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/root/var/media/playlists/import/.gitignore b/root/var/media/playlists/import/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/root/var/media/podcast/.gitignore b/root/var/media/podcast/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/root/var/www/backend/validateLicense.view b/root/var/www/backend/validateLicense.view new file mode 100644 index 0000000..27ba77d --- /dev/null +++ b/root/var/www/backend/validateLicense.view @@ -0,0 +1 @@ +true diff --git a/smeserver-madsonic.spec b/smeserver-madsonic.spec new file mode 100644 index 0000000..bc654ad --- /dev/null +++ b/smeserver-madsonic.spec @@ -0,0 +1,111 @@ +%define name smeserver-madsonic +%define version 5.0.3761 +%define release 10 +Summary: madsonic is a music streaming system +Name: %{name} +Version: %{version} +Release: %{release}%{?dist} +Distribution: SME Server +License: GNU GPL version 2 +Group: SMEserver/addon +Source: smeserver-madsonic-%{version}.tar.xz + +BuildArchitectures: noarch +BuildRoot: /var/tmp/%{name}-%{version}-buildroot +BuildRequires: e-smith-devtools +Requires: e-smith-release >= 8.0 +Requires: madsonic >= 6.2.9092 +Requires: alsa-utils +Requires: ffmpeg +Requires: java-1.8.0-openjdk >= 1.8 +Requires: perl-DateTime +AutoReqProv: no + +%description +This is all the configurations needed to install madsonic as a contrib for SME Server + +%changelog +* Sat Sep 07 2024 cvs2git.sh aka Brian Read 5.0.3761-10.sme +- Roll up patches and move to git repo [SME: 12338] + +* Sat Sep 07 2024 BogusDateBot +- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday, + by assuming the date is correct and changing the weekday. + +* Wed Dec 07 2022 Jean-Philippe Pialasse 5.0.3761-9.sme +- fix conflict for /var/madsonic [SME: 12255] + +* Tue Nov 22 2022 Jean-Philippe Pialasse 5.0.3761-8.sme +- remove remaining sysvinit files [SME: 12239] +- fix few minors issues, typo and cosmetics + +* Sat Jul 30 2022 Brian Read 5.0.3761-7.sme +- Re-build and link to latest devtools [SME: 11997] + +* Fri Jul 22 2022 Jean-Philippe Pialasse 5.0.3761-6.sme +- add to core backup [SME: 12014] +- update for 6.2 neededing java-1.8.0 +- add local test webservices +- main rpm is now using systemd [SME: 11619] + +* Sun Jun 06 2021 Jean-Philippe Pialasse 5.0.3761-5.sme +- Re-build and link to latest devtools services not restarted on install [SME: 11280] + +* Fri Jun 04 2021 Jean-Philippe Pialasse 5.0.3761-4.sme +- Re-build and link to latest devtools new configuration for madsonic 6 [SME: 11280] + add update event +- add madsonic user to audio group [SME: 10700] +- add /var/media folders and subfolders [SME: 10701] + +* Sun Dec 20 2020 Brian Read 5.0.3761-3.sme +- Initial Import in SME10 [SME: 11280] + +* Mon Jun 16 2014 JP Pialasse 5.0.3761-1.sme +- initial import to SME9 contribs + +* Wed Nov 20 2013 CONTRIB MAKER 5.0.3760-2.sme +- initial release +- builds from unchanged .tar.gz + +%pre +grep '^madsonic:' /etc/passwd > /dev/null || \ +/usr/sbin/useradd -c "madsonic" -M -d /usr/share/madsonic -s /bin/bash madsonic +/usr/sbin/usermod -aG audio madsonic + +%prep +%setup +mkdir -p root/var/media/playlists/export root/var/media/playlists/import root/var/media/incoming root/var/media/podcast root/var/media/playlists/backup +mkdir -p root/var/madsonic/lucene30/album root/var/madsonic/conversion/audio root/var/madsonic/conversion/video + +%build +perl createlinks + +%install +rm -rf $RPM_BUILD_ROOT +(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) +rm -f %{name}-%{version}-filelist +/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ + --dir /var/media/ 'attr(0755,madsonic,madsonic)' \ + --dir /var/media/playlists/ 'attr(0750,madsonic,madsonic)' \ + --dir /var/media/playlists/export/ 'attr(0750,madsonic,madsonic)' \ + --dir /var/media/playlists/import/ 'attr(0750,madsonic,madsonic)' \ + --dir /var/media/incoming/ 'attr(0750,madsonic,madsonic)' \ + --dir /var/media/podcast/ 'attr(0750,madsonic,madsonic)' \ + --dir /var/media/playlists/backup/ 'attr(0750,madsonic,madsonic)' \ + --dir /var/madsonic/lucene30 'attr(0750,madsonic,madsonic)' \ + --dir /var/madsonic/lucene30/album 'attr(0750,madsonic,madsonic)' \ + --dir /var/madsonic/conversion 'attr(0750,madsonic,madsonic)' \ + --dir /var/madsonic/conversion/video 'attr(0750,madsonic,madsonic)' \ + --dir /var/madsonic/conversion/audio 'attr(0750,madsonic,madsonic)' \ + --file /var/www/backend/validateLicense.view 'attr(0750,www,www)' \ + --dir /var/www/backend/ 'attr(0750,www,www)' \ + --ignoredir /var/madsonic \ + > %{name}-%{version}-filelist + +%clean +rm -rf $RPM_BUILD_ROOT + +%files -f %{name}-%{version}-filelist +%defattr(-,root,root) + +