Browse Source

update: fftw, fftw3

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@1990 ec354946-7b23-47d6-9f5a-488ba84defc7
inagaki 13 years ago
parent
commit
dedc04a43a
2 changed files with 164 additions and 105 deletions
  1. 66 48
      f/fftw/fftw-vl.spec
  2. 98 57
      f/fftw3/fftw3-vl.spec

+ 66 - 48
f/fftw/fftw-vl.spec

@@ -1,21 +1,23 @@
 %define name fftw
 %define version 2.1.5
-%define release 1%{?_dist_release}
+%define release 2%{?_dist_release}
 
 Name: %{name}
 Summary:   C subroutines for computing the Discrete Fourier Transform.
 Version:   %{version}
 Release:   %{release}
-License:   GPL
-Icon:      fftw-logo-thumb.gif
-Group:     Development/Libraries
+
+Group:     System Environment/Libraries
+License:   GPLv2
+URL:       http://www.fftw.org/
+
 Source:    %{name}-%{version}.tar.gz
 %{?nosrc:NoSource: 0}
 Patch0:    %{name}-%{version}-pentium.patch
-URL:       http://www.fftw.org/
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
-BuildRequires: glibc, gcc-gfortran
-Requires:  glibc
+Icon:      fftw-logo-thumb.gif
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-root
+BuildRequires: gcc-gfortran
 
 Vendor: Project Vine
 Distribution: Vine Linux
@@ -24,13 +26,14 @@ Distribution: Vine Linux
 FFTW is a collection of fast C routines for computing the Discrete Fourier Transform in one or more dimensions.  It includes complex, real, and parallel transforms, and can handle arbitrary array sizes efficiently. This RPM package includes both the double- and single-precision FFTW uniprocessor and threads libraries.  (The single-precision files have an "s" prefix.)
 
 %description -l ja
-FFTWは1次元または多次元の離散フーリエ変換(DFT)を計算する高速なCルーチンのコレクションです。FFTWは複素数、実数、並列変換ができ、任意のサイズの配列を効果的に扱うことができますこのパッケージには、倍精度と単精度の単一CPUとスレッドに対応したFFTWのライブラリが収められています。(単精度用のファイル名にはsが最初に付けられています。)
+FFTW は1次元または多次元の離散フーリエ変換(DFT)を計算する高速なCルーチンのコレクションです.FFTW は複素数、実数、並列変換ができ、任意のサイズの配列を効果的に扱うことができますこのパッケージには、倍精度と単精度の単一CPUとスレッドに対応した FFTW のライブラリが収められています。(単精度用のファイル名にはfが最後に付けられています。)
 
 %package devel
 Summary:   Headers, libraries, & docs for FFTW fast fourier transform library
 Group:     Development/Libraries
-Prefix:    %{_prefix}
 Requires:  %{name} = %{version}-%{release}
+Requires(post): install-info 
+Requires(preun): install-info
 
 %description devel
 This package contains the additional header files, documentation, and
@@ -40,9 +43,16 @@ transform library.
 %description devel -l ja
 このパッケージには、高速フーリエ変換のライブラリであるFFTWを使ってプログラムを開発する際に必要となるヘッダーファイルやドキュメント、ライブラリが収められています。
 
-%prep
-rm -rf $RPM_BUILD_ROOT
+%package        static
+Summary:        Static version of the FFTW library
+Group:          Development/Libraries
+Requires:       %{name}-devel = %{version}-%{release}
 
+%description    static
+This package contains the statically linkable version of
+the FFTW fast Fourier transform library.
+
+%prep
 # We will be compiling two copies of FFTW, one for double precision and
 # one for single precision.  During the build process, these copies
 # will be stored in fftw-%{version}/double and fftw-%{version}/single
@@ -55,15 +65,14 @@ rm -rf $RPM_BUILD_ROOT
 mv ${RPM_PACKAGE_NAME}-${RPM_PACKAGE_VERSION} double
 
 # Apply patch to enable pentium optimizations
-cd double
+pushd double
 %patch0 -p1
-cd ..
+popd
 
 # Last, make a copy of this directory in "single":
 cp -r double single
 
 %build
-
 # Configure and build the double and single precision versions.
 # Notes:
 #  (1) We install into ${RPM_BUILD_ROOT}, which is set either
