%global realname jiffy
Name: erlang-%{realname}
Version: 0.8.5
Release: 4%{?dist}
Summary: Erlang JSON parser
Group: Development/Libraries
License: MIT
URL: https://github.com/davisp/jiffy
Source0: https://github.com/davisp/jiffy/archive/%{version}.tar.gz
Patch0: jiffy-setting-a-fixed-version.patch
Patch1: jiffy-cxxflags.patch
Patch2: jiffy-system-double-conversion.patch
BuildRequires: erlang >= R14B
BuildRequires: erlang-rebar
BuildRequires: gcc-c++
BuildRequires: double-conversion-devel
Requires: erlang-kernel%{?_isa}
Provides: %{realname} = %{version}
Obsoletes: %{realname} < %{version}
%description
A JSON parser for Erlang implemented as a NIF.
%prep
%setup -q -n %{realname}-%{version}
%patch0 -p1 -b .version
%patch1 -p1 -b .cxxflags
%patch2 -p1 -b .system-double-conversion
rm -r c_src/double-conversion
%build
CXXFLAGS="%{optflags}" CFLAGS="%{optflags}" rebar compile -vv
%install
install -d $RPM_BUILD_ROOT%{_libdir}/erlang/lib/%{realname}-%{version}
install -d $RPM_BUILD_ROOT%{_libdir}/erlang/lib/%{realname}-%{version}/priv
install -d $RPM_BUILD_ROOT%{_libdir}/erlang/lib/%{realname}-%{version}/ebin
install -pm644 ebin/jiffy.beam $RPM_BUILD_ROOT%{_libdir}/erlang/lib/%{realname}-%{version}/ebin
install -pm644 ebin/jiffy_utf8.beam $RPM_BUILD_ROOT%{_libdir}/erlang/lib/%{realname}-%{version}/ebin
install -pm644 ebin/jiffy.app $RPM_BUILD_ROOT%{_libdir}/erlang/lib/%{realname}-%{version}/ebin
install -p priv/jiffy.so $RPM_BUILD_ROOT%{_libdir}/erlang/lib/%{realname}-%{version}/priv
%files
%{_libdir}/erlang/lib/%{realname}-%{version}
%doc LICENSE README.md
%changelog
* Tue Mar 18 2014 Ville Skyttä <ville.skytta@iki.fi> - 0.8.5-4
- Use system double-conversion instead of bundled one
* Wed Mar 12 2014 Lubomir Rintel (GoodData) <lubo.rintel@gooddata.com> - 0.8.5-3
- Fix version number in version patch
* Wed Mar 12 2014 Lubomir Rintel (GoodData) <lubo.rintel@gooddata.com> - 0.8.5-2
- Bring back Filip's version patch
- Rename to erlang-jiffy
- Adjust c++ requirement, as suggested by sir Andres
* Tue Mar 11 2014 Lubomir Rintel (GoodData) <lubo.rintel@gooddata.com> - 0.8.5-1
- New version
- Remove the plt file
- Remove empty scriptlets
- Use correct compiler flags
- Remove artifacts not used by modern RPM
- Own the module directory
- Do not use bundled rebar
- No need for explicit GCC dependency
- Relax dependency on complete Erlang distribution
- Remove deproper patch
- Add documentation
- Fix library file mode
* Thu Jul 18 2013 Filip Andres <filip.andres@gooddata.com> - 0.8.3-1.gdc2
* Correcting the version inside jiffy.app and including jiffy_utf8
* Fri May 17 2013 Filip Andres <filip.andres@gooddata.com> - 0.8.3-1.gdc1
* Updating to 0.8.3
* Thu Jan 03 2013 Filip Andres <filip.andres@gooddata.com> - 0.6.1-1.gdc3
- Packaging the plt file with the rest of jiffy
* Wed Jan 02 2013 Filip Andres <filip.andres@gooddata.com> - 0.6.1-1.gdc2
- Building plt
* Mon Dec 10 2012 Filip Andres <filip.andres@gooddata.com> - 0.6.1-1.gdc1
- Imported version 0.6.1
* Mon Apr 16 2012 Filip Andres <filip.andres@gooddata.com> - 0.4.1
- Initial packaging