File mjpegtools.spec of Package mjpegtools

#
# spec file for package mjpegtools
#
# Copyright (c) 2013 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/
#


Name:           mjpegtools
Version:        2.0.0
Release:        0
Summary:        MJPEG Video Capture and Processing Tools
License:        GPL-2.0
Group:          Productivity/Multimedia/Video/Editors and Convertors
Url:            http://mjpeg.sourceforge.net/
%if 0%{?BUILD_ORIG}
Source0:        http://sourceforge.net/projects/mjpeg/files/mjpegtools/%{version}/mjpegtools-%{version}.tar.gz
%else
# WARNING: This is not a comment, but a real command to repack souce:
#%(sh %{_sourcedir}/mjpegtools-codecpatch.sh %{_sourcedir} mjpegtools-%{version}.tar.gz mjpegtools-%{version}-patched.tar.gz )
Source0:        %{name}-%{version}-patched.tar.gz
%endif
Source1:        mjpegtools-codecpatch.sh
Patch0:         mjpegtools-cpuinfo.patch
Patch1:         mjpegtools-vector_alignment.patch
Patch2:         mjpegtools-getopt.patch
Patch3:         mjpegtools-writeable_strings.patch
Patch4:         mjpegtools-no_arch_tuning.patch
Patch5:         mjpegtools-config_h.patch
Patch6:         mjpegtools-v4l-2.6.38.patch
Patch7:         mjpegtools-gcc47.patch
Patch100:       mjpegtools-codecpatch.patch
BuildRequires:  gcc-c++
BuildRequires:  libjpeg-devel
BuildRequires:  libtool
BuildRequires:  pkg-config
BuildRequires:  pkgconfig(gdk-x11-2.0)
BuildRequires:  pkgconfig(gobject-2.0)
BuildRequires:  pkgconfig(gtk+-x11-2.0)
BuildRequires:  pkgconfig(libdv)
BuildRequires:  pkgconfig(libpng)
BuildRequires:  pkgconfig(libquicktime)
%if 0%{?suse_version} >= 1210
BuildRequires:  pkgconfig(libv4l1)
%endif
BuildRequires:  pkgconfig(SDL_gfx)
BuildRequires:  pkgconfig(sdl)
Requires(post):  info
Requires(preun): info

%define lib_version %(echo %{version} | cut -d. -f1-2)

%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.

%package -n libmjpegutils-2_0-0
Summary:        MJPEG Video Capture and Processing Tools
Group:          System/Libraries

%description -n libmjpegutils-2_0-0
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.

%package -n libmjpegutils-devel
Summary:        MJPEG Video Capture and Processing Tools
Group:          Development/Libraries/C and C++
Requires:       libmjpegutils-2_0-0 = %{version}
Provides:       mjpegtools-devel = %{version}
Obsoletes:      mjpegtools-devel < %{version}

%description -n libmjpegutils-devel
This package contains all files needed to develop code that uses the
mjpegtools libraries.

%prep
%setup -q
%patch0
%if 0%{?BUILD_ORIG}
%patch1
%endif
%patch2 -p1
%patch3 -p1
%patch4
%patch5
%if 0%{?suse_version} >= 1210
%patch6
%endif
%patch7 -p1
%if ! 0%{?BUILD_ORIG}
# remove references to files removed by %%{name}-codecpatch.sh
%patch100
%endif

%build
%if 0%{?BUILD_ORIG}
sed -i~ '/currently broken/d' mpeg2enc/mpeg2enc.cc
diff -u mpeg2enc/mpeg2enc.cc* || :
%endif
autoreconf -vfi
EXTRAOPTS=""
%ifarch ppc ppc64
EXTRAOPTS="--disable-simd-accel"
%endif
%configure --disable-static --disable-arch_tuning $EXTRAOPTS
make %{?_smp_mflags}

%install
%make_install
# 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
rm %{buildroot}%{_libdir}/lib*.la

%post
%install_info --info-dir=%{_infodir} %{_infodir}/mjpeg-howto.info%{ext_info}

%postun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/mjpeg-howto.info%{ext_info}

%post -n libmjpegutils-2_0-0 -p /sbin/ldconfig

%postun -n libmjpegutils-2_0-0 -p /sbin/ldconfig

%files
%defattr(0644, root, root, 0755)
%attr(0755,root,root) %{_bindir}/*
%{_mandir}/man1/*.1%{ext_man}
%{_mandir}/man5/*.5%{ext_man}
%{_infodir}/mjpeg-howto.info%{ext_info}

%files -n libmjpegutils-2_0-0
%defattr(0644, root, root, 0755)
%doc AUTHORS BUGS CHANGES COPYING HINTS NEWS PLANS README* TODO
%{_libdir}/lib*-%{lib_version}.so.*

%files -n libmjpegutils-devel
%defattr(0644, root, root, 0755)
%{_includedir}/mjpegtools/
%{_libdir}/liblavfile.so
%{_libdir}/liblavjpeg.so
%{_libdir}/liblavplay.so
%{_libdir}/liblavrec.so
%{_libdir}/libmjpegutils.so
%if 0%{?BUILD_ORIG}
%{_libdir}/libmpeg2encpp.so
%endif
%{_libdir}/libmplex2.so
%{_libdir}/pkgconfig/mjpegtools.pc

%changelog
openSUSE Build Service is sponsored by