2010-10-17 James Choi <[email protected]>
authorjchoi42
Sun, 17 Oct 2010 22:41:39 +0000
changeset 2963 3684b0c23637
parent 2962 64349d6a0519
child 2964 8c1dbc1fc095
2010-10-17 James Choi <[email protected]> * SFEhowl.spec: initial spec * base-specs/howl.spec: initial spec * patches/howl-01-ordering.diff: header order net/if.h * patches/howl-02-ifreq.diff: if_hwaddr depreciated in Solaris * SFEmt-daapd.spec: (aka firefly) Initial spec * base-specs/mt-daapd.spec: initial spec * ext-sources/mt-daapd.spec: SMF manifest by Peter Woodman
ChangeLog
SFEhowl.spec
SFEmt-daapd.spec
base-specs/howl.spec
base-specs/mt-daapd.spec
ext-sources/mt-daapd.xml
patches/howl-01-ordering.diff
patches/howl-02-ifreq.diff
--- a/ChangeLog	Sun Oct 17 16:14:14 2010 +0000
+++ b/ChangeLog	Sun Oct 17 22:41:39 2010 +0000
@@ -1,3 +1,13 @@
+2010-10-17  James Choi  <[email protected]>
+
+	* SFEhowl.spec: initial spec
+	* base-specs/howl.spec: initial spec
+	* patches/howl-01-ordering.diff: header order net/if.h
+	* patches/howl-02-ifreq.diff: if_hwaddr depreciated in Solaris
+	* SFEmt-daapd.spec: (aka firefly) Initial spec
+	* base-specs/mt-daapd.spec: initial spec
+	* ext-sources/mt-daapd.spec: SMF manifest by Peter Woodman
+
 2010-10-17  Albert Lee  <[email protected]>
 
 	* SFEboost-gpp.spec: Remove SUNWicu* dependencies added in error.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SFEhowl.spec	Sun Oct 17 22:41:39 2010 +0000
