138 lines
4.2 KiB
Plaintext
138 lines
4.2 KiB
Plaintext
#
|
|
# spec file for package erlang-rebar
|
|
#
|
|
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
|
#
|
|
# 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 http://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
%define obs OBS
|
|
|
|
%if 0%{?obs}
|
|
Name: erlang-rebar-obs
|
|
%else
|
|
Name: erlang-rebar
|
|
%endif
|
|
Version: 2.2.0+git20140416.8edaa08
|
|
Release: 0
|
|
%define mod_ver %(echo "%{version}" | cut -d "+" -f1)
|
|
Summary: A sophisticated build-tool for Erlang projects that follows OTP principles
|
|
License: Apache-2.0
|
|
Group: Development/Tools/Building
|
|
Url: https://github.com/rebar/rebar
|
|
Source: rebar-%{version}.tar.bz2
|
|
Source1: macros.erlang-rebar
|
|
Patch1: no-rebar-deps.patch
|
|
Patch2: tdeps_update-retest.patch
|
|
Patch3: 0001-Find-all-deps-locally-first.patch
|
|
Patch4: 0002-Read-vsn-from-file.patch
|
|
BuildRequires: erlang >= R13B01
|
|
Requires: erlang >= R13B01
|
|
Provides: rebar = %{version}
|
|
Obsoletes: rebar < %{version}
|
|
%if 0%{?obs}
|
|
Conflicts: erlang-rebar
|
|
Requires: this-is-only-for-build-envs
|
|
%else
|
|
Conflicts: erlang-rebar-obs
|
|
# for 'make test'
|
|
BuildRequires: erlang-reltool
|
|
BuildRequires: erlang-retest
|
|
BuildRequires: git
|
|
BuildRequires: mercurial
|
|
%endif
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
%if 0%{?suse_version}
|
|
%if 1%{?erlang_libdir:0}
|
|
%define erlang_libdir %{_libdir}/erlang/lib
|
|
%endif
|
|
%endif
|
|
|
|
%description
|
|
rebar is an Erlang build tool that makes it easy to compile and
|
|
test Erlang applications, port drivers and releases.
|
|
|
|
rebar is a self-contained Erlang script, so it's easy to distribute or even
|
|
embed directly in a project. Where possible, rebar uses standard Erlang/OTP
|
|
conventions for project structures, thus minimizing the amount of build
|
|
configuration work. rebar also provides dependency management, enabling
|
|
application writers to easily re-use common libraries from a variety of
|
|
locations (git, hg, etc).
|
|
|
|
%package src
|
|
Summary: A sophisticated build-tool for Erlang projects that follows OTP principles
|
|
Group: Development/Libraries/Other
|
|
Requires: %{name} = %{version}
|
|
Provides: %{name}-devel = %{version}
|
|
Obsoletes: %{name}-devel < %{version}
|
|
|
|
%description src
|
|
rebar is an Erlang build tool that makes it easy to compile and
|
|
test Erlang applications, port drivers and releases.
|
|
|
|
%prep
|
|
%setup -q -n rebar-%{version}
|
|
%patch1 -p1
|
|
%patch2 -p1
|
|
%if 0%{?obs}
|
|
%patch3 -p1
|
|
%patch4 -p1
|
|
%endif
|
|
|
|
%build
|
|
make
|
|
make deps
|
|
|
|
%install
|
|
install -Dm755 rebar %{buildroot}%{_bindir}/rebar
|
|
# Install RPM macros:
|
|
install -Dm644 %{SOURCE1} %{buildroot}%{_sysconfdir}/rpm/macros.erlang-rebar
|
|
for dir in include ebin priv src ; do
|
|
install -d %{buildroot}%{erlang_libdir}/rebar-%{mod_ver}/${dir}
|
|
cp -r ${dir}/* %{buildroot}%{erlang_libdir}/rebar-%{mod_ver}/${dir}/
|
|
done
|
|
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d
|
|
ln -s %{erlang_libdir}/rebar-%{mod_ver}/priv/shell-completion/bash/rebar %{buildroot}%{_sysconfdir}/bash_completion.d/rebar.sh
|
|
|
|
%check
|
|
# rebar is not compatible with hg 1.0.2 delivered by SLE <= 11
|
|
# these checks will thus fail -> delete them
|
|
%if 0%{?sles_version} > 0 && %{?sles_version} <= 11
|
|
rm -rf inttest/tdeps1
|
|
rm -rf inttest/tdeps2
|
|
%endif
|
|
%if 0%{?obs}
|
|
# do not run tests for erlang-rebar-obs
|
|
true
|
|
%else
|
|
make test
|
|
%endif
|
|
|
|
%files
|
|
%defattr(-,root,root)
|
|
%doc README.md THANKS LICENSE rebar.config.sample
|
|
%{_bindir}/rebar
|
|
%config %{_sysconfdir}/rpm/macros.erlang-rebar
|
|
%dir %{erlang_libdir}/rebar-%{mod_ver}
|
|
%{erlang_libdir}/rebar-%{mod_ver}/ebin
|
|
%{erlang_libdir}/rebar-%{mod_ver}/include
|
|
%{erlang_libdir}/rebar-%{mod_ver}/priv
|
|
%{_sysconfdir}/bash_completion.d/rebar.sh
|
|
|
|
%files src
|
|
%defattr(-,root,root)
|
|
%{erlang_libdir}/rebar-%{mod_ver}/src
|
|
|
|
%changelog
|