forked from pool/lua-moonscript
Fix update-alternatives
OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua-moonscript?expand=0&rev=7
This commit is contained in:
parent
292a39931f
commit
924e25959f
@ -61,6 +61,8 @@ BuildRequires: %{flavor}-busted
|
|||||||
Name: %{flavor}-moonscript
|
Name: %{flavor}-moonscript
|
||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
|
Requires(post): update-alternatives
|
||||||
|
Requires(postun): update-alternatives
|
||||||
|
|
||||||
%description
|
%description
|
||||||
A programmer friendly language that compiles to Lua.
|
A programmer friendly language that compiles to Lua.
|
||||||
@ -78,6 +80,26 @@ install -m 0755 -p -d %{buildroot}%{lua_noarchdir}
|
|||||||
cp -r -p moonscript %{buildroot}%{lua_noarchdir}
|
cp -r -p moonscript %{buildroot}%{lua_noarchdir}
|
||||||
cp -r -p moon %{buildroot}%{lua_noarchdir}
|
cp -r -p moon %{buildroot}%{lua_noarchdir}
|
||||||
install -D -m 0755 -p -t %{buildroot}%{_bindir} bin/moon{,c}
|
install -D -m 0755 -p -t %{buildroot}%{_bindir} bin/moon{,c}
|
||||||
|
|
||||||
|
# Alternatives
|
||||||
|
# create a dummy target for /etc/alternatives/vim
|
||||||
|
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
||||||
|
mv %{buildroot}%{_bindir}/moon{,-%{lua_version}}
|
||||||
|
mv %{buildroot}%{_bindir}/moonc{,-%{lua_version}}
|
||||||
|
ln -s -f %{_sysconfdir}/alternatives/moonc %{buildroot}%{_bindir}/moonc
|
||||||
|
ln -s -f %{_sysconfdir}/alternatives/moon %{buildroot}%{_bindir}/moon
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if ! %{with test}
|
||||||
|
%post
|
||||||
|
update-alternatives --force \
|
||||||
|
--install %{_bindir}/moon moon %{_bindir}/moon-%{lua_version} 15 \
|
||||||
|
--slave %{_bindir}/moonc moonc %{_bindir}/moonc-%{lua_version}
|
||||||
|
|
||||||
|
%postun
|
||||||
|
if [ -f %{_bindir}/moon-%{lua_version} ] ; then
|
||||||
|
update-alternatives --remove moon %{_bindir}/moon-%{lua_version}
|
||||||
|
fi
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%check
|
%check
|
||||||
|
Loading…
x
Reference in New Issue
Block a user