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