f1eae761aacfa96ab8ed25f370f0f7edbb828255
[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:        21.1
18 Release:        2
19 Epoch:          2
20 %define         _version        %(echo %{version} | tr _ -)
21 License:        APLv2
22 Group:          Development/Languages
23 Source0:        http://www.erlang.org/download/otp_src_%{_version}.tar.gz
24 # Source0-md5:  482f91cf34c2ffb1dff6e716a15afefa
25 Source1:        http://www.erlang.org/download/otp_doc_man_%{_version}.tar.gz
26 # Source1-md5:  53b7ce5694da49f3bddadc4d0fafd94c
27 Source2:        epmd.service
28 Source3:        epmd.socket
29 Source4:        epmd@.service
30 Source5:        epmd@.socket
31 Patch0:         %{name}-fPIC.patch
32 Patch1:         x32.patch
33 URL:            http://www.erlang.org/
34 %{?with_java:BuildRequires:     /usr/bin/jar}
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 BuildRequires:  xorg-lib-libX11-devel
44 %if %{with odbc}
45 BuildRequires:  unixODBC-devel
46 %else
47 BuildConflicts: unixODBC-devel
48 %endif
49 Requires:       systemd-units >= 38
50 Requires(post,preun,postun):    systemd-units >= 38
51 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52
53 %define _erl_target %(echo %{_build}%{?_gnu} | sed -e's/amd64/x86_64/;s/athlon/i686/;s/ppc/powerpc/;s/x32/x86_64/')
54
55 %description
56 Erlang is a programming language designed at the Ericsson Computer
57 Science Laboratory. Open-source Erlang is being released to help
58 encourage the spread of Erlang outside Ericsson.
59
60 %description -l pl.UTF-8
61 Erlang to język programowania opracowany w Ericsson Computer Science
62 Laboratory. Open-source Erlang został wydany, aby pomóc w
63 rozpowszechnianiu Erlanga poza Ericssonem.
64
65 %prep
66 %setup -q -n otp_src_%{_version}
67 %{__tar} xzf %{SOURCE1} man/ COPYRIGHT
68 #%patch0 -p1
69 %patch1 -p1
70
71 %build
72 find . -name config.sub | xargs -n 1 cp -f /usr/share/automake/config.sub
73 curd=$(pwd)
74 for i in $(find . -type f -name configure.in); do
75         cd $(dirname $i)
76         %{__autoconf}
77         cd $curd
78 done
79 %configure \
80 %ifarch sparc
81         CFLAGS="%{rpmcflags} -mv8plus" \
82 %endif
83 %ifarch x32
84         --disable-hipe \
85 %endif
86         --disable-silent-rules \
87         --enable-smp-support \
88         --with-javac%{!?with_java:=no}
89 rm -f lib/ssl/SKIP
90 ERL_TOP=`pwd`; export ERL_TOP
91  %{__make} -j1 \
92         TARGET="%{_erl_target}" \
93         || { find . -name erl_crash.dump | xargs cat ; exit 1 ; }
94
95 %install
96 rm -rf $RPM_BUILD_ROOT
97
98 %{__make} -j1 install \
99         TARGET="%{_erl_target}" \
100         INSTALL_PREFIX=$RPM_BUILD_ROOT
101
102 install -D -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/epmd.service
103 install -D -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/epmd.socket
104 install -D -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/epmd@.service
105 install -D -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/epmd@.socket
106
107 sed -i -e"s#$RPM_BUILD_ROOT##" \
108         $RPM_BUILD_ROOT%{_libdir}/%{name}/bin/{erl,start,start_erl}
109
110 cp -r man $RPM_BUILD_ROOT%{_libdir}/%{name}
111 find $RPM_BUILD_ROOT%{_libdir}/%{name}/man -type f | xargs gzip -9
112
113 # some files in the library need +x, so we build the list here
114 echo "%%defattr(644,root,root,755)" > lib.list
115 find $RPM_BUILD_ROOT%{_libdir}/%{name}/lib -type d \
116         | sed -e"s#^$RPM_BUILD_ROOT%{_libdir}/%{name}/#%%dir %%{_libdir}/%%{name}/#" >> lib.list
117 find $RPM_BUILD_ROOT%{_libdir}/%{name}/lib -type f -perm -500 \
118         | sed -e"s#^$RPM_BUILD_ROOT%{_libdir}/%{name}/#%%attr(755,root,root) %%{_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}/#%%{_libdir}/%%{name}/#" >> lib.list
121
122 %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/erts-*/lib
123 %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/erts-*/include/internal
124
125 %clean
126 rm -rf $RPM_BUILD_ROOT
127
128 %post
129 %systemd_post epmd.service
130 %systemd_post epmd@.service
131
132 %preun
133 %systemd_preun epmd.service
134 %systemd_preun epmd@.service
135
136 %postun
137 %systemd_reload
138
139 %files -f lib.list
140 %defattr(644,root,root,755)
141 %doc AUTHORS COPYRIGHT
142 %attr(755,root,root) %{_bindir}/ct_run
143 %attr(755,root,root) %{_bindir}/dialyzer
144 %attr(755,root,root) %{_bindir}/epmd
145 %attr(755,root,root) %{_bindir}/erl
146 %attr(755,root,root) %{_bindir}/erlc
147 %attr(755,root,root) %{_bindir}/escript
148 %attr(755,root,root) %{_bindir}/run_erl
149 %attr(755,root,root) %{_bindir}/to_erl
150 %attr(755,root,root) %{_bindir}/typer
151 %dir %{_libdir}/erlang
152 %dir %{_libdir}/%{name}/bin
153 %attr(755,root,root) %{_libdir}/%{name}/bin/ct_run
154 %attr(755,root,root) %{_libdir}/%{name}/bin/dialyzer
155 %attr(755,root,root) %{_libdir}/%{name}/bin/epmd
156 %attr(755,root,root) %{_libdir}/%{name}/bin/erl
157 %attr(755,root,root) %{_libdir}/%{name}/bin/erlc
158 %attr(755,root,root) %{_libdir}/%{name}/bin/escript
159 %attr(755,root,root) %{_libdir}/%{name}/bin/no_dot_erlang.boot
160 %attr(755,root,root) %{_libdir}/%{name}/bin/run_erl
161 %attr(755,root,root) %{_libdir}/%{name}/bin/start
162 %attr(755,root,root) %{_libdir}/%{name}/bin/start_erl
163 %attr(755,root,root) %{_libdir}/%{name}/bin/to_erl
164 %attr(755,root,root) %{_libdir}/%{name}/bin/typer
165 %{_libdir}/%{name}/bin/start*.*
166 %dir %{_libdir}/%{name}/erts-*
167 %{_libdir}/%{name}/erts-*/doc
168 %{_libdir}/%{name}/erts-*/man
169 %{_libdir}/%{name}/erts-*/src
170 %{_libdir}/%{name}/erts-*/include
171 #%{_libdir}/%{name}/erts-*/*.ear
172 %dir %{_libdir}/%{name}/erts-*/bin
173 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/beam*
174 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/ct_run
175 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/dialyzer
176 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/dyn_erl
177 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/e*
178 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/heart*
179 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/inet_gethost
180 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/run_erl
181 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/start
182 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/to_erl
183 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/typer
184 %{_libdir}/%{name}/erts-*/bin/start*.*
185 # (file list dynamically generated) %{_libdir}/%{name}/lib
186 %dir %{_libdir}/%{name}/misc
187 %attr(755,root,root) %{_libdir}/%{name}/misc/*
188 %{_libdir}/%{name}/releases
189 %{_libdir}/%{name}/usr
190 %doc %{_libdir}/%{name}/man
191 %attr(755,root,root) %{_libdir}/%{name}/Install
192
193 %{systemdunitdir}/epmd.service
194 %{systemdunitdir}/epmd.socket
195 %{systemdunitdir}/epmd@.service
196 %{systemdunitdir}/epmd@.socket
This page took 0.046437 seconds and 2 git commands to generate.