File makemkv.spec of Package makemkv

Name:           makemkv
Summary:		DVD and Blu-ray to MKV converter and network streamer
Version:        1.14.7
Release:        1
License:        See eula_en_linux.txt
Group:          Productivity/Multimedia/Video/Editors and Convertors
Url:            http://www.makemkv.com
Source0:		makemkv-bin-%{version}.tar.gz
Source1:		makemkv-oss-%{version}.tar.gz
Source2:        makemkv-changelog.txt
ExclusiveArch:  %{ix86} x86_64

%if 0%{?mageia} == 7
BuildRequires:  compat-openssl10-devel
%else
BuildRequires:  pkgconfig(openssl)
%endif
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5DBus)
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(expat)
BuildRequires:  pkgconfig(libavcodec)
BuildRequires:  pkgconfig(libavutil)
BuildRequires:  pkgconfig(zlib)
%if 0%{?mageia}
BuildRequires:  desktop-file-utils
%else
BuildRequires:  update-desktop-files
%endif

Requires:       hicolor-icon-theme

Conflicts:		libaacs
Conflicts:		libbdplus

%description
MakeMKV is your one-click solution to convert video that you own into
free and patents-unencumbered format that can be played everywhere.
MakeMKV is a format converter, otherwise called "transcoder". It converts
set of MKV files, preserving most information but not changing it in any
the video clips from proprietary (and usually encrypted) disc into a
way. The MKV format can store multiple video/audio tracks with all
meta-information and preserve chapters. There are many players that can
play MKV files nearly on all platforms, and there are tools to convert
MKV files to many formats, including DVD and Blu-ray discs.

Additionally MakeMKV can instantly stream decrypted video without
intermediate conversion to wide range of players, so you may watch
Blu-ray and DVD discs with your favorite player on your favorite OS
or on your favorite device.

* Reads DVD and Blu-ray discs
* Reads Blu-ray discs protected with latest versions of AACS and BD+
* Preserves all video and audio tracks, including HD audio
* Preserves chapters information
* Preserves all meta-information (track language, audio type)
* Fast conversion - converts as fast as your drive can read data.
* No additional software is required for conversion or decryption.
* Available for Windows, Mac OS X and Linux
* Functionality to open DVD discs is free and will always stay free.
* All features (including Blu-ray decryption and processing) are free during BETA.

%define debug_package %{nil}

%prep
# %setup -q -T -c -n makemkv-%{version} -b 0 -b 1
tar xf %{SOURCE0}
tar xf %{SOURCE1}
cp %{SOURCE2} .

%build
# Accept eula  
mkdir -p makemkv-bin-%{version}/tmp
echo "accepted" > makemkv-bin-%{version}/tmp/eula_accepted
cd makemkv-oss-%{version}
%configure
%{__make} %{?_smp_mflags}

%install
make -C makemkv-oss-%{version} install DESTDIR=%{buildroot} LIBDIR=%{_libdir}
make -C makemkv-bin-%{version} install DESTDIR=%{buildroot} LIBDIR=%{_libdir}
%if 0%{?mageia}
desktop-file-validate %{buildroot}/%{_datadir}/applications/makemkv.desktop
%else
%suse_update_desktop_file -r -G 'MKV Creator & Streamer' makemkv AudioVideo AudioVideoEditing
%endif

# Starting with version 1.8.5, MakeMKV comes with libmmbd library.
# This library also emulates libaacs/libbdplus libraries.
# Once done, any libbluray-based application, including VLC player, will be able to open protected blu-ray discs.
ln -s %{_libdir}/libmmbd.so.0  %{buildroot}%{_libdir}/libaacs.so.0
ln -s %{_libdir}/libmmbd.so.0  %{buildroot}%{_libdir}/libbdplus.so.0

%post
%if 0%{?mageia}
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
%endif
/sbin/ldconfig

%postun
%if 0%{?mageia}
if [ $1 -eq 0 ] ; then
    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
%endif
/sbin/ldconfig

%if 0%{?mageia}
%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%endif

%files
%defattr(-,root,root)
%doc makemkv-bin-%{version}/src/eula_en_linux.txt
%doc makemkv-oss-%{version}/License.txt
%doc makemkv-changelog.txt
%{_bindir}/*
%{_datadir}/MakeMKV
%{_datadir}/applications/*
%{_datadir}/icons/*
%{_libdir}/*

%changelog