LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File mjpegtools.spec of Package mjpegtools (Project home:mvaldina)

#
# spec file for package mjpegtools
#
# Copyright (c) 2017 SUSE LINUX 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
Source2:        baselibs.conf
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
Patch8:         mjpegtools-2.0.0-fix-bashisms.patch
Patch9:         mjpegtools-more-pie.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) >= 1.4
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.

# This package lives on 3rd party instances
%package orig-addon
Summary:        MJPEG Video Capture and Processing Tools - Patented encoders
Group:          Productivity/Multimedia/Video/Editors and Convertors
# If a user has the 3rd party repo enabled and has mjpegutils installed,
# we trigger a recommended installation of the orig-addon package, completing
# the installation.
Supplements:    %{name}
Requires:       %{name}

%description orig-addon
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.

This package contains the binaries that cannot be shipped as part of the
distro repositories due to legal constraints.

%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 libmpeg2encpp-2_0-0
Summary:        MJPEG Video Capture and Processing Tools
Group:          System/Libraries

%description -n libmpeg2encpp-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}
%if 0%{?BUILD_ORIG}
Requires:       libmpeg2encpp-2_0-0 = %{version}
%endif
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
%patch8 -p1
%patch9 -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}

%preun
%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}/*
# Exclude files only present when using BUILD_ORIG
%if 0%{?BUILD_ORIG}
%exclude %{_bindir}/lav2mpeg
%exclude %{_bindir}/mp2enc
%exclude %{_bindir}/mpeg2enc
%exclude %{_bindir}/mpegtranscode
%endif
%{_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}/liblavfile-%{lib_version}.so.*
%{_libdir}/liblavjpeg-%{lib_version}.so.*
%{_libdir}/liblavplay-%{lib_version}.so.*
%{_libdir}/liblavrec-%{lib_version}.so.*
%{_libdir}/libmjpegutils-%{lib_version}.so.*
%{_libdir}/libmplex2-%{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

%if 0%{?BUILD_ORIG}
%files orig-addon
%defattr(-,root,root)
%attr(0755,root,root) %{_bindir}/lav2mpeg
%attr(0755,root,root) %{_bindir}/mp2enc
%attr(0755,root,root) %{_bindir}/mpeg2enc
%attr(0755,root,root) %{_bindir}/mpegtranscode

%files -n libmpeg2encpp-2_0-0
%defattr(-,root,root)
%{_libdir}/libmpeg2encpp-%{lib_version}.so.*
%endif

%changelog