File avifile.spec of Package avifile

#
# spec file for package avifile (Version 0.7.43)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

Name:           avifile
BuildRequires:  SDL-devel freetype2-devel gcc-c++ libdrm-devel libjpeg-devel libogg-devel libvorbis-devel pkgconfig qt3-devel update-desktop-files xorg-x11
# WARNING: can use xvid or divx4linux, but xvid isn't distributable.
%define DISTRIBUTABLE 1
%if ! %DISTRIBUTABLE
BuildRequires:  mad-devel
%endif
%define prefix   /usr
Summary:        AVI File Support Library
Version:        0.7.43
Release:        101
License:        GPL v2 or later
Group:          System/Libraries
Source:         avifile-0.7-%{version}.tar.bz2
Source2:        README.SuSE
%if ! %DISTRIBUTABLE
#Source3:        binaries-011002.tar.bz2
#Source4:        Win32_dmo.tar.bz2
%endif
Patch:          avifile-0.7.41-cripple.diff
Patch3:         avifile-0.7.3-20020419-am.dif
Patch4:         avifile-0.7-0.7.38-libdir.patch
Patch6:         avifile-0.7.29-20030204.patch
Patch7:         avifile0.7-0.7.29-user_desc.dif
Patch8:         avifile-0.7-0.7.38-x86_64.patch
Patch9:         fix-asm.dif
Patch10:        avifile-0.7-0.7.43-omit-frame.patch
Patch11:        avifile-0.7-0.7.41-alpha.patch
Patch12:        avifile-0.7-0.7.38-mad.patch
Patch13:        avifile-0.7-0.7.38-s390.patch
Patch15:        avifile-0.7-0.7.38-nonvoid.patch
Patch16:        avifile-0.7-0.7.38-nostrictaliasing.patch
Patch17:        avifile-0.7-0.7.38-acinclude.patch
Patch19:        avifile-0.7-0.7.43-a52bin.patch
Patch20:        avifile-0.7-0.7.41-gcc4.patch
Patch21:        avifile-0.7-0.7.4-explicit_qualification.patch
Patch22:        avifile-0.7-0.7.41-FP_constants.patch
Patch23:        avifile-0.7-0.7.43-codecleanup.patch
Patch24:        avifile-0.7-0.7.43-am-flags.patch
Patch25:        avifile-gcc41.patch
Patch26:        ffmpeg-fixes.patch
Patch27:        avifile-0.7-0.7.43-makefile.patch
Patch28:        avifile-0.7-0.7.43-ccasflags.patch
Patch29:        avifile-0.7-0.7.43-avm_map.patch
Patch30:        avifile-0.7-0.7.43-same-variable-used-twice.patch 
Patch31:        avifile-0.7-0.7.43-XF86DGAGetVideoLL.patch
Suggests:       a52dec
Url:            http://avifile.sourceforge.net/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
NoSource:       0
#NoSource:       3
#NoSource:       4

%description
The Avifile library allows programs to read and write compressed AVI
files under Linux. Compression and decompression is performed with
native codecs or (on x86 machines) Win32 DLLs.

Authors:
--------
    Eugene Smith <divx@euro.ru>

%package devel
Summary:        AVI File Support Library
Group:          System/Libraries
Requires:       %{name} = %{version} %{name}-qt = %{version} aalib-devel qt3-devel glibc-devel %(rpm -q --whatprovides XFree86-devel --queryformat '%{NAME}') SDL-devel libstdc++-devel

%description devel
The Avifile library allows programs to read and write compressed AVI
files under Linux. (De)compression is performed with native codecs or
(on x86 machines) Win32 DLLs.

Authors:
--------
    Eugene Smith <divx@euro.ru>

%package qt
Summary:        Qt-based AVI utilities
Group:          Productivity/Multimedia/Video/Players

%description qt
Three small Qt-based utilities for work with AVI files: AVI player,
video capture utility and AVI recompressor.

Authors:
--------
    Eugene Smith <divx@euro.ru>

%prep
#setup -q -a 3 -a 4 -n %name-0.7-%version
%setup -q -n %name-0.7-%version
%if %DISTRIBUTABLE
%patch -p1
%endif
%patch3
%patch4 -p1
%patch6 -p1
%patch7
%patch8
%patch9 -p1
%patch10
%patch11
%patch12
%patch13
%patch15
%patch16
%patch17
%patch19 -p1
%patch20
%patch21
%patch22
%patch23
%patch24
%patch25
%patch26
%patch27
%patch28
%patch29
%patch30 -p1
%patch31
cp  %{_sourcedir}/README.SuSE .
cp -a configure.in configure.ac

