File granite.spec of Package granite

#
# spec file for package granite
#
# Copyright (c) 2017 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 sover 4
%define soname libgranite
%define _typelibdir %(pkg-config --variable=typelibdir gobject-introspection-1.0)
%define _girdir %(pkg-config --variable=girdir gobject-introspection-1.0)
Name:           granite
Version:        0.5
Release:        0
Summary:        An extension of GTK+ libraries
License:        GPL-2.0+ and LGPL-3.0+
Group:          Development/Libraries/C and C++
Url:            https://launchpad.net/granite/
Source:         https://github.com/elementary/granite/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires:  cmake >= 2.8
BuildRequires:  fdupes
BuildRequires:  pkgconfig
BuildRequires:  vala >= 0.28.0
BuildRequires:  pkgconfig(gee-0.8)
BuildRequires:  pkgconfig(gio-unix-2.0)
BuildRequires:  pkgconfig(gobject-introspection-1.0)
BuildRequires:  pkgconfig(gthread-2.0)
BuildRequires:  pkgconfig(gtk+-3.0) >= 3.16.0
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Granite is an extension of GTK+. Among other things, it provides the
commonly-used widgets such as modeswitchers, welcome screens, AppMenus,
search bars, and more found in Elementary applications.

%package -n     %{soname}%{sover}
Summary:        Granite is a development library
Group:          System/Libraries
Requires:       %{name}-common
Provides:       %{name} = %{version}

%description -n %{soname}%{sover}
Granite is an extension of GTK+. It provides the commonly used widgets
found in Elementary applications.

%package        common
Summary:        Granite development library -- Common Files
Group:          System/Libraries
Recommends:     %{name}-lang

%description    common
Granite is an extension of GTK+.

This package contains the common files needed by the library.

%package        demo
Summary:        Granite development library -- Demo binary
Group:          Development/Libraries/Other

%description    demo
Granite is an extension of GTK+.

This package contains a small demo application to show the %{name} widgets.

%package -n     typelib-1_0-Granite-1_0
Summary:        Granite development library -- Introspection bindings
Group:          Development/Libraries/GNOME

%description -n typelib-1_0-Granite-1_0
Granite is an extension of GTK+.

This package provides the GObject Introspection bindings for lib%{name}.

%package        devel
Summary:        Granite development library -- Development files
Group:          Development/Libraries/GNOME
Requires:       %{soname}%{sover} = %{version}

%description    devel
Granite is an extension of GTK+.

This package contains the development files for lib%{name}.

%lang_package

%prep
%setup -q

%build
%cmake
make %{?_smp_mflags}

%install
%cmake_install
%find_lang %{name}
%fdupes -s %{buildroot}%{_datadir}

%post   -n %{soname}%{sover} -p /sbin/ldconfig
%postun -n %{soname}%{sover} -p /sbin/ldconfig

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

%files common
%defattr(-,root,root)
%doc AUTHORS COPYING README*
%{_datadir}/icons/hicolor/*/actions/appointment.??g
%{_datadir}/icons/hicolor/*/actions/open-menu*.??g

%files demo
%defattr(-, root, root)
%{_bindir}/%{name}-demo
%{_datadir}/applications/%{name}-demo.desktop

%files -n typelib-1_0-Granite-1_0
%defattr(-,root,root)
%{_typelibdir}/Granite-1.0.typelib

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

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

%changelog
openSUSE Build Service is sponsored by