SUNWpulseaudio.spec revision 20837
#
# spec file for package SUNWpulseaudio
#
# includes module(s): pulseaudio
#
# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# bugdb: www.pulseaudio.org/report/
#
# Note that PulseAudio has build and runtime requirements on the newer version
# 2.2.6b of libtool, so this module builds and uses its own private copy. This
# should be removed when libtool is updated in Solaris to a newer version.
#
%include Solaris.inc
%include base.inc
%define src_name pulseaudio
%define src_url http://freedesktop.org/software/pulseaudio/releases
%define SFElibsndfile %(/usr/bin/pkginfo -q SFElibsndfile && echo 1 || echo 0)
Name: SUNWpulseaudio
IPS_package_name: library/audio/gstreamer
Meta(info.classification): %{classification_prefix}:System/Multimedia Libraries
Summary: pulseaudio - stream audio to clients
Version: 0.99.4
Source: %{src_url}/%{src_name}-%{version}.tar.gz
Source1: libtool-2.2.6b.tar.gz
# date:2011-09-27 owner:yippi type:bug bugid:254
Patch1: pulseaudio-01-esdcompat.diff
# This patch is very rough, but gets the code to compile.
# date:2011-09-27 owner:yippi type:bug
Patch2: pulseaudio-02-solaris.diff
# date:2011-09-27 owner:yippi type:bug
Patch3: pulseaudio-03-libtool.diff
SUNW_BaseDir: %{_basedir}
SUNW_Copyright: %{name}.copyright
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%include default-depend.inc
Requires: SUNWlibgc
Requires: SUNWjson-c
BuildRequires: SUNWlibgc-devel
BUildRequires: SUNWjson-c-devel
#TODO are dependencies complete?
%if %SFElibsndfile
BuildRequires: SFElibsndfile-devel
Requires: SFElibsndfile
%else
BuildRequires: SUNWlibsndfile
Requires: SUNWlibsndfile
%endif
BuildRequires: SUNWliboil-devel
BuildRequires: SUNWlibsamplerate-devel
Requires: SUNWliboil
Requires: SUNWlibsamplerate
%package devel
Summary: %{summary} - development files
SUNW_BaseDir: %{_basedir}
%include default-depend.inc
Requires: %name
%package root
Summary: %{summary} - / filesystem
SUNW_BaseDir: /
%include default-depend.inc
%if %build_l10n
%package l10n
IPS_package_name: system/display-manager/gdm/l10n
Summary: %{summary} - l10n files
SUNW_BaseDir(relocate_from:%{_prefix}): %{_gnome_il10n_basedir}
%include default-depend.inc
Requires: %{name}
%endif
%prep
%setup -q -n %{src_name}-%{version}
%patch1 -p1
%patch2 -p1
perl -pi -e 's,/bin/sh,/bin/ksh,' src/daemon/esdcompat.in
# Build libtool, with patch.
gzcat %SOURCE1 | tar xf -
%patch3 -p0
%build
# There seems to be an issue with the version of libtool that GStreamer is
# now using. The libtool script uses the echo and RM variables but does not
# define them, so setting them here addresses this.
export echo="/usr/bin/echo"
export RM="/usr/bin/rm -f"
CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
if test "x$CPUS" = "x" -o $CPUS = 0; then
CPUS=1
fi
# Build newer libtool that PulseAudio needs. This should be removed when
# libtool is updated.
#
cd libtool-2.2.6b
./configure \
--prefix=%{_prefix} \
--infodir=%{_infodir}
make -j$CPUS
/usr/bin/rm %{_builddir}/pulseaudio-%version/libtool-2.2.6b/libltdl/.libs/*.a
/usr/bin/rm %{_builddir}/pulseaudio-%version/libtool-2.2.6b/libltdl/.libs/*.la
# Now build PulseAudio
#
cd ..
export CPPFLAGS="-xc99 -I%{_builddir}/pulseaudio-%version/libtool-2.2.6b/libltdl"
export CFLAGS="%optflags -xc99 -I%{_builddir}/pulseaudio-%version/libtool-2.2.6b/libltdl"
# Set LD_LIBRARY_PATH so the new version of libtool gets used.
export LD_LIBRARY_PATH="%{_builddir}/pulseaudio-%version/libtool-2.2.6b/libltdl/.libs"
# Need to add -Wl,-z,now and -Wl,-z-nodelete and remove -Wl,-zignore for
# PulseAudio to build.
#
%if %debug_build
export LDFLAGS="-Wl,-z,now -Wl,-z,nodelete -R/usr/lib/pulse-0.99 -L%{_builddir}/pulseaudio-%version/libtool-2.2.6b/libltdl/.libs %{_builddir}/pulseaudio-%version/libtool-2.2.6b/libltdl/.libs/libltdl.so -lxnet -lsocket -lgobject-2.0"
%else
export LDFLAGS="-Wl,-zcombreloc -Wl,-Bdirect -Wl,-z,now -Wl,-z,nodelete -R/usr/lib/pulse-0.99 -L%{_builddir}/pulseaudio-%version/libtool-2.2.6b/libltdl/.libs %{_builddir}/pulseaudio-%version/libtool-2.2.6b/libltdl/.libs/libltdl.so -lxnet -lsocket -lgobject-2.0"
%endif
autoreconf --force --install
./configure --prefix=%{_prefix} \
--mandir=%{_mandir} \
--bindir=%{_bindir} \
--libdir=%{_libdir} \
--libexecdir=%{_libexecdir} \
--sysconfdir=%{_sysconfdir} \
--disable-gconf
make -j$CPUS
%install
# There seems to be an issue with the version of libtool that GStreamer is
# now using. The libtool script uses the echo and RM variables but does not
# define them, so setting them here addresses this.
export echo="/usr/bin/echo"
export RM="/usr/bin/rm -f"
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT%{_libdir}/ -name "*.a" -exec rm {} \; -print -o -name "*.la" -exec rm {} \; -print
cp %{_builddir}/pulseaudio-%version/libtool-2.2.6b/libltdl/.libs/libltdl.so $RPM_BUILD_ROOT%{_libdir}/pulse-0.99
%if %build_l10n
%else
# REMOVE l10n FILES
rm -rf $RPM_BUILD_ROOT%{_datadir}/locale
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr (-, root, bin)
%dir %attr (0755, root, bin) %{_bindir}
%{_bindir}/*
%dir %attr (0755, root, bin) %{_libdir}
%{_libexecdir}/pulse*
%{_libdir}/lib*.so*
%dir %attr (0755, root, sys) %{_datadir}
%{_datadir}/vala
%dir %attr(0755, root, bin) %{_mandir}
%dir %attr(0755, root, bin) %{_mandir}/man1
%{_mandir}/man1/*
%{_mandir}/man5/*
%files devel
%defattr (-, root, bin)
%{_includedir}
%dir %attr (0755, root, bin) %{_libdir}
%dir %attr (0755, root, other) %{_libdir}/pkgconfig
%{_libdir}/pkgconfig/*
%files root
%defattr (-, root, sys)
%attr (0755, root, sys) %dir %{_sysconfdir}
%attr (0755, root, sys) %dir %{_sysconfdir}/pulse
%{_sysconfdir}/pulse/*
%{_sysconfdir}/xdg
%dir %attr (0755, root, bin) /lib
/lib/udev
%if %build_l10n
%files l10n
%defattr (-, root, bin)
%dir %attr (0755, root, sys) %{_datadir}
%dir %attr (0755, root, other) %{_datadir}/gnome
%attr (-, root, other) %{_datadir}/locale
%{_datadir}/gnome/*help/*/[a-z]*
%{_datadir}/omf/gdm/*-[a-z]*.omf
%endif
%changelog
* Tue Sep 28 2011 - Brian Cameron
- Initial spec with version 0.99.4.