Name:            libquicktime
Version:         1.2.4
Release:         5%{?_dist_release}
License:         LGPLv2+
Group:           System Environment/Libraries
Source0:         http://prdownloads.sourceforge.net/libquicktime/%{name}-%{version}.tar.gz
Patch1:          ffmpeg2.0.patch

URL:             http://libquicktime.sourceforge.net/
Summary:         Library for reading and writing Quicktime files
Summary(ja):     QuickTime ファイルを読み書きするためのライブラリ

Vendor:          Project Vine
Distribution:    Vine Linux
BuildRoot:       %{_tmppath}/%{name}-%{version}-root

Obsoletes: %{name} < %{version}
Obsoletes: %{name}-utils < %{version}
Obsoletes: %{name}-devel < %{version}

BuildRequires:   libvorbis-devel
BuildRequires:   libpng-devel
BuildRequires:   libjpeg-devel
BuildRequires:   gtk2-devel 
BuildRequires:   libdv-devel
BuildRequires:   libraw1394-devel
BuildRequires:   libavc1394-devel

BuildRequires:   alsa-lib-devel
BuildRequires:   zlib-devel
BuildRequires:   gettext-devel
BuildRequires:   mesa-libGL-devel
BuildRequires:   libX11-devel
BuildRequires:   libICE-devel
BuildRequires:   libSM-devel
BuildRequires:   libXext-devel
BuildRequires:   libXmu-devel
BuildRequires:   libXpm-devel
BuildRequires:   libXt-devel
BuildRequires:   libXaw-devel >= 1.0.5
BuildRequires:	 libXv-devel

##BuildRequires:   ffmpeg-devel
##BuildRequires:   lame-devel
##BuildRequires:   faad2-devel
##BuildRequires:   faac-devel
##BuildRequires:   x264-devel

%description
Libquicktime is based on the quicktime4linux library with several
enhancements. All 3rd-party libraries were removed from the
sourcetree. Instead, the systemwide installed libraries are detected
by the configure script. All original codecs were moved into
dynamically loadable modules, and new codecs are in
development. Libquicktime is source-compatible with
quicktime4linux. Special API extensions allow access to the codec
registry and more convenient processing of Audio and Video
data. 

%description -l ja
libquicktime は、quicktime4linux ライブラリを元に拡張しています。 
サードパーティライブラリは、一次元ソースツリーからすべて消えてしまいました。
その代わりに、システムワイドにインストールされるライブラリは、
configure スクリプトにより検出されます。
オリジナルコーデックは、すべて動的読み込み可能なモジュールに
移行してしまいました。また、新しいコーデックは開発途中です。
libquicktime は quicktime4linux と互換性を持ったソースです。
特別な API 拡張は、コーデックレジストリや
音声や動画のより便利な処理にアクセスができます。

%package utils
Summary:	Utilities for working with Quicktime files
Summary(ja):	Quicktime ファイルを操作するためのユーティリティ
Group:		Applications/Multimedia
Requires:        %{name} = %{version}-%{release}

%description utils
Libquicktime is based on the quicktime4linux library with several
enhancements. 

This package contains utility programs and additional
tools, like a commandline player and a GTK configuration utility which
can configure the parameters of all installed codecs.

%package devel
Summary:         Development files from the libquicktime library
Summary(ja):     libquicktime の開発ライブラリ
Group:           Development/Libraries
Requires:        %{name} = %{version}-%{release}
Requires:        zlib-devel
Requires:        pkgconfig

%description devel
Libquicktime is based on the quicktime4linux library with several
enhancements. 

This package contains development files for %{name}.


%prep
%setup -q -n %{name}-%{version}
%patch1 -p1 -b .ffmpeg2.0

%build
%configure \
    --enable-gpl \
    --disable-rpath \
    --with-cpuflags="$RPM_OPT_FLAGS" \
    --disable-dependency-tracking \
    --without-doxygen \
    --disable-static \
    --with-libdv \
    --enable-libswscale \
    ;

