summaryrefslogtreecommitdiffstats
path: root/cmph.spec
blob: e8edf90ad3bc57830c5a88f76492f1e10555b3c9 (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
Name:          cmph
Version:       2.0
Release:       1%{?dist}
Summary:       Minimal hash C library
Group:         System Environment/Libraries
License:       MPLv1.1 or LGPLv2
URL:           http://cmph.sourceforge.net/
Source0:       http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz

BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libtool
BuildRequires: check-devel


%description
Cmph is a free minimal perfect hash C library, providing several algorithms
in the literature in a consistent, ease to use, API.


%package       devel
Summary:       Development files for Cmph library
Group:         Development/Libraries
Requires:      %{name}%{?_isa} = %{version}-%{release}

%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.


%prep
%setup -q

# Fix sources permission
chmod -x src/*.{c,h}

# Honour RPM build flags
sed -e 's/-Wall/$CFLAGS/' -i configure.ac


%build
%if 0%{?rhel} == 5
: Use provided configure in EL5
%else
autoreconf -i --force
%endif

# --enable-cxxmph not used, build broken

%{configure} \
    --enable-check

make %{?_smp_mflags}


%install
make install DESTDIR=%{buildroot}

rm -f %{buildroot}%{_libdir}/lib%{name}.{a,la}


%check
make check


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING LGPL-2 MPL-1.1 README
%{_libdir}/lib%{name}.so.*
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1*

%files devel
%defattr(-,root,root,-)
%{_includedir}/%{name}*
%{_includedir}/chd_ph.h
%{_libdir}/lib%{name}.so
%{_libdir}/pkgconfig/%{name}.pc


%changelog
* Wed Oct  9 2013 Remi Collet <remi@feoraproject.org> - 2.0-1
- Initial package