summaryrefslogtreecommitdiff
path: root/libmaxminddb.spec
blob: 4bba232b9f93c3c25a8fef1bd27936130437d9cd (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
#
# Conditional build:
%bcond_without	static_libs	# static library
%bcond_without	tests		# build without tests

Summary:	Library for working with MaxMind DB files
Summary(pl.UTF-8):	BIblioteka do pracy z plikami MaxMind DB
Name:		libmaxminddb
Version:	1.9.1
Release:	1
License:	Apache v2.0
Group:		Libraries
#Source0Download: https://github.com/maxmind/libmaxminddb/releases
Source0:	https://github.com/maxmind/libmaxminddb/releases/download/%{version}/%{name}-%{version}.tar.gz
# Source0-md5:	05ae20ac98e6b8f473b361bfdd7af61b
URL:		http://maxmind.github.io/libmaxminddb/
%if %{with tests}
BuildRequires:	perl-IPC-Run3
BuildRequires:	perl-Test-Output
BuildRequires:	perl-Test-Simple >= 0.88
%endif
BuildRequires:	pkgconfig
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%description
The libmaxminddb library provides a C library for reading MaxMind DB
files, including the GeoIP2 databases from MaxMind. This is a custom
binary format designed to facilitate fast lookups of IP addresses
while allowing for great flexibility in the type of data associated
with an address.

%description -l pl.UTF-8
Biblioteka libmaxminddb jest biblioteką C do odczytu plików MaxMind
DB, zawierających bazy danych GeoIP2 firmy MaxMind. Jest to własny
format binarny zaprojektowany z myślą o szybkim wyszukiwaniu adresów
IP i dużej elastyczności typu danych powiązanych z adresem.

%package devel
Summary:	Header files for %{name} library
Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki %{name}
Group:		Development/Libraries
Requires:	%{name} = %{version}-%{release}

%description devel
Header files for %{name} library.

%description devel -l pl.UTF-8
Pliki nagłówkowe biblioteki %{name}.

%package static
Summary:	Static %{name} library
Summary(pl.UTF-8):	Statyczna biblioteka %{name}
Group:		Development/Libraries
Requires:	%{name}-devel = %{version}-%{release}

%description static
Static %{name} library.

%description static -l pl.UTF-8
Statyczna biblioteka %{name}.

%prep
%setup -q

%build
%configure \
	%{!?with_static_libs:--disable-static}
%{__make}

%{?with_tests:%{__make} check}

%install
rm -rf $RPM_BUILD_ROOT

%{__make} install \
	DESTDIR=$RPM_BUILD_ROOT

# obsoleted by pkg-config
%{__rm} $RPM_BUILD_ROOT%{_libdir}/libmaxminddb.la

%clean
rm -rf $RPM_BUILD_ROOT

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

%files
%defattr(644,root,root,755)
%doc Changes.md NOTICE README.md
%attr(755,root,root) %{_bindir}/mmdblookup
%attr(755,root,root) %{_libdir}/libmaxminddb.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libmaxminddb.so.0
%{_mandir}/man1/mmdblookup.1*

%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libmaxminddb.so
%{_includedir}/maxminddb.h
%{_includedir}/maxminddb_config.h
%{_pkgconfigdir}/libmaxminddb.pc
%{_mandir}/man3/MMDB_*.3
%{_mandir}/man3/libmaxminddb.3*

%if %{with static_libs}
%files static
%defattr(644,root,root,755)
%{_libdir}/libmaxminddb.a
%endif