Sophie

Sophie

distrib > Mageia > 7 > aarch64 > by-pkgid > 697519f57d70c513b21f8f03ee92575e > files > 3

erlang-lfe-1.3-2.mga7.src.rpm

%global realname lfe
%global upstream rvirding

# Set this to true when starting a rebuild of the whole erlang stack. There's a
# cyclical dependency between erlang-erts, erlang-lfe, and erlang-rebar so this
# package (erlang-lfe) needs to get built first in bootstrap mode.
%global need_bootstrap 0


%if 0%{?need_bootstrap}
%global _erllibdir %{_libdir}/erlang/lib
%global debug_package %{nil}
%endif


Name:		erlang-%{realname}
Version:	1.3
Release:	%mkrel 2
Summary:	Lisp Flavoured Erlang
Group:		Development/Erlang
License:	BSD
URL:		https://github.com/%{upstream}/%{realname}
%if 0%{?el7}%{?fedora}
VCS:		scm:git:https://github.com/%{upstream}/%{realname}.git
%endif
Source0:	https://github.com/%{upstream}/%{realname}/archive/%{version}/%{realname}-%{version}.tar.gz
Patch1:		erlang-lfe-0001-Remove-support-for-erlang-packages.patch
Patch2:		erlang-lfe-0002-Convert-to-proper-UTF-8.patch
%if 0%{?need_bootstrap}
BuildRequires:	erlang-erts
BuildRequires:	erlang-rpm-macros
%else
BuildRequires:	erlang-rebar
%endif
BuildRequires:	pkgconfig
BuildRequires:	emacs
BuildRequires:	emacs-el
BuildRequires:	gcc
Obsoletes:	emacs-erlang-lfe
Obsoletes:	emacs-erlang-lfe-el
%{?__erlang_drv_version:Requires: %{__erlang_drv_version}}


%description
Lisp Flavoured Erlang, is a lisp syntax front-end to the Erlang
compiler. Code produced with it is compatible with "normal" Erlang
code. An LFE evaluator and shell is also included.


%prep
%setup -q -n %{realname}-%{version}
%patch1 -p1 -b .no_erl_packages
%patch2 -p1 -b .proper_utf8


%build
%if 0%{?need_bootstrap}
mkdir -p ./ebin/
/usr/bin/erlc -o ./ebin/ src/*.erl
%else
mkdir -p ./ebin/
%{erlang_compile}
%endif
emacs -L emacs/ -batch -f batch-byte-compile emacs/inferior-lfe.el emacs/lfe-mode.el emacs/lfe-indent.el


%install
install -m 0755 -d %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/{bin,ebin,priv}
install -p -m 0755 -D ebin/* %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/ebin/
install -p -m 0755 -D bin/*  %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/bin/
%if 0%{?need_bootstrap}
echo "we are going to install only bare minimum of LFE - just for rebar bootstrapping"
%else
install -p -m 0755 priv/%{realname}_drv.so %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/priv/
%endif
install -m 0755 -d %{buildroot}/%{_bindir}
ln -s %{_libdir}/erlang/lib/%{realname}-%{version}/bin/{lfe,lfec,lfescript} %{buildroot}%{_bindir}/

mkdir -p %{buildroot}%{_emacs_sitelispdir}
mkdir -p %{buildroot}%{_emacs_sitestartdir}
install -p -m 0644 emacs/inferior-lfe.el %{buildroot}%{_emacs_sitelispdir}
install -p -m 0644 emacs/inferior-lfe.elc %{buildroot}%{_emacs_sitelispdir}
install -p -m 0644 emacs/lfe-mode.el %{buildroot}%{_emacs_sitelispdir}
install -p -m 0644 emacs/lfe-mode.elc %{buildroot}%{_emacs_sitelispdir}
install -p -m 0644 emacs/lfe-indent.el %{buildroot}%{_emacs_sitelispdir}
install -p -m 0644 emacs/lfe-indent.elc %{buildroot}%{_emacs_sitelispdir}
install -p -m 0644 emacs/lfe-start.el %{buildroot}%{_emacs_sitestartdir}


%check
%if 0%{?need_bootstrap}
echo "No tests during bootstrapping"
%else
#%%{erlang_test}
%endif


%files
%license LICENSE
%doc README.md doc/ examples/
%{_bindir}/lfe
%{_bindir}/lfec
%{_bindir}/lfescript
%{erlang_appdir}/
%{_emacs_sitelispdir}/inferior-lfe.el
%{_emacs_sitelispdir}/inferior-lfe.elc
%{_emacs_sitelispdir}/lfe-indent.el
%{_emacs_sitelispdir}/lfe-indent.elc
%{_emacs_sitelispdir}/lfe-mode.el
%{_emacs_sitelispdir}/lfe-mode.elc
%{_emacs_sitestartdir}/lfe-start.el


%changelog
* Sat Sep 22 2018 wally <wally> 1.3-2.mga7
  (not released yet)
+ Revision: 1296406
- disable bootstrap build

* Sat Sep 22 2018 wally <wally> 1.3-1.mga7
+ Revision: 1296372
- new version 1.3 (sync with Fedora)

* Tue Jul 05 2016 pterjan <pterjan> 1.0.2-3.mga6
+ Revision: 1039035
- Try fixing bootstrap...
- Try to bootstrap again

* Fri May 06 2016 neoclust <neoclust> 1.0.2-2.mga6
+ Revision: 1009764
- Rebuild post boostrap
- imported package erlang-lfe