# remove rpath from libtool
%__sed -i.rpath 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
%__sed -i.rpath 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool

%__make %{?_smp_mflags}


%install
%{__rm} -rf %{buildroot}
%makeinstall

## remove unuse files
find $RPM_BUILD_ROOT%{_libdir} -type f -a -name \*.la -exec %__rm -f {} \;

%find_lang %{name}

%clean
%{__rm} -rf %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING NEWS README TODO
%{_libdir}/%{name}*.so.*
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/lqt_*.so

%files utils
%defattr(-,root,root,-)
%{_bindir}/libquicktime_config
%{_bindir}/lqt_transcode
%{_bindir}/lqtplay
%{_bindir}/lqtremux
%{_bindir}/qt2text
%{_bindir}/qtdechunk
%{_bindir}/qtdump
%{_bindir}/qtinfo
%{_bindir}/qtrechunk
%{_bindir}/qtstreamize
%{_bindir}/qtyuv4toyuv
%{_mandir}/man1/lqtplay.1*

%files devel
%defattr(-,root,root,-)
%{_includedir}/lqt/
%{_libdir}/pkgconfig/libquicktime.pc
%{_libdir}/%{name}*.so


%changelog
* Tue Oct 25 2016 Toshiaki Ara <ara_t@384.jp> 1.2.4-5
- add Patch1 for [BTS:0002886]

* Wed Oct  2 2013 Munehiro Yamamoto <munepi@vinelinux.org> 1.2.4-4
- added Obsoletes: %{name} < %{version} and so on.

* Sun Sep 29 2013 Munehiro Yamamoto <munepi@vinelinux.org> 1.2.4-3
- rebuilt with new x264 (ABI 0.136) and ffmpeg (1.2.x)

* Sun Jan 20 2013 Munehiro Yamamoto <munepi@vinelinux.org> 1.2.4-2
- rebuilt with new x264 (ABI 0.129) and ffmpeg (1.1.x)

* Sat May 26 2012 Munehiro Yamamoto <munepi@vinelinux.org> 1.2.4-1
- new upstream release

* Sun Dec 18 2011 Munehiro Yamamoto <munepi@vinelinux.org> 1.2.3-2
- rebuilt with new x264 (ABI 0.119) and ffmpeg (0.9.x)

* Thu Dec 15 2011 Munehiro Yamamoto <munepi@vinelinux.org> 1.2.3-1
- new upstream release

* Sat Mar 26 2011 Munehiro Yamamoto <munepi@vinelinux.org> 1.2.2-2
- rebuilt

* Mon Jan 31 2011 Munehiro Yamamoto <munepi@vinelinux.org> 1.2.2-1
- new upstream release
- added the subpackage utils
- updated %%description

* Sun Jun 27 2010 Munehiro Yamamoto <munepi@vinelinux.org> 1.1.5-1
- new upstream release

* Sat Mar 20 2010 Munehiro Yamamoto <munepi@vinelinux.org> 1.1.4-2
- change release to sync with self-build-libquicktime.spec

* Wed Feb 17 2010 Munehiro Yamamoto <munepi@vinelinux.org> 1.1.4-1
- new upstream release

* Sun Jun 28 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.1.2-1
- new upstream release
- changed License: LGPLv2
- added some configure options

* Sun Nov 09 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0.3-2
- rebuild with libXaw.so.7 (libXaw-1.0.5)

* Mon Sep 29 2008 Shu KONNO <owa@bg.wakwak.com> 1.0.3-1vl5
- applied new versioning policy, spec in utf-8
- updated libquicktime to 1.0.3

* Thu Aug  3 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.9.9-0vl1
- new upstream release
- License is LGPL
- added libquicktime.pc to devel package

* Mon Feb 21 2005 Susumu Tanimura <stanimura-ngs@umin.ac.jp>
- Inital package for VineLinux3.1
