- more todo
[packages/erlang.git] / erlang.spec
1 # NOTE: Building requires working DNS setup. Build may hang
2 #       even if _only_ first dns specified in resolv.conf
3 #       is unreachable.
4 # TODO
5 # - separate -devel (at least header files!)
6 # - modularize (odbc, etc)
7 # - manuals to %{_mandir}
8 #
9 # Conditional build:
10 %bcond_with     java            # with Java support
11 %bcond_without  odbc            # without unixODBC support
12 #
13 Summary:        OpenSource Erlang/OTP
14 Summary(pl):    Erlang/OTP z otwartymi ¼ród³ami
15 Name:           erlang
16 Version:        R11B_0
17 Release:        1
18 Epoch:          1
19 %define         _version        %(echo %{version} | tr _ -)
20 License:        distributable
21 Group:          Development/Languages
22 Source0:        http://www.erlang.org/download/otp_src_%{_version}.tar.gz
23 # Source0-md5:  367d9d3ba979cd278b78d6d0393982ba
24 Source1:        http://www.erlang.org/download/otp_doc_man_R11B-0.tar.gz
25 # Source1-md5:  172591538db42e81b814a77f30da4fa4
26 Patch0:         %{name}-fPIC.patch
27 Patch1:         %{name}-optional_java.patch
28 Patch2:         %{name}-hipe_optimistic_regalloc_once_only.patch
29 URL:            http://www.erlang.org/
30 %{?with_java:BuildRequires:     /usr/bin/jar}
31 BuildRequires:  xorg-lib-libX11-devel
32 BuildRequires:  autoconf
33 BuildRequires:  automake
34 BuildRequires:  flex
35 %{?with_java:BuildRequires:     jdk >= 1.2}
36 BuildRequires:  ncurses-devel
37 BuildRequires:  openssl-devel >= 0.9.7
38 Buildrequires:  openssl-tools
39 BuildRequires:  perl-base
40 %if %{with odbc}
41 BuildRequires:  unixODBC-devel
42 %else
43 BuildConflicts: unixODBC-devel
44 %endif
45 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46
47 %define _erl_target %(echo %{_build} | sed -e's/amd64/x86_64/;s/athlon/i686/;s/ppc/powerpc/')
48
49 %description
50 Erlang is a programming language designed at the Ericsson Computer
51 Science Laboratory. Open-source Erlang is being released to help
52 encourage the spread of Erlang outside Ericsson.
53
54 %description -l pl
55 Erlang to jêzyk programowania opracowany w Ericsson Computer Science
56 Laboratory. Open-source Erlang zosta³ wydany, aby pomóc w
57 rozpowszechnianiu Erlanga poza Ericssonem.
58
59 %prep
60 %setup -q -n otp_src_%{_version}
61 %{__tar} xzf %{SOURCE1} man/ COPYRIGHT
62 #%patch0 -p1
63 %patch1 -p1
64 %patch2 -p1
65
66 %build
67 find . -name config.sub | xargs -n 1 cp -f /usr/share/automake/config.sub
68 %{__autoconf}
69 cd lib
70 %{__autoconf}
71 cd erl_interface
72 %{__autoconf}
73 cd ../gs
74 %{__autoconf}
75 cd ../megaco
76 %{__autoconf}
77 cd ../odbc
78 %{__autoconf}
79 cd ../snmp
80 %{__autoconf}
81 cd ../../erts/
82 %{__autoconf}
83 cd ..
84 %configure \
85         --with%{!?with_java:out}-java
86 ERL_TOP=`pwd`; export ERL_TOP
87  %{__make} \
88         TARGET="%{_erl_target}" \
89         || { find . -name erl_crash.dump | xargs cat ; exit 1 ; }
90
91 %install
92 rm -rf $RPM_BUILD_ROOT
93
94 %{__make} install \
95         TARGET="%{_erl_target}" \
96         INSTALL_PREFIX=$RPM_BUILD_ROOT
97
98 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/erts-*/*.html
99
100 sed -i -e"s#$RPM_BUILD_ROOT##" \
101         $RPM_BUILD_ROOT%{_libdir}/%{name}/bin/{erl,start,start_erl}
102
103 for l in erl erlc dialyzer epmd run_erl to_erl ; do
104         ln -sf %{_libdir}/%{name}/bin/$l $RPM_BUILD_ROOT%{_bindir}
105 done
106 ERTSDIR=`echo $RPM_BUILD_ROOT%{_libdir}/%{name}/erts-* | sed -e"s#^$RPM_BUILD_ROOT##"`
107 for l in ear ecc elink escript ; do
108         ln -sf $ERTSDIR/bin/$l $RPM_BUILD_ROOT%{_bindir}
109 done
110 ln -sf $ERTSDIR/bin/epmd $RPM_BUILD_ROOT%{_libdir}/%{name}/bin
111
112 cp -r man $RPM_BUILD_ROOT%{_libdir}/%{name}
113 find $RPM_BUILD_ROOT%{_libdir}/%{name}/man -type f | xargs gzip -9
114
115 # some files in the library need +x, so we build the list here
116 echo "%%defattr(644,root,root,755)" > lib.list
117 find $RPM_BUILD_ROOT%{_libdir}/%{name}/lib -type d \
118         | sed -e"s#^$RPM_BUILD_ROOT%{_libdir}/%{name}/#%%dir %%{_libdir}/%%{name}/#" >> lib.list
119 find $RPM_BUILD_ROOT%{_libdir}/%{name}/lib -type f -perm -500 \
120         | sed -e"s#^$RPM_BUILD_ROOT%{_libdir}/%{name}/#%%attr(755,root,root) %%{_libdir}/%%{name}/#" >> lib.list
121 find $RPM_BUILD_ROOT%{_libdir}/%{name}/lib -type f '!' -perm -500 \
122         | sed -e"s#^$RPM_BUILD_ROOT%{_libdir}/%{name}/#%%{_libdir}/%%{name}/#" >> lib.list
123
124 rm -rf $RPM_BUILD_ROOT%{_libdir}/%{name}/erts-*/lib
125 rm -rf $RPM_BUILD_ROOT%{_libdir}/%{name}/erts-*/include/internal
126
127 %clean
128 rm -rf $RPM_BUILD_ROOT
129
130 %files -f lib.list
131 %defattr(644,root,root,755)
132 %doc AUTHORS EPLICENCE README COPYRIGHT
133 %attr(755,root,root) %{_bindir}/*
134 %dir %{_libdir}/erlang
135 %dir %{_libdir}/%{name}/bin
136 %attr(755,root,root) %{_libdir}/%{name}/bin/dialyzer
137 %attr(755,root,root) %{_libdir}/%{name}/bin/epmd
138 %attr(755,root,root) %{_libdir}/%{name}/bin/erl
139 %attr(755,root,root) %{_libdir}/%{name}/bin/erlc
140 %attr(755,root,root) %{_libdir}/%{name}/bin/run_erl
141 %attr(755,root,root) %{_libdir}/%{name}/bin/start
142 %attr(755,root,root) %{_libdir}/%{name}/bin/start_erl
143 %attr(755,root,root) %{_libdir}/%{name}/bin/to_erl
144 %{_libdir}/%{name}/bin/start*.*
145 %dir %{_libdir}/%{name}/erts-*
146 %{_libdir}/%{name}/erts-*/doc
147 %{_libdir}/%{name}/erts-*/man
148 %{_libdir}/%{name}/erts-*/src
149 %{_libdir}/%{name}/erts-*/include
150 #%{_libdir}/%{name}/erts-*/*.ear
151 %dir %{_libdir}/%{name}/erts-*/bin
152 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/beam*
153 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/child*
154 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/dialyzer
155 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/e*
156 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/heart*
157 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/inet_gethost
158 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/run_erl
159 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/start
160 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/to_erl
161 %{_libdir}/%{name}/erts-*/bin/start*.*
162 # (file list dynamically generated) %{_libdir}/%{name}/lib
163 %dir %{_libdir}/%{name}/misc
164 %attr(755,root,root) %{_libdir}/%{name}/misc/*
165 %{_libdir}/%{name}/releases
166 %{_libdir}/%{name}/usr
167 %doc %{_libdir}/%{name}/man
168 %attr(755,root,root) %{_libdir}/%{name}/Install
This page took 0.053666 seconds and 3 git commands to generate.