%build
export QTDIR=/usr/%_lib/qt3/%_lib
touch NEWS AUTHORS plugins/libmad/libmad/NEWS plugins/libmad/libmad/README plugins/libmad/libmad/AUTHORS plugins/libmad/libmad/ChangeLog
libtoolize --force
autoreconf --force --install
# FIXME: ac3passthrough and mga cannot be force-compiled, if hardware is not present.
# Force-disable them to make resulting binary independent on build host.
COMPFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fno-unit-at-a-time"
ac_cv_val_HAVE_LRINTF=yes \
CXXFLAGS="$COMPFLAGS -fpermissive" \
CFLAGS="$COMPFLAGS" \
./configure --prefix=%prefix --libdir=%_libdir --mandir=%_mandir \
   --enable-release --enable-quiet \
%ifarch %ix86 
   --enable-x86opts \
   --enable-win32 \
%endif
   --disable-ac3passthrough \
   --disable-mga \
%if %DISTRIBUTABLE
   --disable-lame \
   --enable-lame-bin \
   --disable-a52 \
   --disable-ffmpeg-a52 \
   --disable-ffmpeg-divx \
   --enable-ffmpeg-a52bin \
   --disable-ffmpeg-risky \
   --disable-divx \
   --disable-divx4 \
   --enable-divxbin \
   --disable-vidix
%endif
# Work around bug #50763.
make 2>&1 | tee make.log
if grep "ffv1\.c:.*: internal compiler error" make.log ; then
    echo "Internal compiler error, will try failed build again with -O2."
    cd ffmpeg/libavcodec
    make -k || true
    sed -i s/-O4/-O2/g Makefile
    make
    cd ../..
    make
fi

%install
mkdir -p $RPM_BUILD_ROOT/usr/lib/win32
%ifarch %ix86
%if %DISTRIBUTABLE
%else
cp -a win32/* $RPM_BUILD_ROOT/usr/lib/win32
cp -a Win32_dmo/* $RPM_BUILD_ROOT/usr/lib/win32
%endif
%endif
make DESTDIR=$RPM_BUILD_ROOT install
rmdir $RPM_BUILD_ROOT/usr/%_lib/avifile*/vidix
rm $RPM_BUILD_ROOT/usr/%_lib/avifile-0.7/*.*a

%clean
rm -rf $RPM_BUILD_ROOT

%post
%run_ldconfig

%postun
%run_ldconfig

%post qt
%run_ldconfig

%postun qt
%run_ldconfig

%files
%defattr(-, root, root)
%doc README COPYING ChangeLog doc/CREDITS doc/KNOWN_BUGS doc/LICENSING doc/EXCEPTIONS doc/README-DEVEL doc/TODO doc/VIDEO-PERFORMANCE doc/WARNINGS
%doc README.SuSE
%_libdir/lib[^q]*.so.*
%_libdir/avifile-0.7
%{prefix}/bin/avibench
%ifarch %ix86
%dir %{prefix}/lib/win32
%if %DISTRIBUTABLE
%else
%{prefix}/lib/win32/*
%endif
%endif
%{prefix}/bin/avicat
%{prefix}/bin/avimake
%{prefix}/bin/avirec
%{prefix}/bin/avitype
%{prefix}/share/aclocal/avifile.m4
%_libdir/pkgconfig/*.pc
%_mandir/man1/avibench.1*
%_mandir/man1/avicat.1*
%_mandir/man1/avifile-config.1*
%_mandir/man1/avimake.1*
%_mandir/man1/avirec.1*
%_mandir/man1/avitype.1*

%files devel
%defattr(-, root, root)
%{prefix}/bin/avifile-config
%{prefix}/include/avifile-0.7
%_libdir/lib*.*a
%_libdir/lib*.so

%files qt
%defattr(-, root, root)
%_libdir/libq*.so.*
%{prefix}/bin/aviplay
%{prefix}/bin/avicap
%{prefix}/bin/avirecompress
%{prefix}/bin/kv4lsetup
%{prefix}/share/avifile-0.7
%_mandir/man1/aviplay.1*
%_mandir/man1/avicap.1*
%_mandir/man1/avirecompress.1*
%_mandir/man1/kv4lsetup.1*

%changelog
openSUSE Build Service is sponsored by