# Prevent stripping %define __spec_install_post /usr/lib/rpm/brp-compress # This flag controls whether to package the firmware binaries %define proprietary_build 0 Name: slimserver # This is only for makerelease.pl BuildRequires: perl-File-Which #%if 0%{?suse_version} > 1020 # BuildRequires: fdupes #%endif License: GPL Group: System Environment/Daemons Version: _VERSION_ Release: 1 Requires: perl >= 5.8.1 Requires: perl-XML-Parser Requires: perl-Digest-SHA1 Requires: mysql Requires: flac Requires: sox AutoReqProv: no Vendor: Logitech URL: http://www.slimdevices.com/ Summary: This is the SqueezeCenter server software Packager: Will Stephenson PreReq: %insserv_prereq %fillup_prereq /bin/awk /bin/grep /sbin/service /usr/sbin/useradd /usr/sbin/usermod /usr/sbin/groupadd Source: _SOURCE_ Source1: slimserver.init Source2: slimserver.config Source3: slimserver.logrotate Patch0: suse.patch Obsoletes: SliMP3 Provides: SliMP3 BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot Prefix: %{_datadir} %description This is the SqueezeCenter server software. Point your web browser to http://localhost:9000/ to configure the server. * Open-source server, written in Perl (GPL) * Optional HTTP interface - control the player and manage your playlists from a web browser! * Internet radio - Shoutcast, Icecast, RadioIO, and Live365 * Unlimited capacity - it doesn't matter if your mp3 collection is a megabyte or a terabyte. Your files are not stored on the player, so there's no limit to the amount of music you can access, and you don't need to hassle with copying your files onto the player. * Easy to use hierarchical browser interface * Random mode * Supports .pls and .m3u playlist files %if %{proprietary_build} %package firmware Group: Hardware/Other Summary: SqueezeCenter player firmware Requires: %name = %version License: Any commercial, Logitech EULA says: REDISTRIBUTION NOT PERMITTED %description firmware Proprietary firmware for upgrading SqueezeBox and Transporter hardware %endif %package skins Group: System Environment/Daemons Summary: Skins for SqueezeCenter Requires: %name = %version %description skins Skins for the SqueezeCenter music server application %prep %setup -n _SOURCEFILE_ %patch0 -p 1 %build [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT echo "Fixing permission errors reported by rpmlint in sources, fix in repo instead" chmod 644 Slim/Plugin/Jive/Plugin.pm chmod 644 Slim/Plugin/RS232/Settings.pm chmod 644 Slim/Plugin/Favorites/Plugin.pm # delete these lines after the files in the repo are fixed chmod 644 CPAN/Net/UPnP/QueryResponse.pm chmod 644 CPAN/Net/UPnP/HTTPResponse.pm chmod 644 CPAN/Net/UPnP/HTTP.pm chmod 644 CPAN/Net/UPnP/Device.pm chmod 644 CPAN/Net/UPnP/ActionResponse.pm chmod 644 CPAN/Net/UPnP.pm chmod 644 CPAN/Devel/InnerPackage.pm chmod 644 CPAN/DBI/Shell/Timing.pm chmod 644 CPAN/DBI/Shell/SQLMinus.pm chmod 644 CPAN/DBI/Shell/Completion.pm chmod 644 CPAN/DBI/Shell.pm chmod 644 CPAN/DBI/Format/SQLMinus.pm chmod 644 CPAN/DBI/Format.pm rm -r Slim/Plugin/Podcast/CVS #unneeded binaries since we are using what system packages provide rm -rf Bin/i386-linux/alac rm -rf Bin/i386-linux/flac #Will: leave in mDNS* until we figure out how to do that with Avahi #rm -rf Bin/i386-linux/mDNSResponderPosix rm -rf Bin/i386-linux/mppdec rm -rf Bin/i386-linux/mysqld rm -rf Bin/i386-linux/sox # Remove unneeded mysql doc files rm MySQL/COPYING rm MySQL/README # Remove errmsg.sys files from the MySQL dir, since they # may not match up with the installed version's rm MySQL/errmsg.* %install %if 0%{?suse_version} > 1020 %fdupes -s $RPM_BUILD_ROOT %endif DOCDIR=$RPM_BUILD_ROOT%{_defaultdocdir}/%{name} install -d -m 755 $RPM_BUILD_ROOT%{_sbindir} install -d -m 755 $RPM_BUILD_ROOT%{_initrddir} install -d -m 755 $DOCDIR install -d -m 755 $RPM_BUILD_ROOT%{prefix}/%{name} install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/%{name} install -d -m 755 $RPM_BUILD_ROOT%{_var}/log/%{name} install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d install -d -m 755 $RPM_BUILD_ROOT%{_var}/cache/%{name} install -d -m 755 $RPM_BUILD_ROOT%perl_vendorlib # Will: playlist and music dirs in /srv? cp -R Slim $RPM_BUILD_ROOT%perl_vendorlib cp -R lib $RPM_BUILD_ROOT%{prefix}/%{name} cp -R CPAN $RPM_BUILD_ROOT%{prefix}/%{name} # Will: Remove non-Linux binary modules cp -R Bin $RPM_BUILD_ROOT%{prefix}/%{name} %if ! %{proprietary_build} rm -rf Firmware/*.bin %endif cp -R Firmware $RPM_BUILD_ROOT%{prefix}/%{name} cp -R Graphics $RPM_BUILD_ROOT%{prefix}/%{name} cp -R HTML $RPM_BUILD_ROOT%{prefix}/%{name} cp -R IR $RPM_BUILD_ROOT%{prefix}/%{name} cp -R MySQL $RPM_BUILD_ROOT%{prefix}/%{name} cp -R Plugins $RPM_BUILD_ROOT%{prefix}/%{name} cp -R SQL $RPM_BUILD_ROOT%{prefix}/%{name} install -m 644 revision.txt strings.txt $RPM_BUILD_ROOT%{prefix}/%{name} # Documentation install -m 644 Installation.txt License*.txt Changelog*.html $DOCDIR # Executables install slimserver.pl $RPM_BUILD_ROOT%{_sbindir}/%{name} install scanner.pl $RPM_BUILD_ROOT%{_sbindir}/%{name}-scanner # Configuration files install *.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name} install -D -m 755 %SOURCE1 $RPM_BUILD_ROOT%{_initrddir}/%{name} install -D -m 644 %SOURCE2 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name} touch $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/server.prefs touch $RPM_BUILD_ROOT%{_var}/log/%{name}/%{name}.log install -m 644 %SOURCE3 $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name} %clean [ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -r $RPM_BUILD_ROOT cd .. [ "$RPM_BUILD_DIR" != "/" ] && [ -d $RPM_BUILD_DIR/SlimServer_v%{version} ] \ && rm -r $RPM_BUILD_DIR/SlimServer_v%{version} %pre SLIMSERVER_USER=slimserver # Someone might have changed the default. Lets make sure we use it. if [ -f %{_sysconfdir}/sysconfig/slimserver ]; then . %{_sysconfdir}/sysconfig/slimserver; fi # WILL: check if all servers should use system users/groups ('-m') /usr/sbin/groupadd $SLIMSERVER_USER >/dev/null 2>/dev/null || : /usr/sbin/useradd -c "SlimServer" -g $SLIMSERVER_USER \ -d %{prefix}/%{name} -s /sbin/nologin $SLIMSERVER_USER 2>/dev/null || : /usr/sbin/usermod -g $SLIMSERVER_USER -s /sbin/nologin $SLIMSERVER_USER %post SLIMSERVER_USER=slimserver # Someone might have changed the default. Lets make sure we use it. if [ -f %{_sysconfdir}/sysconfig/%{name} ]; then . %{_sysconfdir}/sysconfig/%{name}; fi # Make sure we have the correct SLIMSERVER_HOME in /etc/sysconfig/slimserver # Convert / to \/ for the sed substitution if [ `grep -c PREFIX /%{_sysconfdir}/sysconfig/%{name}` -gt 0 ]; then DEST_FILE=%{_sysconfdir}/sysconfig/%{name} SLIMSERVER_PREFIX=`echo %{prefix}/%{name} | sed 's/\//\\\\\//g'` tempfile=`mktemp` sed "s/PREFIX/$SLIMSERVER_PREFIX/" $DEST_FILE > $tempfile if [ -s $tempfile ]; then cp $tempfile $DEST_FILE rm $tempfile fi fi if [ ! -s {_sysconfdir}/%{name}/slimserver.conf ] && [ -e /etc/slimp3.pref ]; then cp /etc/slimp3.pref {_sysconfdir}/%{name}/server.prefs fi %if %{defined suse_version} %{fillup_and_insserv -f %{name}} %endif PORT=`awk '/^httpport/ {print $2}' %{_sysconfdir}/%{name}/server.prefs` # Set a default port if one doesn't exist. if [ ! -z "$PORT" -o ! -s %{_sysconfdir}/%{name}/server.prefs ]; then PORT=9000 fi HOSTNAME=`uname -n` echo "'%{_initrddir}/%{name} start' to start the SqueezeCenter server, then" echo "Point your web browser to http://$HOSTNAME:$PORT/ to configure your server." %preun %if %{defined suse_version} %stop_on_removal %{name} %else # Only if we are not upgrading... if [ "$1" -eq "0" ] ; then if [ -x /sbin/service ]; then /sbin/service slimserver stop >/dev/null 2>&1 || : fi if [ -x /sbin/chkconfig ]; then /sbin/chkconfig --del slimserver fi fi %endif %postun %if %{defined suse_version} %restart_on_update %{name} %insserv_cleanup %else # Only if we are upgrading... if [ "$1" -ge "1" ]; then if [ -x /sbin/service ]; then /sbin/service slimserver restart >/dev/null 2>&1 || : fi fi %endif %files %defattr(-,root,root) %{prefix}/%{name}/Bin %{prefix}/%{name}/CPAN # Firmware files must be writeable for later online update %dir %attr(755, slimserver, slimserver) %{prefix}/%{name}/Firmware %attr(644, slimserver, slimserver) %{prefix}/%{name}/Firmware/*.version %{prefix}/%{name}/Graphics %dir %{prefix}/%{name}/HTML %{prefix}/%{name}/HTML/Default %{prefix}/%{name}/HTML/EN %{prefix}/%{name}/HTML/README.txt %{prefix}/%{name}/IR %{prefix}/%{name}/MySQL %{perl_vendorlib}/Slim %{prefix}/%{name}/SQL %{prefix}/%{name}/lib %{prefix}/%{name}/strings.txt %{prefix}/%{name}/revision.txt %doc %{_defaultdocdir}/%{name} %attr(755, root, root) %{_sbindir}/%{name} %attr(755, root, root) %{_sbindir}/%{name}-scanner %attr(755, slimserver, slimserver) %dir %_var/log/%{name} %attr(640, slimserver, slimserver) %ghost %_var/log/%{name}/%{name}.log %config %{_sysconfdir}/logrotate.d/%{name} %dir %attr(-, slimserver, slimserver) %config(noreplace) %{_sysconfdir}/%{name} %attr(640, slimserver, slimserver) %config(noreplace) %{_sysconfdir}/%{name}/convert.conf %attr(640, slimserver, slimserver) %config(noreplace) %{_sysconfdir}/%{name}/modules.conf %attr(640, slimserver, slimserver) %config(noreplace) %ghost %{_sysconfdir}/%{name}/server.prefs %attr(640, slimserver, slimserver) %config(noreplace) %{_sysconfdir}/%{name}/types.conf %attr(-, slimserver, slimserver) %{_var}/cache/%{name} %attr(-, root, root) %{_initrddir}/%{name} %attr(-, root, root) %config(noreplace) %{_sysconfdir}/sysconfig/%{name} %if %{proprietary_build} %files firmware %defattr(-,root,root) # Firmware files must be writeable for later online update %attr(644, slimserver, slimserver) %{prefix}/%{name}/Firmware/*.bin %endif %files skins %defattr(-,root,root) %{prefix}/%{name}/HTML/Classic %{prefix}/%{name}/HTML/Fishbone %{prefix}/%{name}/HTML/Handheld %{prefix}/%{name}/HTML/Nokia770 %{prefix}/%{name}/HTML/Touch %{prefix}/%{name}/HTML/xml %{prefix}/%{name}/HTML/xmlTelCanto %changelog * Tue Apr 11 2005 dsully - Make the RPM more SuSE friendly. - Fix an error with printing the port number on install/upgrade. (bug 974) * Thu Nov 6 2003 dean - Renaming slimd to slimserver * Mon Sep 15 2003 kdf - Patch submitted by many for custom port message on install - remove /tmp/slimd.log if it exists, avoid server crash if its locked. * Fri Aug 1 2003 kdf - Change user to slim, install to /usr/local/slimd for consistency - Copy old slimp3.pref if it exists and slimd.conf is zero length (new) * Thu May 22 2003 dean Victor Brilon submitted a patch: - Got rid of the -r param. On RedHat this creates a system account w/a UID lower than value of UID_MIN. I don't see why we need to do this as the slimp3 user is not a priviledged user. Also, with this param, the -d flag will never create a home dir for security reasons. - Got rid of the -s flag as this will force the system to use the default shell for the user. - Also with useradd, if a passwd is not specified (which is exactly what we're doing), the default action is to lock the account so you can't login into it. This should work ok as we can still su into it to start the slimp3 player. - The slimp3 directory hierarchy should be owned by the slimp3 user not by root. Changed that as well. This should prevent some of the problems people were having with saving playlists and such. * Mon Feb 10 2003 DV - Remove tag database on full uninstall. db.pag gets big. - Fixed postinstall substitution - Remove nondefault user and group * Sun Feb 09 2003 Mike Arnold - Cleaned up DV's changes to the preinstall script. - Added %config(noreplace) to /etc/sysconfig/slimp3. - Fixed two changes in the postinstall script that broke relocation. * Thu Oct 24 2002 DV - changed account to a system account and shell to nologin. - don't add user with default name if the admin changed it. * Tue Oct 22 2002 Mike Arnold - Fixed a problem with doing a package "upgrade" and losing the passwd entry for the slimp3 user in %preun and %postun. - Made sure an existing /etc/slimp3.pref was not replaced by a newer package. - Got rid of all the commented, tarball-removal stuff in %pre. - Beautified the spec file for final release. * Sun Oct 20 2002 Dean Blackketter - Mike Arnold told me to take out the postun directive that removes the passwd entry to fix upgrades. * Tue Oct 01 2002 Mike Arnold - Made the slimp3 user's $HOME be in the correct place even with a relocatable package. * Wed Sep 11 2002 Dean Blackketter - Made the default install back to /usr/local/bin instead of /opt * Sun Sep 08 2002 Mike Arnold - Made the RPM relocatable for those who do not want to use /opt including a %post hack to mod /etc/sysconfig/slimp3 - Made sure slimp3.pl was chmod +x, even if the tarball was wrong - Cleaned up the BUILD_DIR after the rpms are built - Changed localhost to "uname -n" in post-install commandline echo - Disabled the deletion of old (pre-RPM) files as the procs may still be running. Should we just assume no preexisting installs? - Pulled _topdir out and let the build system or user specify it. * Wed Sep 04 2002 Dean Blackketter - Disabling the shutdown of old (pre-RPM) processes. - Added AutoReqProv: no, because all we really need is perl - Disabled the documentation install until we have some better docs. (until then, use the built-in documentation, available via the web interface) * Mon Sep 02 2002 Mike Arnold - Changed the slimp3dir to /opt as this is where "packages" should go - Added an external startup config file in /etc/sysconfig - Added documentation to the RPM - Kept %postun from deleteing the %config file as rpm takes care of this - Changed software group to System Environment/Daemons - Added a nice description - Added %clean * Wed Aug 28 2002 Victor Brilon - First release