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