File maya-calendar.spec of Package maya-calendar

#
# spec file for package maya-calendar
#
# Copyright (c) 2016 SUSE LINUX 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/
#


%define lname   libmaya-calendar0
Name:           maya-calendar
Version:        0.4.0.2
Release:        0
Summary:        Maya Calendar for the Pantheon Desktop
License:        GPL-3.0+
Group:          Productivity/Office/Organizers
Url:            https://launchpad.net/maya/
Source:         https://launchpad.net/maya/loki/%{version}/+download/%{name}-%{version}.tar.xz
BuildRequires:  cmake >= 2.8
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  intltool
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(champlain-0.12)
BuildRequires:  pkgconfig(champlain-gtk-0.12)
BuildRequires:  pkgconfig(clutter-1.0)
BuildRequires:  pkgconfig(folks)
BuildRequires:  pkgconfig(gconf-2.0)
BuildRequires:  pkgconfig(gee-0.8)
BuildRequires:  pkgconfig(geocode-glib-1.0)
BuildRequires:  pkgconfig(gio-2.0)
BuildRequires:  pkgconfig(gmodule-2.0)
BuildRequires:  pkgconfig(granite)
BuildRequires:  pkgconfig(gtk+-3.0) >= 3.11.6
BuildRequires:  pkgconfig(libecal-1.2) >= 3.8.0
BuildRequires:  pkgconfig(libedataserver-1.2)
BuildRequires:  pkgconfig(libedataserverui-1.2)
BuildRequires:  pkgconfig(libical)
BuildRequires:  pkgconfig(libsoup-2.4)
BuildRequires:  pkgconfig(vapigen) >= 0.28.0
BuildRequires:  elementary-icon-theme
Recommends:     %{name}-lang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%glib2_gsettings_schema_requires

%description
A slim, lightweight GTK+3 calendar app written in Vala, designed for
Elementary OS where it is known simply as Calendar.

Also looks and works great on other GTK+ desktops.

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

%description    devel
This subpackage contains libraries and header files for developing
applications that want to make use of the libmaya shared library.

%package -n     %{lname}
Summary:        The Maya Calendar main library
Group:          System/Libraries

%description -n %{lname}
A slim, lightweight GTK+3 calendar app written in Vala, designed for
Elementary OS where it is known simply as Calendar.

%lang_package

%prep
%setup -q

%build
%cmake \
    -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed" \
    -DGSETTINGS_COMPILE=OFF

make %{?_smp_mflags}

%install
%cmake_install

pushd %{buildroot}
for _icon in $(find -name \*.desktop* | xargs sed -n '/Icon/s/^.*\=//p'); do
    _icon=${_icon##*/}
    if ! find -name "$_icon" | grep -q .; then
        _icon=$(find %{_datadir}/icons -name "${_icon%.*}.svg" | head -n1)
        install -Dm0644 \
            "$_icon" ".%{_datadir}/icons/hicolor/scalable/apps/${_icon##*/}"
    else
        echo "Found: $_icon"
        exit 1
    fi
done
popd

%suse_update_desktop_file %{name}
%find_lang %{name} %{?no_lang_C}
%fdupes %{buildroot}/%{_prefix}

%post
%icon_theme_cache_post
%desktop_database_post
%glib2_gsettings_schema_post

%postun
%icon_theme_cache_postun
%desktop_database_postun
%glib2_gsettings_schema_postun

%post   -n %{lname} -p /sbin/ldconfig
%postun -n %{lname} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc AUTHORS COPYING COPYRIGHT
%{_bindir}/maya*
%{_libdir}/%{name}/
%{_datadir}/maya-calendar/
%{_datadir}/appdata/%{name}.appdata.xml
%{_datadir}/applications/%{name}-daemon.desktop
%{_datadir}/applications/%{name}.desktop
%{_datadir}/glib-2.0/schemas/org.pantheon.maya.gschema.xml
%{_datadir}/icons/hicolor/*/actions/calendar-go-today.??g
%{_datadir}/icons/hicolor/*/apps/office-calendar.??g
%dir %{_datadir}/appdata

%files devel
%defattr(-,root,root)
%{_includedir}/%{name}/
%{_libdir}/lib%{name}.so
%{_libdir}/pkgconfig/%{name}.pc
%{_datadir}/vala/vapi/%{name}.deps
%{_datadir}/vala/vapi/%{name}.vapi

%files -n %{lname}
%defattr(-,root,root)
%{_libdir}/lib%{name}.so.*

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

%changelog

openSUSE Build Service is sponsored by