File erlang-jsx.spec of Package erlang-jsx

#
# spec file for package erlang-jsx
#
# 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-jsx
Version:        3.1.0
Release:        0
%define mod_ver %(echo "%{version}" | cut -d "+" -f1)
Summary:        Application for consuming, producing and manipulating json
License:        MIT
Group:          Development/Libraries/Other
URL:            https://github.com/talentdeficit/jsx
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source0:        jsx-%{version}.tar.xz
BuildRequires:  erlang-rebar

%description
Jsx is an erlang application for consuming, producing and manipulating json.

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

%build
%__rebar compile

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

%check
%__rebar eunit

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

%changelog
openSUSE Build Service is sponsored by