@@ -0,0 +1,81 @@
+#
+# spec file for package SFEhowl
+#
+# includes module(s): howl
+#
+# # Copyright 2008 Sun Microsystems, Inc.
+# This file and all modifications and additions to the pristine
+# package are under the same license as the package itself.
+#
+%include Solaris.inc
+
+%define cc_is_gcc 1
+%include base.inc
+
+%use howl = howl.spec
+
+Name:                    SFEhowl
+Summary:                 howl - cross-platform implementation of Zeroconf
+Version:                 %{howl.version}
+SUNW_BaseDir:            %{_basedir}
+BuildRoot:               %{_tmppath}/%{name}-%{version}-build
+
+%include default-depend.inc
+Requires: SUNWgnu-dbm
+Requires: SUNWsqlite3
+BuildRequires: SUNWsqlite3
+
+%package devel
+Summary:                 %{summary} - development files
+SUNW_BaseDir:            %{_basedir}
+%include default-depend.inc
+Requires: %name
+
+
+%prep
+rm -rf %name-%version
+mkdir %name-%version
+%howl.prep -d %name-%version
+cd %{_builddir}/%name-%version
+
+%build
+export CC=gcc
+export CXX=g++
+export CXXFLAGS="%{gcc_cxx_optflags}"
+export CFLAGS="%optflags"
+export PKG_CONFIG_PATH="%{_cxx_libdir}/pkgconfig"
+export LDFLAGS="-L%{_cxx_libdir} -R%{_cxx_libdir}"
+export PERL_PATH=/usr/perl5/bin/perl
+%howl.build -d %name-%version
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%howl.install -d %name-%version
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr (-, root, bin)
+%dir %attr (0755, root, bin) %{_bindir}
+%{_bindir}/mDNS*
+%dir %attr (0755, root, bin) %{_cxx_libdir}
+%{_cxx_libdir}/lib*
+%dir %attr (0755, root, bin) %{_mandir}
+%dir %attr (0755, root, bin) %{_mandir}/man8
+%{_mandir}/man8/*
+
+%files devel
+%defattr (-, root, bin)
+%dir %attr (0755, root, sys) %{_datadir}
+%attr (-, root, other) %{_datadir}/howl
+%dir %attr (0755, root, bin) %{_libdir}
+%attr (-, root, other) %{_libdir}/pkgconfig
+%dir %attr (0755, root, bin) %{_includedir}
+%{_includedir}/*
+
+
+%changelog
+* Fri Oct 01 2010 - [email protected]
+- initial spec
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SFEmt-daapd.spec	Sun Oct 17 22:41:39 2010 +0000
@@ -0,0 +1,97 @@
+#
+# spec file for package SFEmt-daapd
+#
+# includes module(s): mt-daapd
+#
+# # Copyright 2008 Sun Microsystems, Inc.
+# This file and all modifications and additions to the pristine
+# package are under the same license as the package itself.
+#
+%include Solaris.inc
+
+%define cc_is_gcc 1
+%include base.inc
+
+%use mtdaapd = mt-daapd.spec
+
+Name:                    SFEmt-daapd
+Summary:                 mt-daapd - firefly media server
+Version:                 %{mtdaapd.version}
+SUNW_BaseDir:            %{_basedir}
+BuildRoot:               %{_tmppath}/%{name}-%{version}-build
+# SMF manifest by Peter Woodman
+# http://shortbus.org/bloggin/2008/10/22/making-a-manifest-for-smf/
+Source1:                 mt-daapd.xml
+ 
+%include default-depend.inc
+Requires: SUNWgnu-dbm
+Requires: SFElibid3tag
+Requires: SFElibmad
+BuildRequires: SUNWgmake
+Requires: SUNWsqlite3
+BuildRequires: SUNWsqlite3
+# mt-daapd ships with an mDNS responder but its reportedly flaky
+# let's use howl :D
+Requires: SFEhowl
+BuildRequires: SFEhowl-devel
+
+%package root
+Summary:                 %{summary} - root files
+SUNW_BaseDir:            /
+%include default-depend.inc
+Requires: %name
+
+
+%prep
+rm -rf %name-%version
+mkdir %name-%version
+%mtdaapd.prep -d %name-%version
+cd %{_builddir}/%name-%version
+
+%build
+export CC=gcc
+export CXX=g++
+export CXXFLAGS="%{gcc_cxx_optflags}"
+export CFLAGS="%optflags -std=c99"
+export PKG_CONFIG_PATH="%{_cxx_libdir}/pkgconfig"
+export LDFLAGS="-L%{_cxx_libdir} -R%{_cxx_libdir}"
+export PERL_PATH=/usr/perl5/bin/perl
+%mtdaapd.build -d %name-%version
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%mtdaapd.install -d %name-%version
+
+# move file in /sbin to /bin
+mv $RPM_BUILD_ROOT/usr/sbin $RPM_BUILD_ROOT/%{_bindir} 
+
+# grab mt-daapd.conf
+mkdir -p $RPM_BUILD_ROOT/etc
+cp %{_builddir}/%name-%version/mt-daapd-%version/contrib/mt-daapd.conf $RPM_BUILD_ROOT/etc
+
+# smf files
+install -d $RPM_BUILD_ROOT/var/svc/manifest/system
+install --mode=0444 %SOURCE1 $RPM_BUILD_ROOT/var/svc/manifest/system
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr (-, root, bin)
+%dir %attr (0755, root, bin) %{_bindir}
+%{_bindir}/*
+%dir %attr (0755, root, sys) %{_datadir}
+%{_datadir}/mt-daapd
+
+%files root
+%defattr (-, root, sys)
+%{_sysconfdir}/mt-daapd.conf
+#%class(manifest) %attr(0444, root, sys)/var/svc/manifest/site/mt-daapd.xml
+%attr (0444, root, sys) /var/svc/manifest/system/mt-daapd.xml
+
+
+%changelog
+* Fri Oct 01 2010 - [email protected]
+- initial spec
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/base-specs/howl.spec	Sun Oct 17 22:41:39 2010 +0000
@@ -0,0 +1,50 @@
+#
+# spec file for package howl
+#
+# Copyright 2008 Sun Microsystems, Inc.
+# This file and all modifications and additions to the pristine
+# package are under the same license as the package itself.
+#
+
+Name:                    howl
+License:        	 GPL
+Group:                   System/Libraries
+Version:                 1.0.0
+Release:                 1
+Distribution:            Java Desktop System
+Vendor:                  Sun Microsystems, Inc.
+Summary:                 howl - mDNS responder daemon
+URL:                     http://www.porchdogsoft.com/products/howl/
+Source:                  http://www.porchdogsoft.com/download/%{name}-%{version}.tar.gz
+Patch1:                  howl-01-ordering.diff
+Patch2:                  howl-02-ifreq.diff
+BuildRoot:               %{_tmppath}/%{name}-%{version}-build
+
+%prep
+%setup -q -n howl-%version
+%patch1 -p1
+%patch2 -p1
+
+%build
+CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
+if test "x$CPUS" = "x" -o $CPUS = 0; then
+    CPUS=1
+fi
+
+./configure --prefix=%{_prefix} --mandir=%{_mandir} \
+            --libdir=%{_cxx_libdir}              \
+            --libexecdir=%{_libexecdir}      \
+            --sysconfdir=%{_sysconfdir} --disable-python
+make -j$CPUS 
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%changelog
+* Fri Oct 01 2010 - [email protected]
+- initial spec
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/base-specs/mt-daapd.spec	Sun Oct 17 22:41:39 2010 +0000
@@ -0,0 +1,49 @@
+#
+# spec file for package mt-daapd
+#
+# Copyright 2008 Sun Microsystems, Inc.
+# This file and all modifications and additions to the pristine
+# package are under the same license as the package itself.
+#
+
+Name:                    mt-daapd
+License:        	 GPL
+Group:                   System/Libraries
+Version:                 0.2.4.2
+Release:                 1
+Distribution:            Java Desktop System
+Vendor:                  Sun Microsystems, Inc.
+Summary:                 %{name} - multithreaded DAAP daemon
+URL:                     http://fireflymediaserver.org
+Source:                  http://sourceforge.net/projects/mt-daapd/files/mt-daapd/%{version}/%{name}-%{version}.tar.gz
+BuildRoot:               %{_tmppath}/%{name}-%{version}-build
+
+
+%prep
+%setup -q -n %name-%version
+
+%build
+CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
+if test "x$CPUS" = "x" -o $CPUS = 0; then
+    CPUS=1
+fi
+
+./configure --prefix=%{_prefix} --mandir=%{_mandir} \
+            --libdir=%{_cxx_libdir}             \
+            --libexecdir=%{_libexecdir}     \
+            --sysconfdir=%{_sysconfdir} \
+            --enable-sqlite3 --disable-mdns \
+            --enable-howl --with-howl-includes=/usr/include/howl
+gmake -j$CPUS 
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%changelog
+* Fri Oct 01 2010 - [email protected]
+- initial spec
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ext-sources/mt-daapd.xml	Sun Oct 17 22:41:39 2010 +0000
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+<service_bundle type="manifest" name="mt-daapd">
+    <service name="network/mt-daapd" type="service" version="1">
+        <dependency name="network" grouping="require_all" restart_on="none" type="service">
+            <service_fmri value="svc:/milestone/network:default"/>
+        </dependency>
+        <exec_method type="method" name="start" exec="/usr/bin/mt-daapd -y -c %{mt-daapd/conffile}" timeout_seconds="10" />
+        <exec_method type="method" name="refresh" exec=":kill -HUP" timeout_seconds="10" />
+        <exec_method type="method" name="stop" exec=":kill" timeout_seconds="10" />
+        <instance name="default" enabled="false">
+            <property_group name='config' type='application'>
+                <propval name='conffile' type='astring' value='/etc/mt-daapd.conf' />
+            </property_group>
+        </instance>
+        <stability value="Evolving"/>
+        <template>
+            <common_name>
+                <loctext xml:lang="C">Firefly Media Server</loctext>
+            </common_name>
+            <documentation>
+                <doc_link name="Firefly Media Server homepage" uri="http://fireflymediaserver.org"/>
+            </documentation>
+        </template>
+    </service>
+</service_bundle>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/howl-01-ordering.diff	Sun Oct 17 22:41:39 2010 +0000
@@ -0,0 +1,15 @@
+--- old/howl-1.0.0/src/lib/howl/Posix/posix_interface.c	Thu Oct 14 02:11:10 2010
++++ howl-1.0.0/src/lib/howl/Posix/posix_interface.c	Thu Oct 14 02:08:15 2010
+@@ -29,11 +29,11 @@
+ #include "posix_interface.h"
+ #include <salt/debug.h>
+ #include <salt/interface.h>
++#include <sys/socket.h>
+ #include <net/if.h> 
+ #include <arpa/inet.h>
+ #include <errno.h>
+ #include <sys/ioctl.h>
+-#include <sys/socket.h>
+ #include <stdio.h>
+ 
+ #if defined(__linux__)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/howl-02-ifreq.diff	Sun Oct 17 22:41:39 2010 +0000
@@ -0,0 +1,39 @@
+--- old/howl-1.0.0/src/lib/howl/Posix/posix_interface.c	2010-10-14 17:43:29.366790584 -0400
++++ howl-1.0.0/src/lib/howl/Posix/posix_interface.c	2010-10-14 17:45:57.048458250 -0400
+@@ -367,17 +367,10 @@
+ 	sw_debug(SW_LOG_VERBOSE, "got ip address: %s\n", tmpname);
+ 
+ 	/* mac address */
+-#if defined(SIOCGIFHWADDR)
+-	res = ioctl(sock, SIOCGIFHWADDR, &ifr);
+-	err = sw_translate_error(res == 0, errno);
+-	sw_check_okay_log(err, exit);
+-	sw_memcpy(nif->m_super.m_mac_address.m_id, (sw_uint8*)(ifr.ifr_hwaddr.sa_data), sizeof(sw_mac_address)); 
+-#elif defined(SIOCGENADDR)
+ 	res = ioctl(sock, SIOCGENADDR, &ifr);
+ 	err = sw_translate_error(res == 0, errno);
+ 	sw_check_okay_log(err, exit);
+ 	sw_memcpy(nif->m_super.m_mac_address.m_id, (sw_uint8*)(ifr.ifr_ifru.ifru_enaddr), sizeof(sw_mac_address)); 
+-#endif
+ 
+ 	/* index */
+ 	nif->m_super.m_index = if_nametoindex(ifr.ifr_name);
+@@ -436,18 +429,10 @@
+ 	sw_ipv4_address_init_from_saddr(&(nif->m_super.m_netmask), ((struct sockaddr_in*) &ifr->ifr_addr )->sin_addr.s_addr );
+ #endif
+ 
+-#if defined(SIOCGIFHWADDR)
+-	/* mac address */
+-	res = ioctl(sock, SIOCGIFHWADDR, ifr);
+-	err = sw_translate_error(res != -1, errno);
+-	sw_check_okay_log(err, exit);
+-	sw_memcpy(nif->m_super.m_mac_address.m_id, (sw_uint8*)(ifr->ifr_hwaddr.sa_data), sizeof(sw_mac_address)); 
+-#elif defined(SIOCGENADDR)
+ 	res = ioctl(sock, SIOCGENADDR, ifr);
+ 	err = sw_translate_error(res != -1, errno);
+ 	sw_check_okay_log(err, exit);
+ 	sw_memcpy(nif->m_super.m_mac_address.m_id, (sw_uint8*)(ifr->ifr_ifru.ifru_enaddr), sizeof(sw_mac_address)); 
+-#endif
+ 
+ 	/* initialize link status field */
+ 	sw_network_interface_link_status(&nif->m_super, &(nif->m_super.m_linked));