summaryrefslogtreecommitdiff
path: root/mpich.spec
blob: e040b6dabba4210252b3f8d056a821149f969056 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
Summary:	Portable MPI Model Implementation
Summary(pl):	Przenośna implementacja standardu MPI
Name:		mpich
Version:	1.2.1
Release:	1
License:	Open source (MPICH), BSD-like (MPI-2-C++)
Group:		Development/Libraries
Source0:	ftp://ftp.mcs.anl.gov/pub/mpi/%{name}-%{version}.tar.gz
Patch0:		%{name}-fuckssh.patch
Patch1:		%{name}-opt.patch
Patch2:		%{name}-DESTDIR.patch
URL:		http://www-unix.mcs.anl.gov/mpi/
BuildRequires:	gcc-g77
BuildRequires:	libstdc++-devel
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%description
MPICH is an open-source, portable implementation of the
Message-Passing Interface Standard. It contains a complete
implementation of version 1.2 of the MPI Standard and also significant
parts of MPI-2, particularly in the area of parallel I/O.

%description -l pl
MPICH jest wolnodostępną implementacją standardu MPI (Message-Passing
Interface). Zawiera pełną implementację wersji MPI 1.2 oraz znaczne
części wersji MPI-2, szczególnie w zakresie równoległej komunikacji.

%prep
%setup  -q
%patch0 -p1
%patch1	-p1
%patch2 -p1

%build
# note: can't run autoconf - we must patch configure not only configure.in
# also, don't change it to %%configure - it won't work
# no configure options for sysconfdir and messagecat_dir :/
sysconfdir=%{_sysconfdir} messagecat_dir=%{_libdir} \
./configure \
	--prefix=%{_prefix} --exec_prefix=%{_prefix} \
	--includedir=%{_includedir} --sharedlib=%{_libdir} \
	--libdir=%{_libdir} --datadir=%{_datadir}/%{name} \
	--bindir=%{_bindir} --sbindir=%{_sbindir} \
	--mandir=%{_mandir} --docdir=%{_docdir} \
	-opt="%{rpmcflags}"

%{__make}

%install
rm -rf $RPM_BUILD_ROOT

# really awful
DESTDIR=$RPM_BUILD_ROOT ; export DESTDIR
%{__make} install

# fix symlinks
(cd $RPM_BUILD_ROOT%{_libdir}
rm -f libfmpich.so libmpich.so libpmpich.so
ln -sf libfmpich.so.*.* libfmpich.so
ln -sf libmpich.so.*.* libmpich.so
ln -sf libpmpich.so.*.* libpmpich.so
)

install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
mv -f $RPM_BUILD_ROOT%{_prefix}/examples/* \
	$RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}

(cd $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
rm -f mpirun MPI-2-C++/mpirun
ln -sf %{_bindir}/mpirun mpirun
ln -sf %{_bindir}/mpirun MPI-2-C++/mpirun
)

# argh... where came that 4 from???
for f in $RPM_BUILD_ROOT%{_mandir}/man4/*.4 ; do
	mv -f "$f" $RPM_BUILD_ROOT%{_mandir}/man3/`basename "$f" .4`.3
done

for f in HISTORY LICENSE README TODO ; do
	mv -f MPI-2-C++/$f $f.MPI-2-C++
done

%clean
rm -rf $RPM_BUILD_ROOT

%post	-p /sbin/ldconfig
%postun	-p /sbin/ldconfig

%files
%defattr(644,root,root,755)
%doc doc/guide.ps* COPYRIGHT README announce* KnownBugs *MPI-2-C++
%attr(755,root,root) %{_bindir}/*
%attr(755,root,root) %{_sbindir}/*
%attr(755,root,root) %{_libdir}/lib*.so*
%{_libdir}/lib*.a
%{_sysconfdir}/*
%{_includedir}/*
%{_mandir}/man1/*
%{_mandir}/man3/*
%{_datadir}/mpich
%{_examplesdir}/%{name}-%{version}