File mjpegtools.spec of Package mjpegtools

#
# spec file for package mjpegtools
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           mjpegtools
BuildRequires:  SDL-devel gcc-c++ libjpeg-devel libpng-devel libquicktime-devel nasm
#BuildRequires:  gtk1-compat-devel
#BuildRequires:  libmovtar popt-devel
Url:            http://mjpeg.sourceforge.net/
License:        BSD3c(or similar) ; GPLv2+
Group:          Productivity/Multimedia/Video/Editors and Convertors
PreReq:         %install_info_prereq
AutoReqProv:    on
Version:        1.9.0
Release:        12
Summary:        MJPEG Video Capture and Processing Tools
%if 0%{?BUILD_ORIG}
Source0:        %{name}-%{version}.tar.bz2
%else
# WARNING: This is not a comment, but a real command to repack souce:
#%(sh %{_sourcedir}/%{name}-codecpatch.sh %{_sourcedir} %{name}-%{version}.tar.bz2 %{name}-%{version}-patched.tar.bz2 )
Source0:        %{name}-%{version}-patched.tar.bz2
%endif
Source1:        mjpegtools-codecpatch.sh
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Patch0:         mjpegtools-cpuinfo.patch
Patch4:         mjpegtools-vector_alignment.patch
Patch5:         mjpegtools-getopt.patch
Patch6:         mjpegtools-writeable_strings.patch
Patch7:         mjpegtools-fix-invalid-conversion.patch
Patch8:         mjpegtools-1.9.0-fix-compiler-error.patch
Patch9:         mjpegtools-jpeg-7.patch
Patch100:       %{name}-codecpatch.patch

%description
The mjpegtools allow for capture, playback, processing, and simple
editing of MJPEG AV data. The hardware I/O applications are intended
for use with Zoran MJPEG framegrabber-based hardware (see the
zoran-driver package), but the processing tools can be used with MJPEG
data from other sources as well.



Authors:
--------
    Gernot Ziegler <gz@lysator.liu.se>
    Rainer Johanni <rainer@johanni.de>
    Andrew Stevens <Andrew.Stevens@comlab.ox.ac.uk>
    Xavier Biquard
    Ronald Bultje

%package devel
License:        BSD3c(or similar) ; GPLv2+
Group:          Productivity/Multimedia/Video/Editors and Convertors
Summary:        MJPEG Video Capture and Processing Tools
Requires:       %{name} = %{version}
Requires:       SDL-devel glibc-devel zlib-devel libdv-devel libjpeg-devel libquicktime-devel 

%description devel
The mjpegtools allow for capture, playback, processing, and simple
editing of MJPEG AV data. The hardware I/O applications are intended
for use with Zoran MJPEG framegrabber-based hardware (see the
zoran-driver package), but the processing tools can be used with MJPEG
data from other sources as well.



Authors:
--------
    Gernot Ziegler <gz@lysator.liu.se>
    Rainer Johanni <rainer@johanni.de>
    Andrew Stevens <Andrew.Stevens@comlab.ox.ac.uk>
    Xavier Biquard
    Ronald Bultje

%prep
%setup -q
%patch0
%if 0%{?BUILD_ORIG}
%patch4 -p1
%endif
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%if ! 0%{?BUILD_ORIG}
# remove references to files removed by %{name}-codecpatch.sh
%patch100 -p1
%endif
# overwrite cpuinfo.sh, cpu optimization does not make sense
# when building for a distribution
echo "" > cpuinfo.sh

%build
%if 0%{?BUILD_ORIG}
sed -i~ '/currently broken/d' mpeg2enc/mpeg2enc.cc
diff -u mpeg2enc/mpeg2enc.cc* || :
%endif
%ifarch %ix86
  export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
%else
  export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fPIC"
%endif
export CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
autoreconf -vfi
# disable linking against libmpeg2encpp on ppc architectures
./configure \
%ifarch ppc ppc64
    --disable-simd-accel \
%endif
    --prefix=%{_prefix} \
    --libdir=%{_libdir} \
    --mandir=%{_mandir} \
    --infodir=%{_infodir} \
    --disable-warnings_as_errors \
    --disable-static
#	--with-quicktime=/usr/include/quicktime \
#	--with-dv=/usr \
%{__make} %{?jobs:-j%jobs}

%install
make DESTDIR=%{buildroot} install
rm -f %{buildroot}/usr/share/info/dir
# remove mpeg encoding
%if ! 0%{?BUILD_ORIG}
for app in lav2mpeg mp2enc mpeg2enc mpegtranscode; do
    rm -f %{buildroot}%{_bindir}/${app}
    rm -f %{buildroot}%{_mandir}/man1/${app}.*
done
%endif

%clean
rm -rf "%{buildroot}"

%post
%install_info --info-dir=%{_infodir} %{_infodir}/mjpeg-howto.info.gz
/sbin/ldconfig

%postun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/mjpeg-howto.info.gz
/sbin/ldconfig

%files
%defattr(-,root,root)
%doc AUTHORS CHANGES COPYING ChangeLog HINTS README*
%{_bindir}/*
%{_libdir}/lib*.so.*
%doc %{_mandir}/man1/*.1.gz
%doc %{_mandir}/man5/*.5.gz
%doc %{_infodir}/mjpeg-howto*

%files devel
%defattr(-,root,root)
%{_includedir}/mjpegtools
%{_libdir}/lib*.so
%{_libdir}/lib*.la
%{_libdir}/pkgconfig/mjpegtools.pc

%changelog
openSUSE Build Service is sponsored by