summaryrefslogtreecommitdiffstats
path: root/unfinished/libepsilon.spec
blob: b95aa4fe49c9687c3bdb4536fb4e5800ba8449d2 (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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# Define a macro for calling ../configure instead of ./configure
%global dconfigure %(printf %%s '%configure' | sed 's!\./configure!../configure!g')

%global short_name epsilon

Name:      libepsilon
Version:   0.8.1
Release:   3%{?dist}
Summary:   Powerful wavelet image compressor
Group:     System Environment/Libraries
License:   GPLv2
URL:       http://sourceforge.net/projects/%{short_name}-project
Source0:   http://downloads.sourceforge.net/%{short_name}-project/%{short_name}-%{version}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

Requires:  %{name}-common = %{version}-%{release}
BuildRequires: popt-devel
#BuildRequires: glibc-devel.i686

%description
EPSILON is a powerful OpenSource wavelet image compressor.
Wavelet-driven compressors are know to be much more effective
than traditional DCT-based ones (like JPEG). At the moment,
the program supports 30+ different wavelet filters, runs
in parallel in multi-threaded and MPI environments, can
process HUGE images and much more.

%package common
Summary:  Common Powerful wavelet image compressor
%description common
EPSILON is a powerful OpenSource wavelet image compressor.

%package openmpi
Summary:   MPI-Powerful wavelet image compressor
BuildRequires: openmpi-devel
# Require explicitly for dir ownership and to guarantee the pickup of the right runtime
Requires: openmpi
Requires: %{name}-common = %{version}-%{release}
%description openmpi
EPSILON is a powerful OpenSource wavelet image compressor.

%package mpich2
Summary:   MPICH2-Powerful wavelet image compressor
BuildRequires: mpich2-devel
# Require explicitly for dir ownership and to guarantee the pickup of the right runtime
Requires: mpich2
Requires: %{name}-common = %{version}-%{release}
%description mpich2
EPSILON is a powerful OpenSource wavelet image compressor.

%package devel
Summary: Development Libraries for libepsilon
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description devel
Contains libraries and header files for
developing applications that use libepsilon.


%prep
%setup -q -n %{short_name}-%{version}
#sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool


%build

#MPI scheint zu funktionieren, mpich2 fliegt raus

# To avoid replicated code define a build macro
%define dobuild() \
mkdir $MPI_COMPILER; \
cd $MPI_COMPILER; \
%dconfigure --enable-pthreads --enable-cluster --disable-static --program-suffix=$MPI_SUFFIX ;\
make %{?_smp_mflags} ; \
cd ..

# Build serial version, dummy arguments
MPI_COMPILER=serial MPI_SUFFIX= %dobuild

# Build parallel versions: set compiler variables to MPI wrappers
#export CC=mpicc
export CXX=mpicxx
#export FC=mpif90
export F77=mpif77

# Build OpenMPI version
%{_openmpi_load}
%dobuild
%{_openmpi_unload}

# Build mpich2 version
%{_mpich2_load}
%dobuild
%{_mpich2_unload}


#%configure \
#        CPPFLAGS="-I/usr/include/openmpi-x86_64/" LDFLAGS="-lmpi"\
#        --prefix=%{_prefix} \
#        --enable-pthreads \
#        --enable-cluster \
#        --disable-static \
#        --enable-mpi

%install
rm -rf %{buildroot}

# Install serial version
make -C serial install DESTDIR=%{buildroot} INSTALL="install -p" CPPROG="cp -p"

# Install OpenMPI version
%{_openmpi_load}
make -C $MPI_COMPILER install DESTDIR=%{buildroot} INSTALL="install -p" CPPROG="cp -p"
%{_openmpi_unload}

# Install MPICH2 version
%{_mpich2_load}
make -C $MPI_COMPILER install DESTDIR=%{buildroot} INSTALL="install -p" CPPROG="cp -p"
%{_mpich2_unload}


# Remove libtool archive
rm -f %{buildroot}/%{_libdir}/%{name}.la
rm -f %{buildroot}/%{_libdir}/%{name}.a
# Das sollte eigentlich auch von selbst gehen.

%clean
rm -rf %{buildroot}


# Single-Variante auch anbieten
# Wenn möglich, Versionen für jeden MPI-Compiler in Fedora. openmpi (f, rh), mpich (rh), mpich2 (f) , mvapich und mvapich2(rh), lam (rh)
# Spezifische Dateien müssen in $MPI_BIN, $MPI_LIB und so
# Binaries brauchen ein Suffix
# Keine ldconfig zulässig!
# Gemeinsames Zeug in -common-Paket das alle benötigen
# Eigene Header-Pakete und Devel-Pakete
#TODO: Options, Doxygen?

#Die Perl-Skripts und man-Pages sind genau gleich. Bins scheinen sich zu unterscheiden. Was ist mit der Bib? Die wird nur einmal gemacht.

%files 
%defattr(-,root,root,-)
%{_bindir}/%{short_name}


%files devel
%defattr(-,root,root,-)
%{_libdir}/*.so
%{_includedir}/*

%files common
%defattr(-,root,root,-)
%doc README AUTHORS ChangeLog TODO COPYING
%{_bindir}/start_%{short_name}_nodes.pl
%{_bindir}/stop_%{short_name}_nodes.pl
%{_libdir}/*.so.*
%{_mandir}/man1/*

%files openmpi
%defattr(-,root,root,-)
%{_bindir}/epsilon_openmpi

%files mpich2
%defattr(-,root,root,-)
%{_bindir}/epsilon_mpich2

%changelog
* Wed Dec 8 2010 Volker Fröhlich <volker27@gmx.at> 0.8.1-3
- Added MPI support

* Mon Dec 5 2010 Volker Fröhlich <volker27@gmx.at> 0.8.1-2
- Included license
- Enable cluster and pthreads

* Sun Dec 5 2010 Volker Fröhlich <volker27@gmx.at> 0.8.1-1
- Initial packaging for Fedora