File erlang-p1_cache_tab.spec of Package erlang-p1_cache_tab

#
# spec file for package erlang-lager
#
# Copyright (c) 2013 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:           erlang-p1_cache_tab
Version:        0
%define mod_name cache_tab
%define mod_ver %(echo "%{version}" | cut -d "+" -f1)
Release:        0
Summary:        Caching library from processone
License:        GPL-2.0
Group:          Development/Libraries/Other
Url:            https://github.com/processone/cache_tab
Source:         %{mod_name}-%{version}.tar.xz
BuildRequires:  erlang-rebar
BuildRequires:  erlang-p1_utils >= 1.0.25
%requires_eq    erlang-p1_utils
Requires:       erlang
Provides:       erlang-%{mod_name} = %{version}-%{release}

%description
Caching library from processone

%package devel
Summary:        Caching library from processoneOTP
Group:          Development/Libraries/Other
Requires:       %{name} = %{version}
Provides:       %{name}-src = %{version}
Obsoletes:      %{name}-src < %{version}
Provides:       erlang-%{mod_name}-devel = %{version}-%{release}

%description devel
Caching library from processone

This package contains the sources for %{name}.

%prep
%setup -n %{mod_name}-%{version}

%build
%configure
%rebar compile

%install
for dir in ebin src priv ; do
  install -d %{buildroot}%{erlang_libdir}/%{mod_name}-%{mod_ver}/${dir}
  cp -r ${dir}/* %{buildroot}%{erlang_libdir}/%{mod_name}-%{mod_ver}/${dir}/
done

%check
%rebar ct

%files
%defattr(-,root,root) 
%doc LICENSE.txt README.md
%dir %{erlang_libdir}/%{mod_name}-%{mod_ver}
%{erlang_libdir}/%{mod_name}-%{mod_ver}/ebin
%{erlang_libdir}/%{mod_name}-%{mod_ver}/priv

%files devel
%defattr(-,root,root)
%{erlang_libdir}/%{mod_name}-%{mod_ver}/src
openSUSE Build Service is sponsored by