@@ -74,71 +83,80 @@ cp -r double single
 #      names, while the single-precision version is installed with an "s"
 #      prefix.
 
-cd double
+# Configure uses g77 by default, if present on system
+export F77=gfortran
+
+pushd double
 %ifarch i386
     %configure --enable-shared --enable-threads --infodir=$RPM_BUILD_ROOT%{_infodir} --enable-i386-hacks
 %else
     %configure --enable-shared --enable-threads --infodir=$RPM_BUILD_ROOT%{_infodir}
 %endif
-make
+make %{?_smp_mflags}
+popd
 
-cd ../single
+pushd single
 %ifarch i386
     %configure --enable-shared --enable-threads --infodir=$RPM_BUILD_ROOT%{_infodir} --enable-i386-hacks --enable-float --enable-type-prefix 
 %else
     %configure --enable-shared --enable-threads --infodir=$RPM_BUILD_ROOT%{_infodir} --enable-float --enable-type-prefix
 %endif
-make
+make %{?_smp_mflags}
+popd
 
 %install
-cd double
-%makeinstall
-cd ../single
-%makeinstall
-
-# copy doc files where RPM will find them
-# put the HTML stuff in a sperate dir, so it appears nicely in the docdir
-mkdir -p ../html
-cp doc/*html doc/*gif ../html
-# remove HTML files from doc so that they don't appear double
-rm -f doc/*html doc/*gif
-
-# place the doc directory in a "findable" location
-mkdir -p ../doc
-cp -a doc/* ../doc
-
-# the FAQ directory is also "nice" to have
-mkdir -p ../FAQ
-cp -a FAQ/* ../FAQ
-
-# do the same to the other %doc files
-cp AUTHORS ChangeLog NEWS README* TODO ..
+rm -rf $RPM_BUILD_ROOT doc
+pushd double
+    %makeinstall
+    cp -a AUTHORS COPYING COPYRIGHT ChangeLog NEWS README* TODO ../
+    cp -a FAQ/fftw-faq.html/ doc/ ../
+popd
+pushd single
+    %makeinstall
+popd
+rm -f doc/Makefile*
 
 ## remove unuse files
-rm -rf $RPM_BUILD_ROOT%{_libdir}/*.la
+rm -f $RPM_BUILD_ROOT%{_infodir}/dir
+rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post
-/sbin/ldconfig
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%post devel
+/sbin/install-info --section="Math" %{_infodir}/%{name}.info.gz %{_infodir}/dir  2>/dev/null || :
 
-%postun
-/sbin/ldconfig
+%preun devel
+if [ "$1" = 0 ]; then
+  /sbin/install-info --delete %{_infodir}/%{name}.info.gz %{_infodir}/dir 2>/dev/null || :
+fi
 
 %files
 %defattr (-,root,root)
-%doc html FAQ doc/*ps doc/*fig doc/*tex* AUTHORS ChangeLog NEWS README* TODO
+%doc AUTHORS COPYING COPYRIGHT ChangeLog NEWS README* TODO
 %{_libdir}/lib*fftw*.so.2*
 
 %files devel
 %defattr (-,root,root)
+%doc  doc/
 %{_includedir}/*fftw*.h
 %doc %{_infodir}/*
-%{_libdir}/lib*fftw*.a
 %{_libdir}/lib*fftw*.so
 
+%files static
+%defattr (-,root,root)
+%{_libdir}/lib*fftw*.a
+
+
 %changelog
+* Sun Oct 03 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.1.5-2
+- rebuilt with new toolchain
+- split static libraries
+
 * Sat Sep 20 2008 Shu KONNO <owa@bg.wakwak.com> 2.1.5-1vl5
 - applied new versioning policy, spec in utf-8
 - removed *.la

+ 98 - 57
f/fftw3/fftw3-vl.spec

@@ -1,18 +1,20 @@
 %define name fftw3
-%define version 3.1.2
+%define version 3.2.2
 %define release 1%{?_dist_release}
 
 Name: %{name}
 Summary:   C subroutines for computing the Discrete Fourier Transform.
 Version:   %{version}
 Release:   %{release}
-License:   GPL
-Group:     Development/Libraries
-Source:    fftw-%{version}.tar.gz
+
+Group:     System Environment/Libraries
+License:   GPLv2
 URL:       http://www.fftw.org/
+
+Source:    fftw-%{version}.tar.gz
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
-BuildRequires: gcc, gcc-gfortran
-Requires:  glibc
+BuildRequires: gcc-gfortran
+
 Vendor: Project Vine
 Distribution: Vine Linux
 
@@ -20,41 +22,50 @@ Distribution: Vine Linux
 FFTW is a collection of fast C routines for computing the Discrete Fourier Transform in one or more dimensions.  It includes complex, real, and parallel transforms, and can handle arbitrary array sizes efficiently. This RPM package includes both the double- and single-precision FFTW uniprocessor and threads libraries.  (The single-precision files have an "f" postfix.)
 
 %description -l ja
-FFTWは1次元または多次元の離散フーリエ変換(DFT)を計算する高速なCルーチンのコレクションです。FFTWは複素数、実数、並列変換ができ、任意のサイズの配列を効果的に扱うことができますこのパッケージには、倍精度と単精度の単一CPUとスレッドに対応したFFTWのライブラリが収められています。(単精度用のファイル名にはfが最後に付けられています。)
+FFTW は1次元または多次元の離散フーリエ変換(DFT)を計算する高速なCルーチンのコレクションです.FFTW は複素数、実数、並列変換ができ、任意のサイズの配列を効果的に扱うことができますこのパッケージには、倍精度と単精度の単一CPUとスレッドに対応した FFTW のライブラリが収められています。(単精度用のファイル名にはfが最後に付けられています。)
 
 %package devel
-Summary:   Headers, libraries, & docs for FFTW fast fourier transform library
+Summary:   Headers, libraries and docs for the FFTW library
 Group:     Development/Libraries
-Prefix:    %{_prefix}
 Requires:  %{name} = %{version}-%{release}
+Requires(post): install-info 
+Requires(preun): install-info
 
 %description devel
-This package contains the additional header files, documentation, and
-libraries you need to develop programs using the FFTW fast fourier
-transform library.
+This package contains header files and development libraries needed to
+develop programs using the FFTW fast Fourier transform library.
 
 %description devel -l ja
-このパッケージには、高速フーリエ変換のライブラリであるFFTWを使ってプログラムを開発する際に必要となるヘッダーファイルやドキュメント、ライブラリが収められています
+このパッケージには、高速フーリエ変換のライブラリである FFTW を使ってプログラムを開発する際に必要となるヘッダーファイルやドキュメント、ライブラリが収められています
 
-%prep
-rm -rf $RPM_BUILD_ROOT
+%package        static
+Summary:        Static version of the FFTW library
+Group:          Development/Libraries
+Requires:       %{name}-devel = %{version}-%{release}
+
+%description    static
+This package contains the statically linkable version of
+the FFTW fast Fourier transform library.
 
-# We will be compiling two copies of FFTW, one for double precision and
-# one for single precision.  During the build process, these copies
-# will be stored in fftw-%{version}/double and fftw-%{version}/single
+
+%prep
+# We will be compiling three copies of FFTW, one for double precision, another
+# one for single precision and the other for long double precision. During the 
+# build process, these copies will be stored in fftw-%{version}/double, single
+# and long
 
 # Unpack the tar archive, first (-c) creating a fftw-%{version}
 # directory and then unpacking in there.
 
 %setup -q -c -n fftw-%{version}
-# Now, rename the unpacked FFTW directory to "double":
-mv fftw-%{version} fftw-%{version}-double
 
-# Last, make a copy of this directory in "single":
-cp -r fftw-%{version}-double fftw-%{version}-single
+for dir in single double long; do
+  cp -a fftw-%{version} $dir
+done
+rm -rf fftw-%{version}
 
 %build
-# Configure and build the double and single precision versions.
+# Configure and build the double, single and long double precision versions.
 # Notes:
 #  (1) We install into ${RPM_BUILD_ROOT}, which is set either
 #      by the BuildRoot option above or by --buildroot at build-time.
@@ -64,64 +75,94 @@ cp -r fftw-%{version}-double fftw-%{version}-single
 #      names, while the single-precision version is installed with an "f"
 #      postfix.
 
-cd fftw-%{version}-double
-%ifarch i386 | x86_64
-    %configure --enable-shared --enable-threads --infodir=$RPM_BUILD_ROOT%{_infodir} --enable-sse2
-%else
-    %configure --enable-shared --enable-threads --infodir=$RPM_BUILD_ROOT%{_infodir}
-%endif
-make %{?_smp_mflags}
+# Configure uses g77 by default, if present on system
+export F77=gfortran
 
-cd ../fftw-%{version}-single
-%ifarch i386 | x86_64
-    %configure --enable-shared --enable-threads --infodir=$RPM_BUILD_ROOT%{_infodir} --enable-sse --enable-float
+%ifarch x86_64
+CONFIG_FLAGS="--enable-sse --enable-sse2 --enable-shared --disable-dependency-tracking --enable-threads"
 %else
-    %configure --enable-shared --enable-threads --infodir=$RPM_BUILD_ROOT%{_infodir} --enable-float
+CONFIG_FLAGS="--enable-shared --disable-dependency-tracking --enable-threads"
 %endif
-make %{?_smp_mflags}
-
-%install
-cd fftw-%{version}-double
-%makeinstall
-cd ../fftw-%{version}-single
-%makeinstall
 
-# copy doc files where RPM will find them
-# put the HTML stuff in a sperate dir, so it appears nicely in the docdir
-cp -a doc ../
+pushd double
+        %configure $CONFIG_FLAGS
+        sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
+        sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
+        make %{?_smp_mflags}
+popd
+pushd single
+        %configure $CONFIG_FLAGS --enable-single
+        sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
+        sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
+        make %{?_smp_mflags}
+popd
+pushd long
+        %configure $CONFIG_FLAGS --enable-long-double
+        sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
+        sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
+        make %{?_smp_mflags}
+popd
 
-# do the same to the other %doc files
-cp AUTHORS CONVENTIONS COPYING COPYRIGHT ChangeLog NEWS README TODO ..
+%install
+rm -rf $RPM_BUILD_ROOT doc
+pushd double
+        make install DESTDIR=${RPM_BUILD_ROOT}
+        cp -a AUTHORS COPYING COPYRIGHT ChangeLog NEWS README* TODO ../
+        cp -a doc/ ../
+popd
+pushd single
+        make install DESTDIR=${RPM_BUILD_ROOT}
+popd
+pushd long
+        make install DESTDIR=${RPM_BUILD_ROOT}
+popd
 
 ## remove unuse files
-rm -rf $RPM_BUILD_ROOT%{_libdir}/*.la
+rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir
+rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.la
+
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post
-/sbin/ldconfig
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%post devel
+/sbin/install-info --section="Math" %{_infodir}/%{name}.info.gz %{_infodir}/dir  2>/dev/null || :
+
+%preun devel
+if [ "$1" = 0 ]; then
+  /sbin/install-info --delete %{_infodir}/%{name}.info.gz %{_infodir}/dir 2>/dev/null || :
+fi
 
-%postun
-/sbin/ldconfig
 
 %files
 %defattr (-,root,root)
-%doc doc/html doc/FAQ doc/*ps doc/*tex*
-%doc AUTHORS CONVENTIONS COPYING COPYRIGHT ChangeLog NEWS README TODO
+%doc AUTHORS COPYING COPYRIGHT ChangeLog NEWS README* TODO
 %{_bindir}/fftw*
-%{_libdir}/libfftw3*.so*
-%{_infodir}/fftw3*
+%{_libdir}/libfftw3*.so.*
 %{_mandir}/man1/fftw*
 
-
 %files devel
 %defattr (-,root,root)
+%doc doc/html/ doc/FAQ/fftw-faq.html/ doc/*.pdf
 %{_includedir}/fftw3.*
-%{_libdir}/libfftw3*.a
+%{_libdir}/libfftw3*.so
 %{_libdir}/pkgconfig/fftw3*.pc
+%{_infodir}/fftw3*
+
+%files static
+%defattr (-,root,root)
+%{_libdir}/libfftw3*.a
 
 %changelog
+* Sun Oct 03 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.2.2-1
+- updated to 3.2.2
+- added long double precision support
+- split static libraries
+
 * Sat Sep 20 2008 Shu KONNO <owa@bg.wakwak.com> 3.1.2-1vl5
 - applied new versioning policy, spec in utf-8
 - removed *.la