File k3b.spec of Package k3b

# spec file for package k3b
# Copyright (c) 2012 SUSE LINUX Products 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

%bcond_with ffmpeg
%bcond_with mad
%bcond_with lame

Name:           k3b
Version:        2.0.2
Release:        0
Summary:        CD/DVD/Blu-ray Burning Application for KDE
License:        GPL-2.0+
Group:          Productivity/Multimedia/CD/Record

# PATCH-FIX-OPENSUSE initial-preference.diff -- Make the default handler for .iso files instead of Ark
Patch0:         initial-preference.diff
# PATCH-FIX-OPENSUSE add_mimetypes_bnc661777.diff bnc#661777 -- Add a few mimetypes to the desktop file for better integration in GNOME
Patch1:         add_mimetypes_bnc661777.diff
# PATCH-FIX-UPSTREAM k3b-short-trackinfo.patch bko #268307 -- Too short track info dataLen returned at least on HL-DT-ST BH10LS30
Patch2:         k3b-short-trackinfo.patch
# PATCH-FIX-UPSTREAM %{name}-2.0.2-ffmpeg08.diff kde#274817 -- Make it compile with the latest ffmpeg.
Patch3:         %{name}-2.0.2-ffmpeg08.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

# only needed to patch broken images in the upstream tarball
BuildRequires:  ImageMagick
BuildRequires:  fdupes
BuildRequires:  flac-devel
%if %{with lame}
BuildRequires:  libmp3lame-devel
BuildRequires:  libdvdread-devel
%if %{with ffmpeg}
BuildRequires:  libffmpeg-devel
BuildRequires:  libkcddb4-devel
%if %{with mad}
BuildRequires:  libmad-devel
BuildRequires:  libmpcdec-devel
BuildRequires:  libmusicbrainz-devel
BuildRequires:  libsamplerate-devel
BuildRequires:  libsndfile-devel
BuildRequires:  libtag-devel
BuildRequires:  libvorbis-devel
%if 0%{?suse_version}
BuildRequires:  update-desktop-files
Requires:       /usr/bin/cdrdao
Requires:       /usr/bin/cdrecord
Requires:       /usr/bin/mkisofs
Requires:       /usr/bin/readcd
Requires:       dvd+rw-tools
Requires(post): shared-mime-info
Requires(postun): shared-mime-info
Recommends:     normalize
Recommends:     sox
Recommends:     transcode
Recommends:     vcdimager
Recommends:     %{name}-lang = %{version}
Provides:       kde4-k3b = 4.2.2.svn951754
Obsoletes:      kde4-k3b < 4.2.2.svn951754

Featuring a simple, yet powerful graphical interface, k3b provides various
options for burning a CD, DVD, or BD (Blu-ray disc). Various types of optical
projects are supported including (but not limited to) audio and data, video
projects for DVD and VCD, as well as multi-session and mixed-mode discs. k3b
also has the ability to erase re-writeable media and can perform more
complicated tasks such as audiovisual encoding and decoding.

%package devel
Summary:        Development files for k3b
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description devel
This package contain files needed for development with k3b.

%setup -q
%patch2 -p1
%if %{with ffmpeg}
%patch3 -p1

# patch image with wrong dimensions - fix rpmlint warning "wrong-icon-size"
pushd src/icons/actions
for f in hi16*.png; do
  geom=$(identify -ping "$f"|cut -f3 -d" ")
  if [ "$x" != "16" -o "$y" != "16" ]; then
    if [ "$x" -gt "$y" ]; then
    elif [ "$x" -lt "$y" ]; then
    [ -n "$nugeom" ] && mogrify -extent "$nugeom" -background transparent -gravity "$grav" "$f"
    mogrify -scale 16x16 -background transparent "$f"

export RPM_OPT_FLAGS="%{optflags} -fno-strict-aliasing"

%cmake_kde4 -d build -- -DK3B_ENABLE_HAL_SUPPORT=OFF

pushd build

%if 0%{?suse_version}
%suse_update_desktop_file -r k3b Qt KDE AudioVideo DiscBurning

# Remove unneeded locales
%if 0%{?suse_version} && 0%{?suse_version} < 1140
rm -rf %{buildroot}%{_datadir}/locale/ast/
rm -rf %{buildroot}%{_datadir}/locale/csb/
rm -rf %{buildroot}%{_datadir}/locale/hne/
rm -rf %{buildroot}%{_datadir}/locale/sr@ijekavian/
rm -rf %{buildroot}%{_datadir}/locale/sr@ijekavianlatin/

# Fix rpmlint warning "files-duplicate*"
%fdupes -s %{buildroot}

%find_lang k3b k3b.lang
%find_lang k3bsetup k3b.lang
%find_lang libk3b k3b.lang
%find_lang libk3bdevice k3b.lang
%find_lang kio_videodvd k3b.lang


/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :

/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :

rm -rf %{buildroot}

%doc %{_kde4_htmldir}/en/k3b/
%dir %{_kde4_appsdir}/solid
%dir %{_kde4_appsdir}/solid/actions
%config %{_sysconfdir}/dbus-1/system.d/org.kde.kcontrol.k3bsetup.conf

%files devel

%files lang -f k3b.lang
%exclude %{_kde4_htmldir}/en/k3b/

openSUSE Build Service is sponsored by