File cairo-dock.spec of Package cairo-dock

# vim: set sw=4 ts=4 et:

# Copyright (c) 2012 Pascal Bleser <pascal.bleser@opensuse.org>
#
# 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/

%define ver_major 3
%define ver_minor 4
%define ver_patch 1

Name:           cairo-dock
Version:        %{ver_major}.%{ver_minor}.%{ver_patch}
Release:        0
License:        GPL-3.0+
Summary:        A small simple but effective doclet like Mac
Url:            http://www.glx-dock.org/
Group:          System/GUI/GNOME
Source0:        https://launchpad.net/cairo-dock-core/%{ver_major}.%{ver_minor}/%{version}/+download/cairo-dock-%{version}.tar.gz
# PATCH-FEATURE-OPENSUSE cairo-dock-remove_build_timestamps.patch -- remove build timestamp; build-compare doesn't like it
Patch0:         cairo-dock-remove_build_timestamps.patch
BuildRequires:  cmake
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  gettext-devel
BuildRequires:  pkg-config
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(cairo)
BuildRequires:  pkgconfig(dbus-1)
BuildRequires:  pkgconfig(dbus-glib-1)
BuildRequires:  pkgconfig(gl)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(glu)
BuildRequires:  pkgconfig(gthread-2.0)
BuildRequires:  pkgconfig(gtk+-3.0) >= 3.4.0
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(librsvg-2.0)
BuildRequires:  pkgconfig(libxml-2.0)
BuildRequires:  pkgconfig(xcomposite)
BuildRequires:  pkgconfig(xinerama)
BuildRequires:  pkgconfig(xrandr)
BuildRequires:  pkgconfig(xrender)
BuildRequires:  pkgconfig(xtst)
# They're doing it wrong. Therefore it has to be explicit version requirement.
Requires:       libgldi%{ver_major} = %{version}
Recommends:     %{name}-lang = %{version}
Recommends:     cairo-dock-plugins = %{version}
Recommends:     cairo-dock-plugins-Help = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Cairo-dock was in the beginning a small simple but effective dock.
On 4th July 2007, Fabounet proposes to us a version improved,
with a very ergonomic configuration, on the ubuntu-fr.org forum.

Since, new versions are followed at an intensive pace and with
their new functionalities like the sub-docks, the effects on
the launchers ... Many people are grafted with the project,
each one bringing its competences, of graphics, to the applet
or plugins and development.

%package plugins-Help
Summary: Cairo Dock drop_indicator Plugin
Group: System/GUI/Other
Requires: %{name} = %{version}

%description plugins-Help
Cairo Dock Help Plugin

%package -n libgldi%{ver_major}
Summary:        Library needed by cairo-dock
Group:          System/Libraries

%description -n libgldi%{ver_major}
Cairo-dock is a small simple but effective doclet like Mac
Library needed by cairo-dock.

%package -n libgldi%{ver_major}-devel
Summary:        Library needed by cairo-dock
Group:          Development/Libraries/X11
Requires:       libgldi%{ver_major} = %{version}

%description -n libgldi%{ver_major}-devel
Cairo-dock is a small simple but effective doclet like Mac
Library needed by cairo-dock.

%lang_package

%prep
%setup -q
%patch0

%build

mkdir build
pushd build
    cmake \
        -DCMAKE_INSTALL_PREFIX="%{_prefix}" \
        -DCMAKE_INSTALL_LIBDIR=%{_lib} \
        -DCMAKE_VERBOSE_MAKEFILE=TRUE \
        -DCMAKE_C_FLAGS="%{optflags}" \
        -DCMAKE_SKIP_RPATH=TRUE \
        -DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE \
        ..
    make %{?_smp_flags} VERBOSE=1
popd

%install
pushd build
%make_install
popd
%suse_update_desktop_file -r -n %{name} Utility DesktopUtility
%suse_update_desktop_file -r -n %{name}-cairo Utility DesktopUtility
%find_lang %{name}
%fdupes -s %{buildroot}/%{_datadir}

%post   -n libgldi%{ver_major} -p /sbin/ldconfig
%postun -n libgldi%{ver_major} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%{_bindir}/cairo-dock
%dir %{_libdir}/cairo-dock
%{_datadir}/cairo-dock/
%exclude %{_datadir}/cairo-dock/plug-ins/*
%doc %{_datadir}/cairo-dock/ChangeLog.txt
%{_datadir}/applications/cairo-dock-cairo.desktop
%{_datadir}/applications/cairo-dock.desktop
%{_datadir}/pixmaps/cairo-dock.svg
%doc %{_mandir}/man1/%{name}.1*

%files plugins-Help
%defattr(-,root,root)
%{_libdir}/cairo-dock/libcd-Help.so
%{_datadir}/cairo-dock/plug-ins/Help/

%files -n libgldi%{ver_major}
%defattr(-, root, root)
%{_libdir}/libgldi.so.%{ver_major}*

%files -n libgldi%{ver_major}-devel
%defattr(-, root, root)
%{_includedir}/cairo-dock
%{_libdir}/libgldi.so
%{_libdir}/pkgconfig/gldi.pc

%files lang -f %{name}.lang
%defattr(-, root, root)

%changelog
openSUSE Build Service is sponsored by