%define name madsonic %define version 5.0.3760 %define release 1 %define __os_install_post \ /usr/lib/rpm/brp-compress \ /usr/lib/rpm/brp-strip \ /usr/lib/rpm/brp-strip-static-archive \ echo "not /usr/lib/rpm/brp-strip-comment-note" \ %{nil} Name: %{name} Version: %{version} Release: %{release}%{?dist} Summary: A web-based music streamer, jukebox and Podcast receiver Source: %{name}-%{version}.tar.gz BuildRoot: /var/tmp/%{name}-%{version}-buildroot BuildArch: noarch BuildRequires: e-smith-devtools AutoReqProv: no Group: Applications/Multimedia License: GPLv3 URL: http://madsonic.org %changelog * Sun Nov 17 2013 JP Pialasse 5.0.3760-1.sme - first build for sme - adding noarch - adding e-smith-devtools %description Madsonic is a web-based music streamer, fork of Subsonic, jukebox and Podcast receiver, providing access to your music collection wherever you are. Use it to share your music with friends, or to listen to your music while away from home. Apps for Android, iPhone and Windows Phone are also available. Java 1.6 or higher is required to run Madsonic. %prep %setup %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 \ | grep -v "/etc/sysconfig/madsonic" \ | grep -v "/etc/init.d$" \ | grep -v "/etc/sysconfig$"\ > %{name}-%{version}-filelist %clean rm -rf $RPM_BUILD_ROOT %files -f %{name}-%{version}-filelist %defattr(-,root,root) %config(noreplace) /etc/sysconfig/madsonic %pre # Stop Madsonic service. if [ -e /etc/init.d/madsonic ]; then service madsonic stop fi # Backup database. if [ -e /var/madsonic/db ]; then rm -rf /var/madsonic/db.backup cp -R /var/madsonic/db /var/madsonic/db.backup fi exit 0 %post ln -sf /usr/share/madsonic/madsonic.sh /usr/bin/madsonic chmod 750 /var/madsonic # Clear jetty cache. rm -rf /var/madsonic/jetty # For SELinux: Set security context chcon -t java_exec_t /etc/init.d/madsonic 2>/dev/null # Configure and start Madsonic service. chkconfig --add madsonic service madsonic start exit 0 %preun # Only do it if uninstalling, not upgrading. if [ $1 = 0 ] ; then # Stop the service. [ -e /etc/init.d/madsonic ] && service madsonic stop # Remove symlink. rm -f /usr/bin/madsonic # Remove startup scripts. chkconfig --del madsonic fi exit 0