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