]>
Commit | Line | Data |
---|---|---|
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 | ||
15 | %define erts_version 13.1.2 | |
16 | ||
17 | Summary: OpenSource Erlang/OTP | |
18 | Summary(pl.UTF-8): Erlang/OTP z otwartymi źródłami | |
19 | Name: erlang | |
20 | Version: 25.1.2 | |
21 | Release: 1 | |
22 | Epoch: 2 | |
23 | %define _version %(echo %{version} | tr _ -) | |
24 | License: APLv2 | |
25 | Group: Development/Languages | |
26 | Source0: https://github.com/erlang/otp/archive/OTP-%{version}.tar.gz | |
27 | # Source0-md5: ac654a239f8e9c3514b183c657bca4bf | |
28 | Source2: epmd.service | |
29 | Source3: epmd.socket | |
30 | Source4: epmd@.service | |
31 | Source5: epmd@.socket | |
32 | Patch0: %{name}-fPIC.patch | |
33 | Patch1: x32.patch | |
34 | # disable pdf docs (require libxslt-progs and fop > 1.0, with -cache option) | |
35 | Patch2: %{name}-no-fop.patch | |
36 | ||
37 | Patch4: %{name}-ac.patch | |
38 | URL: http://www.erlang.org/ | |
39 | %{?with_java:BuildRequires: /usr/bin/jar} | |
40 | BuildRequires: autoconf >= 2.69 | |
41 | BuildRequires: automake | |
42 | BuildRequires: flex | |
43 | %{?with_java:BuildRequires: jdk >= 1.2} | |
44 | BuildRequires: ncurses-devel | |
45 | BuildRequires: openssl-devel >= 0.9.7 | |
46 | BuildRequires: openssl-tools | |
47 | BuildRequires: perl-base | |
48 | BuildRequires: rpm-build >= 4.6 | |
49 | BuildRequires: rpmbuild(macros) >= 1.752 | |
50 | BuildRequires: xorg-lib-libX11-devel | |
51 | %if %{with odbc} | |
52 | BuildRequires: unixODBC-devel | |
53 | %else | |
54 | BuildConflicts: unixODBC-devel | |
55 | %endif | |
56 | Requires: systemd-units >= 38 | |
57 | Requires(post,preun,postun): systemd-units >= 38 | |
58 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
59 | ||
60 | %define _erl_target %(echo %{_build}%{?_gnu} | sed -e's/amd64/x86_64/;s/athlon/i686/;s/ppc/powerpc/;s/x32/x86_64/') | |
61 | ||
62 | %description | |
63 | Erlang is a programming language designed at the Ericsson Computer | |
64 | Science Laboratory. Open-source Erlang is being released to help | |
65 | encourage the spread of Erlang outside Ericsson. | |
66 | ||
67 | %description -l pl.UTF-8 | |
68 | Erlang to język programowania opracowany w Ericsson Computer Science | |
69 | Laboratory. Open-source Erlang został wydany, aby pomóc w | |
70 | rozpowszechnianiu Erlanga poza Ericssonem. | |
71 | ||
72 | %package doc | |
73 | Summary: Erlang documentation | |
74 | Summary(pl.UTF-8): Dokumentacja do Erlanga | |
75 | Group: Documentation | |
76 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
77 | BuildArch: noarch | |
78 | ||
79 | %description doc | |
80 | Erlang documentation. | |
81 | ||
82 | %description doc -l pl.UTF-8 | |
83 | Dokumentacja do Erlanga. | |
84 | ||
85 | %prep | |
86 | %setup -q -n otp-OTP-%{_version} | |
87 | #%patch0 -p1 | |
88 | %patch1 -p1 | |
89 | %patch2 -p1 | |
90 | ||
91 | %patch4 -p1 | |
92 | ||
93 | %build | |
94 | ./otp_build update_configure --no-commit | |
95 | ||
96 | %configure \ | |
97 | %ifarch sparc | |
98 | CFLAGS="%{rpmcflags} -mv8plus" \ | |
99 | %endif | |
100 | %ifarch x32 | |
101 | --disable-hipe \ | |
102 | %endif | |
103 | --disable-silent-rules \ | |
104 | --enable-smp-support \ | |
105 | --with-javac%{!?with_java:=no} \ | |
106 | --with-ssl-lib-subdir=%{_lib} | |
107 | ||
108 | rm -f lib/ssl/SKIP | |
109 | ERL_TOP=`pwd`; export ERL_TOP | |
110 | %{__make} -j1 \ | |
111 | TARGET="%{_erl_target}" \ | |
112 | || { find . -name erl_crash.dump | xargs cat ; exit 1 ; } | |
113 | ||
114 | %{__make} -j1 docs | |
115 | ||
116 | %install | |
117 | rm -rf $RPM_BUILD_ROOT | |
118 | ||
119 | %{__make} -j1 install \ | |
120 | TARGET="%{_erl_target}" \ | |
121 | INSTALL_PREFIX=$RPM_BUILD_ROOT | |
122 | ||
123 | env ERL_LIBS="$RPM_BUILD_ROOT%{_libdir}/erlang/lib" \ | |
124 | %{__make} install-docs \ | |
125 | DESTDIR=$RPM_BUILD_ROOT | |
126 | ||
127 | install -D -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/epmd.service | |
128 | install -D -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/epmd.socket | |
129 | install -D -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/epmd@.service | |
130 | install -D -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/epmd@.socket | |
131 | ||
132 | %{__sed} -i -e"s#$RPM_BUILD_ROOT##" \ | |
133 | $RPM_BUILD_ROOT%{_libdir}/%{name}/bin/{erl,start,start_erl} | |
134 | ||
135 | %{__sed} -i -e '1s,/usr/bin/env escript,/usr/bin/escript,' \ | |
136 | $RPM_BUILD_ROOT%{_libdir}/%{name}/lib/diameter-*/bin/diameterc \ | |
137 | $RPM_BUILD_ROOT%{_libdir}/%{name}/lib/edoc-*/bin/edoc \ | |
138 | $RPM_BUILD_ROOT%{_libdir}/%{name}/lib/erl_docgen-*/priv/bin/{codeline_preprocessing,xml_from_edoc}.escript \ | |
139 | $RPM_BUILD_ROOT%{_libdir}/%{name}/lib/reltool-*/examples/{display_args,mnesia_core_dump_viewer} \ | |
140 | $RPM_BUILD_ROOT%{_libdir}/%{name}/lib/snmp-*/bin/snmpc \ | |
141 | $RPM_BUILD_ROOT%{_libdir}/%{name}/lib/snmp-*/src/compiler/snmpc.src | |
142 | ||
143 | #cp -r man $RPM_BUILD_ROOT%{_libdir}/%{name} | |
144 | #find $RPM_BUILD_ROOT%{_libdir}/%{name}/man -type f | xargs gzip -9 | |
145 | ||
146 | # some files in the library need +x, so we build the list here | |
147 | echo "%%defattr(644,root,root,755)" > lib.list | |
148 | find $RPM_BUILD_ROOT%{_libdir}/%{name}/lib -type d \ | |
149 | | %{__sed} -e"s#^$RPM_BUILD_ROOT%{_libdir}/%{name}/#%%dir %%{_libdir}/%%{name}/#" >> lib.list | |
150 | find $RPM_BUILD_ROOT%{_libdir}/%{name}/lib -type f -perm -500 \ | |
151 | | %{__sed} -e"s#^$RPM_BUILD_ROOT%{_libdir}/%{name}/#%%attr(755,root,root) %%{_libdir}/%%{name}/#" >> lib.list | |
152 | find $RPM_BUILD_ROOT%{_libdir}/%{name}/lib -type f '!' -perm -500 \ | |
153 | | %{__sed} -e"s#^$RPM_BUILD_ROOT%{_libdir}/%{name}/#%%{_libdir}/%%{name}/#" >> lib.list | |
154 | ||
155 | # Move noarch docs to _datadir | |
156 | install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/erts-%{erts_version} | |
157 | %{__mv} $RPM_BUILD_ROOT{%{_libdir},%{_datadir}}/%{name}/doc | |
158 | %{__ln} -s %{_datadir}/%{name}/doc $RPM_BUILD_ROOT%{_libdir}/%{name}/doc | |
159 | %{__mv} $RPM_BUILD_ROOT{%{_libdir},%{_datadir}}/%{name}/erts-%{erts_version}/doc | |
160 | %{__ln} -s %{_datadir}/%{name}/erts-%{erts_version}/doc $RPM_BUILD_ROOT%{_libdir}/%{name}/erts-%{erts_version}/doc | |
161 | ||
162 | %clean | |
163 | rm -rf $RPM_BUILD_ROOT | |
164 | ||
165 | %post | |
166 | %systemd_post epmd.service | |
167 | %systemd_post epmd@.service | |
168 | ||
169 | %preun | |
170 | %systemd_preun epmd.service | |
171 | %systemd_preun epmd@.service | |
172 | ||
173 | %postun | |
174 | %systemd_reload | |
175 | ||
176 | %files -f lib.list | |
177 | %defattr(644,root,root,755) | |
178 | %doc AUTHORS | |
179 | %attr(755,root,root) %{_bindir}/ct_run | |
180 | %attr(755,root,root) %{_bindir}/dialyzer | |
181 | %attr(755,root,root) %{_bindir}/epmd | |
182 | %attr(755,root,root) %{_bindir}/erl | |
183 | %attr(755,root,root) %{_bindir}/erlc | |
184 | %attr(755,root,root) %{_bindir}/escript | |
185 | %attr(755,root,root) %{_bindir}/run_erl | |
186 | %attr(755,root,root) %{_bindir}/to_erl | |
187 | %attr(755,root,root) %{_bindir}/typer | |
188 | %dir %{_libdir}/erlang | |
189 | %dir %{_libdir}/%{name}/bin | |
190 | %attr(755,root,root) %{_libdir}/%{name}/bin/ct_run | |
191 | %attr(755,root,root) %{_libdir}/%{name}/bin/dialyzer | |
192 | %attr(755,root,root) %{_libdir}/%{name}/bin/epmd | |
193 | %attr(755,root,root) %{_libdir}/%{name}/bin/erl | |
194 | %attr(755,root,root) %{_libdir}/%{name}/bin/erl_call | |
195 | %attr(755,root,root) %{_libdir}/%{name}/bin/erlc | |
196 | %attr(755,root,root) %{_libdir}/%{name}/bin/escript | |
197 | %attr(755,root,root) %{_libdir}/%{name}/bin/no_dot_erlang.boot | |
198 | %attr(755,root,root) %{_libdir}/%{name}/bin/run_erl | |
199 | %attr(755,root,root) %{_libdir}/%{name}/bin/start | |
200 | %attr(755,root,root) %{_libdir}/%{name}/bin/start_erl | |
201 | %attr(755,root,root) %{_libdir}/%{name}/bin/to_erl | |
202 | %attr(755,root,root) %{_libdir}/%{name}/bin/typer | |
203 | %{_libdir}/%{name}/bin/start*.* | |
204 | %dir %{_libdir}/%{name}/erts-%{erts_version} | |
205 | %{_libdir}/%{name}/erts-%{erts_version}/info | |
206 | %{_libdir}/%{name}/erts-%{erts_version}/man | |
207 | %{_libdir}/%{name}/erts-%{erts_version}/src | |
208 | %{_libdir}/%{name}/erts-%{erts_version}/include | |
209 | %dir %{_libdir}/%{name}/erts-%{erts_version}/lib | |
210 | %dir %{_libdir}/%{name}/erts-%{erts_version}/lib/internal | |
211 | %{_libdir}/%{name}/erts-%{erts_version}/lib/internal/liberts_internal*.a | |
212 | %{_libdir}/%{name}/erts-%{erts_version}/lib/internal/libethread.a | |
213 | #%{_libdir}/%{name}/erts-%{erts_version}/*.ear | |
214 | %dir %{_libdir}/%{name}/erts-%{erts_version}/bin | |
215 | %attr(755,root,root) %{_libdir}/%{name}/erts-%{erts_version}/bin/beam* | |
216 | %attr(755,root,root) %{_libdir}/%{name}/erts-%{erts_version}/bin/ct_run | |
217 | %attr(755,root,root) %{_libdir}/%{name}/erts-%{erts_version}/bin/dialyzer | |
218 | %attr(755,root,root) %{_libdir}/%{name}/erts-%{erts_version}/bin/dyn_erl | |
219 | %attr(755,root,root) %{_libdir}/%{name}/erts-%{erts_version}/bin/e* | |
220 | %attr(755,root,root) %{_libdir}/%{name}/erts-%{erts_version}/bin/heart* | |
221 | %attr(755,root,root) %{_libdir}/%{name}/erts-%{erts_version}/bin/inet_gethost | |
222 | %attr(755,root,root) %{_libdir}/%{name}/erts-%{erts_version}/bin/run_erl | |
223 | %attr(755,root,root) %{_libdir}/%{name}/erts-%{erts_version}/bin/start | |
224 | %attr(755,root,root) %{_libdir}/%{name}/erts-%{erts_version}/bin/to_erl | |
225 | %attr(755,root,root) %{_libdir}/%{name}/erts-%{erts_version}/bin/typer | |
226 | %attr(755,root,root) %{_libdir}/%{name}/erts-%{erts_version}/bin/yielding_c_fun | |
227 | %{_libdir}/%{name}/erts-%{erts_version}/bin/start*.* | |
228 | # (file list dynamically generated) %{_libdir}/%{name}/lib | |
229 | %dir %{_libdir}/%{name}/misc | |
230 | %attr(755,root,root) %{_libdir}/%{name}/misc/* | |
231 | %{_libdir}/%{name}/releases | |
232 | %{_libdir}/%{name}/usr | |
233 | %doc %{_libdir}/%{name}/man | |
234 | %attr(755,root,root) %{_libdir}/%{name}/Install | |
235 | ||
236 | %{_libdir}/%{name}/doc | |
237 | %{_libdir}/%{name}/erts-%{erts_version}/doc | |
238 | ||
239 | %{systemdunitdir}/epmd.service | |
240 | %{systemdunitdir}/epmd.socket | |
241 | %{systemdunitdir}/epmd@.service | |
242 | %{systemdunitdir}/epmd@.socket | |
243 | ||
244 | %files doc | |
245 | %defattr(644,root,root,755) | |
246 | %dir %{_datadir}/%{name} | |
247 | %dir %{_datadir}/%{name}/erts-%{erts_version} | |
248 | %{_datadir}/%{name}/doc | |
249 | %{_datadir}/%{name}/erts-%{erts_version}/doc |