File mediadownloader.spec of Package mediadownloader

#
# spec file for package mediadownloader
#
# 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 http://bugs.opensuse.org/
#

Name:           mediadownloader
Version:        1.5.2
Release:        0
License:        GPL-3.0
Summary:        Google and YouTube Media Downloader
Url:            http://mediadownloader.cz.cc
Group:          Productivity/Networking/Web/Utilities
Source0:        http://download.sourceforge.net/googleimagedown/project/%{name}_%{version}-src.tar.gz
BuildRequires:  ImageMagick
BuildRequires:  hicolor-icon-theme
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(QtCore)
BuildRequires:  pkgconfig(QtGui)
BuildRequires:  pkgconfig(QtNetwork)
BuildRequires:  pkgconfig(QtOpenGL)
BuildRequires:  pkgconfig(QtWebKit)
BuildRequires:  pkgconfig(QtXml)
BuildRequires:  pkgconfig(phonon)
Requires:       phonon-backend
Recommends:     MPlayer
Recommends:     ffmpeg
Recommends:     libmp3lame
Provides:       google-image-downloader = %{version}
Obsoletes:      google-image-downloader < 1.3
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Mediadownloader is a software that lets you search, watch and download
items with Google Image and YouTube. Search results are displayed within
a mouse scrollable view, as well as mobile devices do.

%prep
%setup -q

%build
qmake \
    CONFIG+=release \
    CONFIG-=debug \
    QT+=phonon \
    DEFINES+=PHONON_LIB \
    QMAKE_CFLAGS+="%{optflags}" \
    QMAKE_CXXFLAGS+="%{optflags}" \
    QMAKE_STRIP=""
make %{?_smp_mflags}

%install
# Create correct desktop file.
cat > %{name}.desktop << EOF
[Desktop Entry]
Name=mediadownloader
GenericName=Google and YouTube Media Downloader
GenericName[ru]=Загрузка картинок и видео из Google и YouTube
Type=Application
Exec=mediadownloader
Icon=mediadownloader
Categories=Network;FileTransfer;Qt;
Comment=Google Media and YouTube Downloader
Comment[ru]=Поиск и загрузка картинок и видео из Google и YouTube
Terminal=false
StartupNotify=true
EOF

make INSTALL_ROOT=%{buildroot} install

# Install CSSs and presets.
install -dm 0755 \
    %{buildroot}%{_sysconfdir}/%{name}/{css,ffmpeg-presets}
install -m 0644 css/* \
    %{buildroot}%{_sysconfdir}/%{name}/css
install -m 0644 ffmpeg-presets/* \
    %{buildroot}%{_sysconfdir}/%{name}/ffmpeg-presets

# Install icons of various sizes.
install -Dm 644 icons/%{name}.png \
    %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/%{name}.png
for size in 96x96 64x64 48x48 32x32 22x22 16x16 ; do
install -dm 0755 \
    %{buildroot}%{_datadir}/icons/hicolor/${size}/apps
convert -resize ${size} icons/%{name}.png \
    %{buildroot}%{_datadir}/icons/hicolor/${size}/apps/%{name}.png
done

%suse_update_desktop_file %{name}

%post
%icon_theme_cache_post

%postun
%icon_theme_cache_postun

%files
%defattr(-,root,root,-)
%doc COPYING README.txt
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/*/%{name}.png
%config %{_sysconfdir}/%{name}

%changelog
openSUSE Build Service is sponsored by