openSUSE:Packaging Erlang

Jump to: navigation, search


The Packaging Erlang is a step by step introduction on how to build Erlang software packages for openSUSE openSUSE Build Service.

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:

rebar3 maintainers also think about adding an vendoring option (like we use for e.g. Rust and Go packaging):