1 |
%define octave_api 52 |
2 |
|
3 |
%bcond_without audio |
4 |
%bcond_without gui |
5 |
%bcond_without java |
6 |
|
7 |
Name: octave |
8 |
Epoch: 0 |
9 |
Version: 4.4.1 |
10 |
Release: %mkrel 3 |
11 |
Summary: High-level language for numerical computations |
12 |
License: GPLv3+ |
13 |
Group: Sciences/Mathematics |
14 |
Source0: http://ftp.gnu.org/gnu/octave/%{name}-%{version}.tar.xz |
15 |
Source4: octave-2.1.36-emac.lisp |
16 |
URL: http://www.octave.org/ |
17 |
Obsoletes: octave3 < %{epoch}:%{version}-%{release} |
18 |
Provides: octave3 = %{epoch}:%{version}-%{release} |
19 |
Provides: octave(api) = api-v%{octave_api} |
20 |
Requires: gnuplot |
21 |
# (Anssi) for makeinfo which is needed for "help foo" command: |
22 |
Requires: texinfo |
23 |
Requires: graphicsmagick |
24 |
Requires(post): desktop-file-utils |
25 |
Requires(postun): desktop-file-utils |
26 |
Requires(post): rpm-helper |
27 |
BuildRequires: lzip |
28 |
BuildRequires: bison |
29 |
BuildRequires: blas-devel |
30 |
BuildRequires: dejagnu |
31 |
BuildRequires: desktop-file-utils |
32 |
BuildRequires: emacs |
33 |
BuildRequires: emacs-bin |
34 |
BuildRequires: fftw-devel >= 0:3.0.1 |
35 |
BuildRequires: flex |
36 |
BuildRequires: gcc-gfortran |
37 |
BuildRequires: glpk-devel |
38 |
BuildRequires: gnuplot-nox |
39 |
# (Abel) not strictly needed, but play safe |
40 |
BuildRequires: gperf |
41 |
BuildRequires: hdf5-devel |
42 |
BuildRequires: lapack-devel |
43 |
BuildRequires: pkgconfig(ncurses) |
44 |
BuildRequires: readline-devel |
45 |
BuildRequires: texinfo |
46 |
BuildRequires: texinfo-tex |
47 |
BuildRequires: texlive |
48 |
BuildRequires: pkgconfig(libpcre) |
49 |
BuildRequires: pkgconfig(libcurl) |
50 |
# (Lev) needed to support sparse matrix functionality |
51 |
BuildRequires: suitesparse-devel |
52 |
# (Lev) other useful libraries |
53 |
BuildRequires: qhull-devel |
54 |
BuildRequires: qrupdate-devel |
55 |
# (Lev) for new experimental plotting |
56 |
BuildRequires: fltk-devel |
57 |
BuildRequires: pkgconfig(gl) |
58 |
BuildRequires: pkgconfig(glu) |
59 |
# (Mitya) for eigs and svds to work |
60 |
BuildRequires: pkgconfig(arpack) |
61 |
# to make imread more functional |
62 |
BuildRequires: pkgconfig(GraphicsMagick) |
63 |
# (Mitya) GUI |
64 |
%if %{with gui} |
65 |
BuildRequires: pkgconfig(QtCore) |
66 |
BuildRequires: pkgconfig(QtGui) |
67 |
BuildRequires: pkgconfig(QtNetwork) |
68 |
BuildRequires: pkgconfig(QtOpenGL) |
69 |
BuildRequires: qscintilla-qt4-devel |
70 |
%endif |
71 |
# (Mitya) Java interface |
72 |
%if %{with java} |
73 |
BuildRequires: java-devel |
74 |
%endif |
75 |
# (Mitya) rendering stuff |
76 |
BuildRequires: gl2ps-devel |
77 |
BuildRequires: pkgconfig(osmesa) |
78 |
# (Mitya) Audio processing |
79 |
%if %{with audio} |
80 |
BuildRequires: pkgconfig(portaudio-2.0) |
81 |
BuildRequires: pkgconfig(sndfile) |
82 |
%endif |
83 |
# (eatdirt) fix some warnings for icon generation |
84 |
BuildRequires: icoutils |
85 |
BuildRequires: librsvg |
86 |
|
87 |
%description |
88 |
GNU Octave is a high-level language, primarily intended for numerical |
89 |
computations. It provides a convenient command line interface for |
90 |
solving linear and nonlinear problems numerically, and for performing |
91 |
other numerical experiments using a language that is mostly compatible |
92 |
with Matlab. It may also be used as a batch-oriented language. |
93 |
|
94 |
Octave has extensive tools for solving common numerical linear algebra |
95 |
problems, finding the roots of nonlinear equations, integrating |
96 |
ordinary functions, manipulating polynomials, and integrating ordinary |
97 |
differential and differential-algebraic equations. It is easily |
98 |
extensible and customizable via user-defined functions written in |
99 |
Octave's own language, or using dynamically loaded modules written in |
100 |
C++, C, Fortran, or other languages. |
101 |
|
102 |
%package devel |
103 |
Summary: Development headers and files for Octave |
104 |
Group: Development/C |
105 |
Obsoletes: octave3-devel < %{epoch}:%{version}-%{release} |
106 |
Provides: octave3-devel = %{epoch}:%{version}-%{release} |
107 |
Requires: %{name} = %{epoch}:%{version}-%{release} |
108 |
Requires: blas-devel |
109 |
Requires: fftw-devel |
110 |
Requires: gcc-c++ |
111 |
Requires: gcc-gfortran |
112 |
Requires: hdf5-devel |
113 |
Requires: lapack-devel |
114 |
Requires: readline-devel |
115 |
Requires: zlib-devel |
116 |
Requires: gnuplot-nox |
117 |
Requires: pstoedit |
118 |
Requires: transfig |
119 |
Provides: mkoctfile = %{epoch}:%{version}-%{release} |
120 |
|
121 |
%description devel |
122 |
The octave-devel package contains files needed for developing |
123 |
applications which use GNU Octave. |
124 |
This package is necessary if you intend to install external packages |
125 |
(for example, through Octave forge) in Octave. |
126 |
|
127 |
%package doc |
128 |
Summary: Documentation for Octave, a numerical computational language |
129 |
Group: Sciences/Mathematics |
130 |
BuildArch: noarch |
131 |
|
132 |
%description doc |
133 |
GNU Octave is a high-level language, primarily intended for numerical |
134 |
computations. It provides a convenient command line interface for |
135 |
solving linear and nonlinear problems numerically, and for performing |
136 |
other numerical experiments using a language that is mostly compatible |
137 |
with Matlab. It may also be used as a batch-oriented language. |
138 |
|
139 |
This package contains documentation of Octave in various formats. |
140 |
|
141 |
%prep |
142 |
%setup -q |
143 |
|
144 |
#this command just returns the API number hardcoded in configure.ac |
145 |
#and ensures that it matches the one defined above |
146 |
OCTAVE_API=`%{__sed} -nr 's/^OCTAVE_API_VERSION="api-v([[:digit:]]+)"/\1/p' configure.ac` |
147 |
test "x${OCTAVE_API}" = x%{octave_api} || exit 1 |
148 |
%{__cp} -a %{SOURCE4} octave.el |
149 |
|
150 |
%build |
151 |
%define enable64 no |
152 |
export CPPFLAGS="%{optflags} -DH5_USE_16_API" |
153 |
export GNUPLOT=%{_bindir}/gnuplot-nox |
154 |
%{configure2_5x} --enable-dl \ |
155 |
--enable-shared \ |
156 |
--disable-static \ |
157 |
--enable-64=%{enable64} \ |
158 |
--with-amd="-lamd -lsuitesparseconfig" \ |
159 |
--with-camd="-lcamd -lsuitesparseconfig" \ |
160 |
--with-colamd="-lcolamd -lsuitesparseconfig" \ |
161 |
--with-ccolamd="-lccolamd -lsuitesparseconfig" |
162 |
|
163 |
# (Mitya) Because of gnuplot-nox used for build, Octave will set it as default gnuplot binary. |
164 |
# Revert it to original gnuplot. |
165 |
#{__sed} -i 's/gnuplot-nox/gnuplot/' scripts/plot/util/gnuplot_binary.m |
166 |
|
167 |
%{make_build} OCTAVE_RELEASE="%{distribution} %{version}-%{release}" LDFLAGS="-lgfortran -llapack -lGL -lGLU -lpthread" |
168 |
|
169 |
# emacs mode |
170 |
%{_bindir}/emacs -batch -q -no-site-file -f batch-byte-compile %{name}.el |
171 |
|
172 |
%check |
173 |
#%%{make} check |
174 |
|
175 |
%install |
176 |
%{make_install} |
177 |
|
178 |
# Make library links |
179 |
%{__mkdir_p} %{buildroot}/etc/ld.so.conf.d |
180 |
/bin/echo "%{_libdir}/octave-%{version}" > %{buildroot}/etc/ld.so.conf.d/octave-%{_arch}.conf |
181 |
|
182 |
# Remove RPM_BUILD_ROOT from ls-R files |
183 |
%{__perl} -pi -e "s,%{buildroot},," %{buildroot}%{_libexecdir}/octave/ls-R |
184 |
%{__perl} -pi -e "s,%{buildroot},," %{buildroot}%{_datadir}/octave/ls-R |
185 |
|
186 |
%{_bindir}/find %{buildroot} -name "*.oct" -print0 | %{_bindir}/xargs -t -0 -r strip --strip-unneeded |
187 |
|
188 |
%{__mkdir_p} %{buildroot}%{_sysconfdir}/emacs/site-start.d |
189 |
%{__cp} -a %{name}.elc %{buildroot}%{_sysconfdir}/emacs/site-start.d/%{name}.elc |
190 |
%{__cp} -a %{name}.el %{buildroot}%{_sysconfdir}/emacs/site-start.d/%{name}.el |
191 |
|
192 |
# prepare documentation |
193 |
%{__rm} -rf package-doc |
194 |
%{__mkdir_p} package-doc |
195 |
|
196 |
%{__mkdir_p} package-doc/interpreter/octave.html/ |
197 |
/bin/ln doc/interpreter/octave.html/*.html package-doc/interpreter/octave.html/ |
198 |
|
199 |
%{__mkdir_p} package-doc/liboctave/liboctave.html/ |
200 |
/bin/ln doc/liboctave/liboctave.html/*.html package-doc/liboctave/liboctave.html/ |
201 |
|
202 |
%{__mkdir_p} package-doc/examples |
203 |
%{__cp} -a examples/[[:lower:]]* package-doc/examples/ |
204 |
|
205 |
%{__cp} -a doc/liboctave/liboctave.info %{buildroot}%{_infodir}/ |
206 |
|
207 |
# Create desktop file |
208 |
%{__mv} %{buildroot}%{_datadir}/applications/org.octave.Octave.desktop \ |
209 |
%{buildroot}%{_datadir}/applications/octave.desktop |
210 |
%{_bindir}/desktop-file-install --add-category Education --remove-category Development \ |
211 |
--dir %{buildroot}%{_datadir}/applications %{buildroot}%{_datadir}/applications/octave.desktop |
212 |
|
213 |
# Create directories for add-on packages |
214 |
HOST_TYPE=`%{buildroot}%{_bindir}/octave-config -p CANONICAL_HOST_TYPE` |
215 |
%{__mkdir_p} %{buildroot}%{_libexecdir}/octave/site/oct/%{octave_api}/$HOST_TYPE |
216 |
%{__mkdir_p} %{buildroot}%{_libexecdir}/octave/site/oct/$HOST_TYPE |
217 |
%{__mkdir_p} %{buildroot}%{_datadir}/octave/packages |
218 |
/bin/touch %{buildroot}%{_datadir}/octave/octave_packages |
219 |
|
220 |
#multiarch_includes %{buildroot}%{_includedir}/octave-%{version}/octave/config.h |
221 |
%multiarch_includes %{buildroot}%{_includedir}/octave-%{version}/octave/*.h |
222 |
|
223 |
%post |
224 |
%create_ghostfile %{_datadir}/octave/octave_packages root root 0664 |
225 |
|
226 |
%files |
227 |
%defattr(0644,root,root,0755) |
228 |
%doc NEWS* README |
229 |
%doc examples |
230 |
%defattr(-,root,root,0755) |
231 |
%{_bindir}/octave* |
232 |
%config(noreplace) /etc/ld.so.conf.d/* |
233 |
%{_libdir}/octave* |
234 |
%{_datadir}/octave |
235 |
%{_datadir}/metainfo/org.octave.Octave.appdata.xml |
236 |
%{_datadir}/icons/*/*/apps/octave.png |
237 |
%{_datadir}/icons/*/*/apps/octave.svg |
238 |
%exclude %{_datadir}/octave/octave_packages |
239 |
%ghost %{_datadir}/octave/octave_packages |
240 |
%if "%{_libdir}" != "%{_libexecdir}" |
241 |
%{_libexecdir}/octave |
242 |
%endif |
243 |
%{_mandir}/man*/octave* |
244 |
%{_infodir}/octave.info* |
245 |
%{_datadir}/applications/* |
246 |
%config(noreplace) %_sysconfdir/emacs/site-start.d/octave.el* |
247 |
|
248 |
%files devel |
249 |
%defattr(0644,root,root,0755) |
250 |
#%%doc doc/liboctave |
251 |
%defattr(-,root,root) |
252 |
%{_bindir}/mkoctfile* |
253 |
%{_includedir}/octave-%{version} |
254 |
%dir %{multiarch_includedir}/octave-* |
255 |
%multiarch %{multiarch_includedir}/octave-*/octave/*.h |
256 |
%multiarch %{multiarch_includedir}/octave-*/octave/*.cc |
257 |
%{_mandir}/man*/mkoctfile* |
258 |
|
259 |
%files doc |
260 |
%defattr(0644,root,root,0755) |
261 |
%doc doc/refcard/*.pdf |
262 |
%doc doc/interpreter/*.pdf |
263 |
%doc doc/liboctave/*.pdf |
264 |
%doc package-doc/* |
265 |
%{_infodir}/liboctave.* |