openSUSE:Packaging Erlang
Build Service Tutorial 路 Tips & Tricks 路 Cross Distribution Howto 路 Packaging checks
Desktop menu categories 路 RPM Macros 路 Scriptlets 路 Init scripts 路 How to write good changes
Devel project
The devel project for Erlang packages is devel:languages:erlang.
Erlang Macros
%erlang_dir
Expands to %{_libdir}/erlang
%erlang_libdir
Expands to %{_libdir}/erlang/lib
%__erl
Will call the Erlang emulator /usr/bin/erl
Rebar Macros
Rebar is an erlang build tool. It has been replaced by rebar3. However some projects still use legacy rebar.
%__rebar
Will just call the /usr/bin/rebar binary.
%rebar
Is the macro which you will use more often. It sets CFLAGS, CXXFLAGS, FFLAGS and calls rebar.
%rebar_compile
Will use the above mentioned %rebar macro and call it with compile.
Rebar3
The problem with rebar3 is that it doesn't have have an SKIP_DEPS=true option like legacy rebar did. So it always tries to get the dependencies over the internet. Which neither possible nor allowed in the build service.
A solution to this is removing the lock file and patching the deps tuple out of the build file.
However we are trying to discuss with upstream how to make this easier. See:
- https://github.com/erlang/rebar3/issues/1855
- https://github.com/erlang/rebar3/pull/2643
- https://github.com/erlang/rebar3/issues/1281
rebar3 maintainers also think about adding an vendoring option (like we use for e.g. Rust and Go packaging):