Build w/o erlang-rpm-macros subpackage (see review request in rhbz #652544)
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
This commit is contained in:
parent
7933a36ae9
commit
3f9a800e4f
6 changed files with 12 additions and 217 deletions
|
|
@ -1,24 +0,0 @@
|
|||
#!/usr/bin/escript
|
||||
%% -*- erlang -*-
|
||||
|
||||
main(EbinFiles) ->
|
||||
lists:foreach(
|
||||
fun(BeamFile) ->
|
||||
try
|
||||
{ok, {Module, [{exports,Exports}]}} = beam_lib:chunks(BeamFile, [exports]),
|
||||
case Module of
|
||||
eunit_test -> io:format ("erlang(eunit_test:nonexisting_function/0)~n");
|
||||
wx -> io:format ("erlang(demo:start/0)~n");
|
||||
_ -> ok
|
||||
end,
|
||||
lists:foreach( fun({ModFun,Arity})->io:format("erlang(~p:~s/~p)~n", [Module, ModFun,Arity]) end, Exports)
|
||||
catch
|
||||
_:_ ->
|
||||
ok
|
||||
end
|
||||
end,
|
||||
EbinFiles);
|
||||
|
||||
main(_) ->
|
||||
halt(1).
|
||||
|
||||
|
|
@ -1,98 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This script reads filenames from STDIN and outputs any relevant provides
|
||||
# information that needs to be included in the package.
|
||||
|
||||
BUILDDIR=
|
||||
|
||||
while true; do
|
||||
case "$1" in
|
||||
-b) BUILDDIR="$2"; shift 2;;
|
||||
--) shift; break;;
|
||||
*) echo "$0: option error at $1"; exit 1;;
|
||||
esac
|
||||
done
|
||||
|
||||
filelist=`sed "s/['\"]/\\\&/g"`
|
||||
|
||||
/usr/lib/rpm/rpmdeps --provides $filelist
|
||||
|
||||
# Get the list of *.app files
|
||||
appfiles=$(echo $filelist | tr [:blank:] '\n' | grep -o -E '.*/ebin/.*\.app$')
|
||||
|
||||
for f in $appfiles; do
|
||||
app=`cat $f | tr -d [:space:] | awk -F '{application,' '{print $2}'|cut -d , -f 1`
|
||||
ver=`cat $f | tr -d [:space:] | grep -o -E '\{vsn,\".*[0-9]\"\}' | sed -e "s,.vsn\,\",,g;s,\".,,g"`
|
||||
|
||||
# HiPE module is different from others
|
||||
if [ "$app" == "hipe" ] ;
|
||||
then
|
||||
# Hardcoded minimal set of HiPE exported functions
|
||||
echo "erlang(hipe_amd64_main:rtl_to_amd64/3)"
|
||||
echo "erlang(hipe_arm_main:rtl_to_arm/3)"
|
||||
echo "erlang(hipe:c/1)"
|
||||
echo "erlang(hipe:compile/4)"
|
||||
echo "erlang(hipe_data_pp:pp/4)"
|
||||
echo "erlang(hipe_icode2rtl:translate/2)"
|
||||
echo "erlang(hipe_icode_heap_test:cfg/1)"
|
||||
echo "erlang(hipe_ppc_main:rtl_to_ppc/3)"
|
||||
echo "erlang(hipe_rtl_arch:endianess/0)"
|
||||
echo "erlang(hipe_rtl_arch:nr_of_return_regs/0)"
|
||||
echo "erlang(hipe_rtl_arch:word_size/0)"
|
||||
echo "erlang(hipe_rtl_cfg:init/1)"
|
||||
echo "erlang(hipe_rtl_cfg:linearize/1)"
|
||||
echo "erlang(hipe_rtl_cfg:pp/1)"
|
||||
echo "erlang(hipe_rtl_cfg:remove_trivial_bbs/1)"
|
||||
echo "erlang(hipe_rtl_cfg:remove_unreachable_code/1)"
|
||||
echo "erlang(hipe_rtl_cleanup_const:cleanup/1)"
|
||||
echo "erlang(hipe_rtl_lcm:rtl_lcm/2)"
|
||||
echo "erlang(hipe_rtl_ssa_avail_expr:cfg/1)"
|
||||
echo "erlang(hipe_rtl_ssa:check/1)"
|
||||
echo "erlang(hipe_rtl_ssa_const_prop:propagate/1)"
|
||||
echo "erlang(hipe_rtl_ssa:convert/1)"
|
||||
echo "erlang(hipe_rtl_ssapre:rtl_ssapre/2)"
|
||||
echo "erlang(hipe_rtl_ssa:remove_dead_code/1)"
|
||||
echo "erlang(hipe_rtl_ssa:unconvert/1)"
|
||||
echo "erlang(hipe_rtl_symbolic:expand/1)"
|
||||
echo "erlang(hipe_sparc_main:rtl_to_sparc/3)"
|
||||
echo "erlang(hipe_tagscheme:fixnum_val/1)"
|
||||
echo "erlang(hipe_tagscheme:is_fixnum/1)"
|
||||
echo "erlang(hipe_x86_main:rtl_to_x86/3)"
|
||||
fi
|
||||
|
||||
echo "erlang($app) = $ver"
|
||||
done
|
||||
|
||||
# Check for two special cases by inspecting path to ebin directory
|
||||
basedirs=$(echo $filelist | tr [:blank:] '\n' | grep -o -E 'erlang\/lib\/[a-zA-Z_0-9]*-[0-9.]*\/ebin' | cut -d \/ -f 3 | sort | uniq)
|
||||
for bd in $basedirs; do
|
||||
basename=`echo $bd | cut -d \- -f 1`
|
||||
basever=`echo $bd | cut -d \- -f 2`
|
||||
case $basename in
|
||||
"erts")
|
||||
echo "erlang($basename) = $basever"
|
||||
|
||||
# BIFs from erts - this module is very specific
|
||||
cat $BUILDDIR/erts/emulator/*/erl_bif_list.h 2>/dev/null |\
|
||||
grep -v am__AtomAlias |\
|
||||
grep -o -E 'am_.*\,am_.*\,.\,' |\
|
||||
sed s,am_,,g |\
|
||||
sed -e "s,Plus,+,g;s,Minus,-,g;s,Neqeq,=\/=,g;s,Neq,\/=,g;s,Div,\/,g;s,Eqeq,=\:=,g;s,Eq,==,g;s,Ge,>=,g;s,Gt,>,g;s,Le,=<,g;s,Lt,<,g;s,Times,*,g;s,subtract,--,g;s,append\,,++\,,g" |\
|
||||
awk -F \, '{print "erlang(" $1 ":" $2 "/" $3 ")" }'
|
||||
|
||||
# Add BIFs for HiPE
|
||||
grep "bif " $BUILDDIR/erts/emulator/hipe/*.tab | awk -F "bif " '{print "erlang(" $2 ")"}'
|
||||
;;
|
||||
"wx")
|
||||
# wx module doesn't contain app-file.
|
||||
echo "erlang($basename) = $basever"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Get the list of *.beam files
|
||||
beamfiles=$(echo $filelist | tr [:blank:] '\n' | grep -o -E '.*/ebin/.*\.beam$')
|
||||
/usr/lib/rpm/erlang-find-provides.escript $beamfiles | sed s,\',,g
|
||||
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
#!/usr/bin/escript
|
||||
%% -*- erlang -*-
|
||||
|
||||
main(EbinFiles) ->
|
||||
lists:foreach(
|
||||
fun(BeamFile) ->
|
||||
try
|
||||
{ok, {_Module, [{imports,Imports}]}} = beam_lib:chunks(BeamFile, [imports]),
|
||||
lists:foreach( fun({ModName,ModFun,Arity})->io:format("erlang(~s:~s/~p)~n", [ModName,ModFun,Arity]) end, Imports)
|
||||
catch
|
||||
_:_ ->
|
||||
ok
|
||||
end
|
||||
end,
|
||||
EbinFiles);
|
||||
|
||||
main(_) ->
|
||||
halt(1).
|
||||
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This script reads filenames from STDIN and outputs any relevant requires
|
||||
# information that needs to be included in the package.
|
||||
|
||||
filelist=`sed "s/['\"]/\\\&/g"`
|
||||
|
||||
/usr/lib/rpm/rpmdeps --requires $filelist
|
||||
|
||||
# Get the list of *.app files
|
||||
appfiles=$(echo $filelist | tr [:blank:] '\n' | grep -o -E '.*/ebin/.*\.app$')
|
||||
|
||||
for f in $appfiles; do
|
||||
apps=`cat $f | tr -d [:space:] | grep -o -E '\{applications,\[.*[a-zA-Z0-9_]\]\}' | sed -e "s,.*\[,,g;s,\].*,,g;s.,. .g"`
|
||||
for a in $apps; do
|
||||
echo "erlang($a)"
|
||||
done
|
||||
done
|
||||
|
||||
# Get the list of *.beam files
|
||||
beamfiles=$(echo $filelist | tr [:blank:] '\n' | grep -o -E '.*/ebin/.*\.beam$')
|
||||
/usr/lib/rpm/erlang-find-requires.escript $beamfiles | sort | uniq
|
||||
|
||||
52
erlang.spec
52
erlang.spec
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
Name: erlang
|
||||
Version: %{upstream_ver}
|
||||
Release: %{upstream_rel}.3%{?dist}
|
||||
Release: %{upstream_rel}.4%{?dist}
|
||||
Summary: General-purpose programming language and runtime environment
|
||||
|
||||
Group: Development/Languages
|
||||
|
|
@ -19,11 +19,6 @@ Source0: http://www.erlang.org/download/otp_src_%{upstream_ver}.tar.gz
|
|||
Source1: http://erlang.org/download/otp_doc_html_R14B.tar.gz
|
||||
Source2: http://erlang.org/download/otp_doc_man_R14B.tar.gz
|
||||
%endif
|
||||
Source3: erlang-find-provides.escript
|
||||
Source4: erlang-find-provides.sh
|
||||
Source5: erlang-find-requires.escript
|
||||
Source6: erlang-find-requires.sh
|
||||
Source7: macros.erlang
|
||||
# Fedora-specific
|
||||
Patch1: otp-0001-Do-not-format-man-pages-and-do-not-install-miscellan.patch
|
||||
# Fedora-specific
|
||||
|
|
@ -110,9 +105,6 @@ Requires: erlang-percept = %{version}-%{release}
|
|||
Requires: erlang-pman = %{version}-%{release}
|
||||
Requires: erlang-public_key = %{version}-%{release}
|
||||
Requires: erlang-reltool = %{version}-%{release}
|
||||
%if 0%{?el6}%{?fedora}
|
||||
Requires: erlang-rpm-macros = %{version}-%{release}
|
||||
%endif
|
||||
Requires: erlang-runtime_tools = %{version}-%{release}
|
||||
Requires: erlang-sasl = %{version}-%{release}
|
||||
Requires: erlang-snmp = %{version}-%{release}
|
||||
|
|
@ -501,9 +493,15 @@ Group: Development/Languages
|
|||
Requires: %{name}-erts = %{version}-%{release}
|
||||
Obsoletes: %{name} < R13B-04.5
|
||||
%if 0%{?el4}%{?el5}
|
||||
#%if 0%{?el5}
|
||||
%if 0%{?el5}
|
||||
%ifarch %{ix86} x86_64
|
||||
BuildRequires: java-1.6.0-openjdk-devel
|
||||
%else
|
||||
BuildRequires: java-1.4.2-gcj-compat-devel
|
||||
#BuildRequires: java-1.5.0-gcj-devel
|
||||
%endif
|
||||
%else
|
||||
BuildRequires: java-1.4.2-gcj-compat-devel
|
||||
%endif
|
||||
%else
|
||||
BuildRequires: java-1.6.0-openjdk-devel
|
||||
%endif
|
||||
|
|
@ -688,16 +686,6 @@ dependencies and enables interactive customization of a
|
|||
target system. The backend provides a batch interface
|
||||
for generation of customized target systems.
|
||||
|
||||
%if 0%{?el6}%{?fedora}
|
||||
%package rpm-macros
|
||||
Summary: Necessary macros for building Erlang
|
||||
Group: Development/Languages
|
||||
Obsoletes: %{name} < R13B-04.5
|
||||
|
||||
%description rpm-macros
|
||||
Necessary macros for building Erlang.
|
||||
%endif
|
||||
|
||||
%package runtime_tools
|
||||
Summary: A set of tools to include in a production system
|
||||
Group: Development/Languages
|
||||
|
|
@ -1091,15 +1079,6 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/erlang/man/man3/win32reg.*
|
|||
# remove empty directory
|
||||
rm -r $RPM_BUILD_ROOT%{_libdir}/erlang/erts-*/man
|
||||
|
||||
%if 0%{?el6}%{?fedora}
|
||||
# Install RPM related files
|
||||
install -D -p -m 0755 %{SOURCE3} $RPM_BUILD_ROOT%{_rpmconfigdir}/erlang-find-provides.escript
|
||||
install -D -p -m 0755 %{SOURCE4} $RPM_BUILD_ROOT%{_rpmconfigdir}/erlang-find-provides.sh
|
||||
install -D -p -m 0755 %{SOURCE5} $RPM_BUILD_ROOT%{_rpmconfigdir}/erlang-find-requires.escript
|
||||
install -D -p -m 0755 %{SOURCE6} $RPM_BUILD_ROOT%{_rpmconfigdir}/erlang-find-requires.sh
|
||||
install -D -p -m 0644 %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.erlang
|
||||
%endif
|
||||
|
||||
# remove outdated script
|
||||
rm -f $RPM_BUILD_ROOT%{_libdir}/erlang/Install
|
||||
|
||||
|
|
@ -1721,16 +1700,6 @@ rm -rf $RPM_BUILD_ROOT
|
|||
%{_libdir}/erlang/man/man3/reltool.*
|
||||
%endif
|
||||
|
||||
%if 0%{?el6}%{?fedora}
|
||||
%files rpm-macros
|
||||
%defattr(-,root,root)
|
||||
%{_sysconfdir}/rpm/macros.erlang
|
||||
%{_rpmconfigdir}/erlang-find-provides.escript
|
||||
%{_rpmconfigdir}/erlang-find-provides.sh
|
||||
%{_rpmconfigdir}/erlang-find-requires.escript
|
||||
%{_rpmconfigdir}/erlang-find-requires.sh
|
||||
%endif
|
||||
|
||||
%files runtime_tools
|
||||
%defattr(-,root,root)
|
||||
%{_libdir}/erlang/lib/runtime_tools-*/
|
||||
|
|
@ -2246,6 +2215,9 @@ rm -rf $RPM_BUILD_ROOT
|
|||
|
||||
|
||||
%changelog
|
||||
* Mon Nov 15 2010 Peter Lemenkov <lemenkov@gmail.com> - R14B-0.4
|
||||
- No more dependent on erlang-rpm-macros sub-package
|
||||
|
||||
* Thu Nov 11 2010 Peter Lemenkov <lemenkov@gmail.com> - R14B-0.3
|
||||
- Remove pre-built stuff
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
# handy macros for erlang-related packages
|
||||
|
||||
%_erldir %{_libdir}/erlang
|
||||
%_erllibdir %{_erldir}/lib
|
||||
|
||||
%__erlang_provides %{_rpmconfigdir}/erlang-find-provides.sh -b %{_builddir}/%{buildsubdir} --
|
||||
%__erlang_requires %{_rpmconfigdir}/erlang-find-requires.sh
|
||||
|
||||
%__erlang_provides_requires \
|
||||
%global _use_internal_dependency_generator 0\
|
||||
%global __find_provides %__erlang_provides\
|
||||
%global __find_requires %__erlang_requires\
|
||||
%{nil}
|
||||
Loading…
Add table
Add a link
Reference in a new issue