1# RPM spec file for FFTW.
2# This file is used to build Redhat Package Manager packages for the
3# FFTW library.  Such packages make it easy to install and uninstall
4# the library and related files from binaries or source.
5#
6# This spec file is for version @VERSION@ of FFTW; the appropriate
7# version numbers are automatically substituted in to fftw.spec.in
8# by the configure script.  However, fftw.spec.in may need to be
9# modified for future releases, if the list of installed files
10# or build commands change.
11#
12# The icon associated with this package can be downloaded from:
13#     http://www.fftw.org/fftw-logo-thumb.gif
14# and will need to be placed in /usr/src/redhat/SOURCES, along with
15# the fftw-@VERSION@.tar.gz file, to build the RPM.  To build, use
16# the command: rpm --clean -ba fftw.spec
17#
18# Alternatively, you can just use 'make rpm' (as root).
19#
20Name: fftw
21Summary: fast fourier transform library
22Version: @VERSION@
23Release: 1
24Copyright: GPL
25Icon: fftw-logo-thumb.gif
26Group: Libraries
27Prefix: /usr/local
28BuildRoot: /tmp/%{name}-%{version}-buildroot
29Source: ftp://ftp.fftw.org/pub/fftw/fftw-@VERSION@.tar.gz
30URL: http://www.fftw.org
31%description
32FFTW is a collection of fast C routines for computing the Discrete Fourier
33Transform in one or more dimensions.  It includes complex, real, and
34parallel transforms, and can handle arbitrary array sizes efficiently.
35This RPM package includes both the double- and single-precision FFTW
36uniprocessor and threads libraries.  (The single-precision files have
37an "s" prefix.)
38%package devel
39Summary: headers, libraries, & docs for FFTW fast fourier transform library
40Group: Development/Libraries
41Prefix: %{prefix}
42Requires: fftw = %{version}-%{release}
43%description devel
44This package contains the additional header files, documentation, and
45libraries you need to develop programs using the FFTW fast fourier
46transform library.
47%prep
48
49# We will be compiling two copies of FFTW, one for double precision and
50# one for single precision.  During the build process, these copies
51# will be stored in fftw-%{version}/double and fftw-%{version}/single
52
53# Unpack the tar archive, first (-c) creating a fftw-%{version}
54# directory and then unpacking in there.
55%setup -c
56
57# Now, rename the unpacked FFTW directory to "double":
58mv ${RPM_PACKAGE_NAME}-${RPM_PACKAGE_VERSION} double
59
60# Second, make a copy of this directory in "single":
61cp -r double single
62
63%build
64
65# Configure and build the double and single precision versions.
66# Notes:
67#  (1) We install into ${RPM_BUILD_ROOT}, which is set either
68#      by the BuildRoot option above or by --buildroot at build-time.
69#      This allows you to build the RPM without blowing away your existing
70#      FFTW installation, and even without being root.
71#  (2) The double-precision version is installed with the normal library
72#      names, while the single-precision version is installed with an "s"
73#      prefix.
74
75cd double
76%ifarch i386
77./configure --prefix="${RPM_BUILD_ROOT}%{prefix}" --enable-shared --enable-i386-hacks --enable-threads
78%else
79./configure --prefix="${RPM_BUILD_ROOT}%{prefix}" --enable-shared --enable-threads
80%endif
81make
82
83cd ../single
84./configure --prefix="${RPM_BUILD_ROOT}%{prefix}" --enable-shared --enable-type-prefix --enable-threads --enable-float
85make
86
87%install
88
89cd double
90make install
91
92cd ../single
93make install
94
95%clean
96
97rm -rf ${RPM_BUILD_ROOT}
98
99%post
100# Force ${RPM_INSTALL_PREFIX}/lib to be in /etc/ld.so.conf?
101# No...that would make it impossible to completely uninstall reliably.
102# Instead, warn the user fix a broken /etc/ld.so.conf manually:
103if test -z `grep ${RPM_INSTALL_PREFIX}/lib /etc/ld.so.conf`; then
104     echo "warning: ${RPM_INSTALL_PREFIX}/lib is not in /etc/ld.so.conf" 1>&2
105     echo "         You should add it and then run ldconfig." 1>&2
106fi
107
108# run ldconfig to update the runtime linker database with the new libraries
109# (make sure /sbin is in the $PATH)
110PATH="/sbin:$PATH" ldconfig
111
112%postun
113# after uninstall, run ldconfig to remove the libs from the linker database
114PATH="/sbin:$PATH" ldconfig
115
116%files
117/usr/local/lib/libfftw.so.@SHARED_VERSION@
118/usr/local/lib/libfftw_threads.so.@SHARED_VERSION@
119/usr/local/lib/librfftw.so.@SHARED_VERSION@
120/usr/local/lib/librfftw_threads.so.@SHARED_VERSION@
121/usr/local/lib/libsfftw.so.@SHARED_VERSION@
122/usr/local/lib/libsfftw_threads.so.@SHARED_VERSION@
123/usr/local/lib/libsrfftw.so.@SHARED_VERSION@
124/usr/local/lib/libsrfftw_threads.so.@SHARED_VERSION@
125/usr/local/lib/libfftw.so.2
126/usr/local/lib/libfftw_threads.so.2
127/usr/local/lib/librfftw.so.2
128/usr/local/lib/librfftw_threads.so.2
129/usr/local/lib/libsfftw.so.2
130/usr/local/lib/libsfftw_threads.so.2
131/usr/local/lib/libsrfftw.so.2
132/usr/local/lib/libsrfftw_threads.so.2
133%files devel
134/usr/local/include/fftw.h
135/usr/local/include/fftw_threads.h
136/usr/local/include/rfftw.h
137/usr/local/include/rfftw_threads.h
138/usr/local/include/sfftw.h
139/usr/local/include/sfftw_threads.h
140/usr/local/include/srfftw.h
141/usr/local/include/srfftw_threads.h
142/usr/local/info/fftw.info
143/usr/local/info/fftw.info-1
144/usr/local/info/fftw.info-2
145/usr/local/info/fftw.info-3
146/usr/local/info/fftw.info-4
147/usr/local/info/fftw.info-5
148/usr/local/lib/libfftw.a
149/usr/local/lib/libfftw.la
150/usr/local/lib/libfftw.so
151/usr/local/lib/libfftw_threads.a
152/usr/local/lib/libfftw_threads.la
153/usr/local/lib/libfftw_threads.so
154/usr/local/lib/librfftw.a
155/usr/local/lib/librfftw.la
156/usr/local/lib/librfftw.so
157/usr/local/lib/librfftw_threads.a
158/usr/local/lib/librfftw_threads.la
159/usr/local/lib/librfftw_threads.so
160/usr/local/lib/libsfftw.a
161/usr/local/lib/libsfftw.la
162/usr/local/lib/libsfftw.so
163/usr/local/lib/libsfftw_threads.a
164/usr/local/lib/libsfftw_threads.la
165/usr/local/lib/libsfftw_threads.so
166/usr/local/lib/libsrfftw.a
167/usr/local/lib/libsrfftw.la
168/usr/local/lib/libsrfftw.so
169/usr/local/lib/libsrfftw_threads.a
170/usr/local/lib/libsrfftw_threads.la
171/usr/local/lib/libsrfftw_threads.so
172