LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File jsxd.spec of Package jsxd (Project home:Ledest:erlang:19)

%define bname jsxd
Name: %bname
Version: 0.1.10
Release: 2
Summary: JSX style data structure manipulation for Erlang/OTP
License: CDDL-1.0
Group: Development/Tools/Other
URL: https://github.com/Licenser/%bname
Source: %bname-%version.tar.xz
Patch1: jsxd-update-get-2.patch
BuildArch: noarch
Provides: erlang-%bname = %version-%release

BuildRequires: rpm-macros-erlang rpm-build-erlang
BuildRequires: rebar erl_interface

%description
%bname is a library to sanely work with nested data structures as jsx produces.
The data structures can represent objects (key value lists) or arrays (lists).


%prep
%setup -q -n %bname-%version
%patch1 -p1


%build
erl -noshell -eval '
{ok, L} = file:consult("rebar.config"),
file:write_file("%bname.rebar.config",
                lists:map(fun(E) -> io_lib:format("~p.~n", [E]) end,
                          [{erl_opts, [slim, inline, no_debug_info|lists:delete(debug_info, proplists:get_value(erl_opts, L))]}|lists:foldl(fun proplists:delete/2, L, [deps, erl_opts, lib_dirs, cover_enabled])])),
halt().'
for c in compile doc; do
	rebar -C %bname.rebar.config $c -v
done


%install
install -d -m 0755 %buildroot%_otplibdir/%bname-%version/ebin
install -p -m 0644 ebin/* %buildroot%_otplibdir/%bname-%version/ebin/
install -d -m 0755 %buildroot%_otplibdir/%bname-%version/doc
install -p -m 0644 doc/*.{css,html,png} %buildroot%_otplibdir/%bname-%version/doc/
install -d -m 0755 %buildroot%_docdir/%name
ln -sf %_otplibdir/%name-%version/doc %buildroot%_docdir/%name/html
install -p -m 0644 *.md %buildroot%_docdir/%name/


%files
%defattr(-,root,root)
%doc %_docdir/%name
%_otplibdir/*


%changelog
* Fri Mar 18 2016 Led <ledest@gmail.com> 0.1.10-2
- clean up BuildRequires
- add patches:
  + jsxd-update-get-2.patch

* Mon Dec 28 2015 Led <ledest@gmail.com> 0.1.10-1
- initial build