- up to 17.5
[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:        17.5
18 Release:        1
19 Epoch:          2
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:  346dd0136bf1cc28cebc140e505206bb
25 Source1:        http://www.erlang.org/download/otp_doc_man_%{_version}.tar.gz
26 # Source1-md5:  91fcea4e95a5802f153fe547b96792a5
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 EPLICENCE 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 %attr(755,root,root) %{_bindir}/typer
146 %dir %{_libdir}/erlang
147 %dir %{_libdir}/%{name}/bin
148 %attr(755,root,root) %{_libdir}/%{name}/bin/ct_run
149 %attr(755,root,root) %{_libdir}/%{name}/bin/dialyzer
150 %attr(755,root,root) %{_libdir}/%{name}/bin/epmd
151 %attr(755,root,root) %{_libdir}/%{name}/bin/erl
152 %attr(755,root,root) %{_libdir}/%{name}/bin/erlc
153 %attr(755,root,root) %{_libdir}/%{name}/bin/escript
154 %attr(755,root,root) %{_libdir}/%{name}/bin/no_dot_erlang.boot
155 %attr(755,root,root) %{_libdir}/%{name}/bin/run_erl
156 %attr(755,root,root) %{_libdir}/%{name}/bin/start
157 %attr(755,root,root) %{_libdir}/%{name}/bin/start_erl
158 %attr(755,root,root) %{_libdir}/%{name}/bin/to_erl
159 %attr(755,root,root) %{_libdir}/%{name}/bin/typer
160 %{_libdir}/%{name}/bin/start*.*
161 %dir %{_libdir}/%{name}/erts-*
162 %{_libdir}/%{name}/erts-*/doc
163 %{_libdir}/%{name}/erts-*/man
164 %{_libdir}/%{name}/erts-*/src
165 %{_libdir}/%{name}/erts-*/include
166 #%{_libdir}/%{name}/erts-*/*.ear
167 %dir %{_libdir}/%{name}/erts-*/bin
168 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/beam*
169 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/child*
170 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/ct_run
171 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/dialyzer
172 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/dyn_erl
173 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/e*
174 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/heart*
175 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/inet_gethost
176 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/run_erl
177 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/start
178 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/to_erl
179 %attr(755,root,root) %{_libdir}/%{name}/erts-*/bin/typer
180 %{_libdir}/%{name}/erts-*/bin/start*.*
181 # (file list dynamically generated) %{_libdir}/%{name}/lib
182 %dir %{_libdir}/%{name}/misc
183 %attr(755,root,root) %{_libdir}/%{name}/misc/*
184 %{_libdir}/%{name}/releases
185 %{_libdir}/%{name}/usr
186 %doc %{_libdir}/%{name}/man
187 %attr(755,root,root) %{_libdir}/%{name}/Install
188
189 %{systemdunitdir}/epmd.service
190 %{systemdunitdir}/epmd.socket
191 %{systemdunitdir}/epmd@.service
192 %{systemdunitdir}/epmd@.socket
This page took 0.045804 seconds and 3 git commands to generate.