File pie.spec of Package pie
%define bname pie
Name: %bname
Version: 1
Release: 8
Summary: Programmer's Interactive Editor
License: BSD-3-Clause
Group: Development/Tools/Other
URL: https://github.com/erlang-unicode/%bname
Source: %bname.tar.xz
Patch1: 0001-msc-replace-regexp-with-re.patch
Patch2: 0002-pie-replace-regexp-with-re.patch
BuildArch: noarch
Provides: erlang-%bname = %version-%release
BuildRequires: rpm-macros-erlang rpm-build-erlang
BuildRequires: erlang-otp-base >= R16B01
BuildRequires: rebar erl_interface eslang-devel erlang-parsetools erlang-parsetools-devel
%description
Emacs-like Erlang editor fully written in Erlang with S-Lang driver.
It is refined with built-in sync and lager.
Pie codebase is very tiny, clean and extendable.
%prep
%setup -q -n %bname
%patch1 -p1
%patch2 -p1
rm -f apps/{%bname/src/edit_{make,terminal_gterm},msc/src/syslog}.*
%build
erl -noshell -eval '
{ok, L} = file:consult("rebar.config"),
file:write_file("%bname.rebar.config",
lists:map(fun(E) -> io_lib:format("~p.~n", [E]) end,
[{erl_opts, [slim,inline,{i, "'"$PWD"'/apps"}|proplists:get_value(erl_opts, L, [])]}|proplists:delete(erl_opts, proplists:delete(deps, L))])),
halt().'
rebar -C %bname.rebar.config compile -v
%install
install -d -m 0755 %buildroot%_bindir
for i in %bname msc; do
install -d -m 0755 %buildroot%_otplibdir/$i-%version/ebin
install -p -m 0644 apps/$i/ebin/* %buildroot%_otplibdir/$i-%version/ebin/
done
install -p -m 0644 sys.config %buildroot%_otplibdir/%bname-%version/
cat > %buildroot%_bindir/%bname <<"__EOF__"
#!/bin/sh
erl +A 100 -config %_otplibdir/%bname-%version/sys.config -s pie start $@
stty sane
__EOF__
chmod 0755 %buildroot%_bindir/%bname
%files
%defattr(-,root,root)
%doc README*
%_bindir/*
%_otplibdir/*
%changelog
* Sun Jul 26 2015 Led <ledest@gmail.com> 1-8
- remove syslog module
* Thu Jul 02 2015 Led <ledest@gmail.com> 1-7
- fix BuildRequires
* Sun Apr 12 2015 Led <ledest@gmail.com> 1-6
- clean ups
- update BuildRequires
* Tue Mar 03 2015 Led <ledest@gmail.com> 1-5
- add erl_opts
* Tue Mar 03 2015 Led <ledest@gmail.com> 1-4
- added patches:
+ 0001-msc-replace-regexp-with-re.patch
+ 0002-pie-replace-regexp-with-re.patch
* Tue Mar 03 2015 Led <ledest@gmail.com> 1-3
- remove unneeded module edit_make
* Tue Mar 03 2015 Led <ledest@gmail.com> 1-2
- remove unneeded module edit_terminal_gterm
* Tue Mar 03 2015 Led <ledest@gmail.com> 1-1
- initial build