File gcstar.spec of Package gcstar

# spec file for package gcstar
# Copyright (c) 2011 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

Name:           gcstar
Version:        1.6.2
Release:        1
License:        GPL-2.0
Summary:        Application to manage collections
Group:          Productivity/Office/Management
# PATCH-FIX-OPENSUSE gcstar-fix-desktop.patch -- Fix desktop file for openSUSE
Patch0:         gcstar-fix-desktop.patch
BuildRequires:  fdupes
BuildRequires:  perl
BuildRequires:  perl(Crypt::SSLeay)
BuildRequires:  perl(Gtk2) >= 1.054
BuildRequires:  perl(HTML::Parser)
BuildRequires:  perl(XML::Parser)
BuildRequires:  perl(XML::Simple)
BuildRequires:  perl-libwww-perl
# We need the %%mime_database_* macros
BuildRequires:  shared-mime-info
BuildRequires:  update-desktop-files
Requires:       perl
Requires:       perl(Crypt::SSLeay)
Requires:       perl(Gtk2) >= 1.054
Requires:       perl(HTML::Parser)
Requires:       perl(XML::Parser)
Requires:       perl(XML::Simple)
Requires:       perl-libwww-perl
Recommends:     perl(Archive::Zip)
Recommends:     perl(GD)
Recommends:     perl(GD::Graph::area)
Recommends:     perl(GD::Graph::bars)
Recommends:     perl(GD::Graph::pie)
Recommends:     perl(GD::Text)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

GCstar is a free open source application for managing collections of
movies, books, music, etc. Detailed information on each item can be
automatically retrieved from the internet and you can store additional
data, such as the location or who you've lent it to. You may also
search and filter your collection by many criteria.

%setup -q -n %{name}
%patch0 -p1


./install --prefix=%{buildroot}%{_prefix}/
for icon in share/gcstar/icons/gcstar_*.png; do
  size=`echo $icon | sed 's,.*gcstar_,,;s,\.png,,'`
  # Only install sizes that exist in hicolor
  if test -d %{_datadir}/icons/hicolor/$size/apps; then
    install -D -m644 $icon %{buildroot}%{_datadir}/icons/hicolor/$size/apps/gcstar.png
  if test -d %{_datadir}/icons/hicolor/$size/mimetypes; then
    install -D -m644 $icon %{buildroot}%{_datadir}/icons/hicolor/$size/mimetypes/application-x-gcstar.png
install -D -m644 share/gcstar/icons/gcstar_scalable.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/gcstar.svg
install -D -m644 share/gcstar/icons/gcstar_scalable.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/mimetypes/application-x-gcstar.svg
mkdir -p %{buildroot}%{_mandir}/man1/
mv %{buildroot}%{_prefix}/man/man1/gcstar.1.gz %{buildroot}%{_mandir}/man1/
mkdir -p %{buildroot}%{_datadir}/mime/packages
install -m 644 share/applications/gcstar.xml %{buildroot}%{_datadir}/mime/packages
mkdir -p %{buildroot}%{_datadir}/applications
%suse_update_desktop_file -i gcstar Database
# A hack around killing backup files found in the tarball. Remove when failing.
rm %{buildroot}/usr/lib/gcstar/GCPlugins/GCbooks/
%fdupes %{buildroot}%{_datadir}

rm -rf %{buildroot}

%if 0%{?suse_version} > 1130
update-mime-database %{_datadir}/mime || true

%if 0%{?suse_version} > 1130
update-mime-database %{_datadir}/mime || true


openSUSE Build Service is sponsored by