File erlang-type_mapper.spec of Package erlang-type_mapper

#
# spec file for package erlang-type_mapper
#
# Copyright (c) 2022 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


Name:           erlang-type_mapper
Version:        20.09.1+git20210831.a8fb63d
Release:        0
%define mod_ver %(echo "%{version}" | cut -d "+" -f1)
Summary:        Tool to convert JSON to structured data according to type specs
License:        MIT
Group:          Development/Libraries/Other
URL:            https://github.com/flussonic/type_mapper
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source0:        type_mapper-%{version}.tar.xz
Requires:       erlang-jsx
BuildRequires:  erlang-jsx
BuildRequires:  erlang-rebar

%description
Erlang type mapping tool that allows to convert json to structured data according to type specs.

It can:
 * translate JSON to records according to typespecs
 * translate JSON to valid typed maps according to typespecs
 * translate records to valid typed maps
 * validate input and return errors if they happen just like ninenines/sheriff
 * give JSON schema output suitable for Swagger

%prep
%setup -q -n type_mapper-%{version}

%build
%__rebar compile

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

%check
%__rebar eunit

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

%changelog
openSUSE Build Service is sponsored by