File makemkv.spec of Package makemkv

Name:           makemkv
Summary:		DVD and Blu-ray to MKV converter and network streamer
Version:        1.15.2
Release:        1
License:        See eula_en_linux.txt
Group:          Productivity/Multimedia/Video/Editors and Convertors
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
BuildRequires:  pkgconfig(openssl)
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
BuildRequires:  update-desktop-files

Requires:       hicolor-icon-theme

Conflicts:		libaacs
Conflicts:		libbdplus

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}

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

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

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
%suse_update_desktop_file -r -G 'MKV Creator & Streamer' makemkv AudioVideo AudioVideoEditing

# 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}/  %{buildroot}%{_libdir}/
ln -s %{_libdir}/  %{buildroot}%{_libdir}/

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

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

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

%doc makemkv-bin-%{version}/src/eula_en_linux.txt
%doc makemkv-oss-%{version}/License.txt
%doc makemkv-changelog.txt