1 |
%define oname fftw |
2 |
|
3 |
%define major 2 |
4 |
%define libname %mklibname %{oname} %{major} |
5 |
%define develname %mklibname %{oname} -d %major |
6 |
|
7 |
Summary: Fast fourier transform library |
8 |
Name: fftw2 |
9 |
Version: 2.1.5 |
10 |
Release: %mkrel 17 |
11 |
License: GPLv2+ |
12 |
Group: Development/C |
13 |
URL: http://www.fftw.org/ |
14 |
Source0: %{oname}-%{version}.tar.bz2 |
15 |
Patch0: %{oname}-2.1.3-pentium.patch |
16 |
Patch1: fftw-linkage_fix.diff |
17 |
Patch2: fftw-2.1.5-automake-1.13.patch |
18 |
BuildRequires: gcc-gfortran |
19 |
BuildRequires: automake |
20 |
BuildRequires: libtool |
21 |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot |
22 |
|
23 |
%description |
24 |
FFTW is a collection of fast C routines for computing the Discrete Fourier |
25 |
Transform in one or more dimensions. It includes complex, real, and parallel |
26 |
transforms, and can handle arbitrary array sizes efficiently. This RPM package |
27 |
includes both the double- and single-precision FFTW uniprocessor and threads |
28 |
libraries. (The single-precision files have an "s" prefix.) |
29 |
|
30 |
%package -n %{libname} |
31 |
Summary: Fast fourier transform library |
32 |
Group: Development/C |
33 |
|
34 |
%description -n %{libname} |
35 |
FFTW is a collection of fast C routines for computing the Discrete Fourier |
36 |
Transform in one or more dimensions. It includes complex, real, and parallel |
37 |
transforms, and can handle arbitrary array sizes efficiently. This RPM package |
38 |
includes both the double- and single-precision FFTW uniprocessor and threads |
39 |
libraries. (The single-precision files have an "s" prefix.) |
40 |
|
41 |
%package -n %{develname} |
42 |
Summary: Headers, libraries, & docs for FFTW fast fourier transform library |
43 |
Group: Development/C |
44 |
Requires: %{libname} = %{version}-%{release} |
45 |
Provides: fftw2-devel = %{version}-%{release} |
46 |
|
47 |
%description -n %{develname} |
48 |
This package contains the additional header files, documentation, andlibraries |
49 |
you need to develop programs using the FFTW fast fourier transform library. |
50 |
|
51 |
%prep |
52 |
# We will be compiling two copies of FFTW, one for double precision and |
53 |
# one for single precision. During the build process, these copies |
54 |
# will be stored in fftw-%{version}/double and fftw-%{version}/single |
55 |
|
56 |
# Unpack the tar archive, first (-c) creating a fftw-%{version} |
57 |
# directory and then unpacking in there. |
58 |
|
59 |
%setup -q -c -n %oname-%version |
60 |
# Now, rename the unpacked FFTW directory to "double": |
61 |
mv %oname-%version double |
62 |
# Apply patch to enable pentium optimizations |
63 |
cd double |
64 |
%patch0 -p1 |
65 |
%patch2 -p1 -b .automake113 |
66 |
cd .. |
67 |
# Last, make a copy of this directory in "single": |
68 |
cp -rp double single |
69 |
|
70 |
%patch1 -p1 |
71 |
|
72 |
%build |
73 |
|
74 |
# Configure and build the double and single precision versions. |
75 |
# Notes: |
76 |
# (1) We install into ${RPM_BUILD_ROOT}, which is set either |
77 |
# by the BuildRoot option above or by --buildroot at build-time. |
78 |
# This allows you to build the RPM without blowing away your existing |
79 |
# FFTW installation, and even without being root. |
80 |
# (2) The double-precision version is installed with the normal library |
81 |
# names, while the single-precision version is installed with an "s" |
82 |
# prefix. |
83 |
|
84 |
cd double |
85 |
libtoolize --copy --force; aclocal; automake; autoconf |
86 |
%ifarch %{ix86} |
87 |
%configure2_5x \ |
88 |
--enable-shared \ |
89 |
--enable-threads \ |
90 |
--infodir=%{buildroot}%{_infodir} \ |
91 |
--enable-i386-hacks |
92 |
%else |
93 |
%configure2_5x \ |
94 |
--enable-shared \ |
95 |
--enable-threads \ |
96 |
--infodir=%{buildroot}%{_infodir} |
97 |
%endif |
98 |
%make |
99 |
|
100 |
cd ../single |
101 |
libtoolize --copy --force; aclocal; automake; autoconf |
102 |
%ifarch %{ix86} |
103 |
%configure2_5x \ |
104 |
--enable-shared \ |
105 |
--enable-threads \ |
106 |
--infodir=%{buildroot}%{_infodir} \ |
107 |
--enable-i386-hacks \ |
108 |
--enable-float \ |
109 |
--enable-type-prefix |
110 |
%else |
111 |
%configure2_5x \ |
112 |
--enable-shared \ |
113 |
--enable-threads \ |
114 |
--infodir=%{buildroot}%{_infodir} \ |
115 |
--enable-float \ |
116 |
--enable-type-prefix |
117 |
%endif |
118 |
%make |
119 |
|
120 |
%install |
121 |
rm -rf %{buildroot} |
122 |
|
123 |
cd double |
124 |
%makeinstall |
125 |
|
126 |
cd ../single |
127 |
%makeinstall |
128 |
|
129 |
# copy doc files where RPM will find them |
130 |
# put the HTML stuff in a sperate dir, so it appears nicely in the docdir |
131 |
mkdir -p ../html |
132 |
cp doc/*html doc/*gif ../html |
133 |
# remove HTML files from doc so that they don't appear double |
134 |
rm -f doc/*html doc/*gif |
135 |
|
136 |
# place the doc directory in a "findable" location |
137 |
mkdir -p ../doc |
138 |
cp -a doc/* ../doc |
139 |
|
140 |
# the FAQ directory is also "nice" to have |
141 |
mkdir -p ../FAQ |
142 |
cp -a FAQ/* ../FAQ |
143 |
|
144 |
# do the same to the other %doc files |
145 |
cp AUTHORS ChangeLog NEWS README* TODO .. |
146 |
|
147 |
rm -f %buildroot%_libdir/*.la |
148 |
|
149 |
%post -n %{develname} |
150 |
%__install_info -e '* FFTW: (fftw). Fast Fourier Transform library.'\ |
151 |
-s Libraries %{_infodir}/fftw.info.* %{_infodir}/dir |
152 |
|
153 |
%preun -n %{develname} |
154 |
%__install_info -e '* FFTW: (fftw). Fast Fourier Transform library.'\ |
155 |
-s Libraries %{_infodir}/fftw.info.* %{_infodir}/dir --remove |
156 |
|
157 |
%clean |
158 |
rm -rf %{buildroot} |
159 |
|
160 |
%files -n %{libname} |
161 |
%defattr (-,root,root) |
162 |
%doc html FAQ doc/*ps doc/*fig doc/*tex* AUTHORS ChangeLog NEWS README* TODO |
163 |
%{_libdir}/lib*fftw*.so.%{major}* |
164 |
|
165 |
%files -n %{develname} |
166 |
%defattr (-,root,root) |
167 |
%{_includedir}/*fftw*.h |
168 |
%doc %{_infodir}/* |
169 |
%{_libdir}/lib*fftw*.a |
170 |
%{_libdir}/lib*fftw*.so |
171 |
|
172 |
|