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

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
autoreconf -i --force

# --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


%if 0%{?fedora} < 28 && 0%{?rhel} < 8
%post   -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%endif


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

%files devel
%{_includedir}/%{name}*
%{_includedir}/chd_ph.h
%{_libdir}/lib%{name}.so
%{_libdir}/pkgconfig/%{name}.pc


%changelog
* Mon Feb 26 2018 Remi Collet <remi@feoraproject.org> - 2.0-2
- F28 cleanup

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