Blob Blame History Raw
# Nb: this is temporary. Broadcom is working on getting the firmware released
# under a redistributable, no-modification license.
%define with_firmware %{?_with_firmware: 1} %{?!_with_firmware: 0}

Summary:        Broadcom Crystal HD device interface library
Name:           libcrystalhd
Version:        0.9.25
Release:        2%{?dist}
License:        LGPLv2
Group:          System Environment/Libraries
%if %{with_firmware}
Source:         http://www.broadcom.com/docs/support/crystalhd/crystalhd_linux_20091229.zip
Requires:       crystalhd-firmware
%else
# The source archive contains a firmware image that doesn't yet have an
# acceptable license for redistribution, so we unpack, strip it, and repack the archive.
Source:         %{name}-%{version}.tar.bz2
%endif
URL:            http://www.broadcom.com/support/crystal_hd/
Patch:          libcrystalhd-updates.patch
ExcludeArch:    s390 s390x
BuildRequires:  autoconf automake

%description
The libcrystalhd library provides userspace access to Broadcom Crystal HD
video decoder devices. The device supports hardware decoding of MPEG-2,
h.264 and VC1 video codecs, up to 1080p at 40fps.

%package devel
Summary:       Development libs for libcrystalhd
Group:         Development/Libraries
Requires:      %{name} = %{version}-%{release}

%description devel
Development libraries needed to build applications against libcrystalhd.

%if %{with_firmware}
%package -n crystalhd-firmware
Summary:       Firmware for the Broadcom Crystal HD video decoder
License:       Redistributable, no modification permitted
BuildArch:     noarch
Group:         System Environment/Kernel
Requires:      %{name} = %{version}-%{release}

%description -n crystalhd-firmware
Firmware for the Broadcom Crystal HD (bcm970012) video decoder.
%endif

%prep
%if %{with_firmware}
%setup -q -n crystalhd
%else
%setup -q
%endif
%patch -p1

%build
%if !%{with_firmware}
sed -i -e 's|cp $(ROOTDIR)/firmware/fwbin/70012/bcm70012fw.bin $(DESTDIR)/lib/firmware/|#cp $(ROOTDIR)/firmware/fwbin/70012/bcm70012fw.bin $(DESTDIR)/lib/firmware/|g' linux_lib/libcrystalhd/Makefile
%endif
pushd linux_lib/libcrystalhd/ > /dev/null 2>&1
# FIXME: this doesn't work just yet...
#make CPPFLAGS="%{optflags}" %{?_smp_mflags}
make %{?_smp_mflags}
popd > /dev/null 2>&1

%install
rm -rf $RPM_BUILD_ROOT
pushd linux_lib/libcrystalhd/ > /dev/null 2>&1
make install LIBDIR=%{_libdir} DESTDIR=$RPM_BUILD_ROOT
popd > /dev/null 2>&1

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,0755)
%{_libdir}/libcrystalhd.so.*

%files devel
%defattr(-,root,root,0755)
%dir %{_includedir}/libcrystalhd
%{_includedir}/libcrystalhd/*
%{_libdir}/libcrystalhd.so

%if %{with_firmware}
%files -n crystalhd-firmware
%defattr(-,root,root,0755)
/lib/firmware/bcm70012fw.bin
%endif


%changelog
* Thu Mar 11 2010 Jarod Wilson <jarod@redhat.com> - 0.9.25-2
- Minor fixups to the as-yet-not-enabled firmware sub-package

* Wed Jan 06 2010 Jarod Wilson <jarod@redhat.com> - 0.9.25-1
- Initial package