b7ed774
Name:           libmaxminddb
b7ed774
Summary:        C library for the MaxMind DB file format
2fd59fc
Version:        1.2.0
d800759
Release:        4%{?dist}
b7ed774
URL:            https://maxmind.github.io/libmaxminddb
b7ed774
Source0:        https://github.com/maxmind/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz
b7ed774
b7ed774
# original libmaxminddb code is Apache Licence 2.0
b7ed774
# src/maxminddb-compat-util.h is BSD
b7ed774
License:        ASL 2.0 and BSD
b7ed774
d008644
BuildRequires:  perl-interpreter
1c931df
b7ed774
%description
b7ed774
The package contains libmaxminddb library.
b7ed774
b7ed774
%package devel
b7ed774
Requires:       %{name}%{?_isa} = %{version}-%{release}
864ebd1
Requires:       pkgconfig
b7ed774
Summary:        Development header files for libmaxminddb
b7ed774
b7ed774
%description devel
b7ed774
The package contains development header files for the libmaxminddb library
b7ed774
and the mmdblookup utility which allows IP address lookup in a MaxMind DB file.
b7ed774
b7ed774
%prep
b7ed774
%setup -q
b7ed774
b7ed774
%build
b7ed774
%configure --disable-static
b7ed774
# remove embeded RPATH
b7ed774
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
b7ed774
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
b7ed774
# link only requried libraries
b7ed774
sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool
b7ed774
make %{?_smp_mflags}
b7ed774
b7ed774
%check
b7ed774
# tests are linked dynamically, preload the library as we have removed RPATH
b7ed774
LD_PRELOAD=%{buildroot}%{_libdir}/libmaxminddb.so make check
b7ed774
b7ed774
%install
b7ed774
%make_install
b7ed774
rm -fv %{buildroot}%{_libdir}/*.la
b7ed774
b7ed774
%post -p /sbin/ldconfig
b7ed774
b7ed774
%postun -p /sbin/ldconfig
b7ed774
b7ed774
%files
b7ed774
%license LICENSE
b7ed774
%{_libdir}/libmaxminddb.so.*
b7ed774
b7ed774
%files devel
b7ed774
%license NOTICE
b7ed774
%doc Changes.md
b7ed774
%{_bindir}/mmdblookup
b7ed774
%{_includedir}/maxminddb.h
b7ed774
%{_includedir}/maxminddb_config.h
b7ed774
%{_libdir}/libmaxminddb.so
864ebd1
%{_libdir}/pkgconfig/libmaxminddb.pc
b7ed774
%{_mandir}/man1/*
b7ed774
%{_mandir}/man3/*
b7ed774
b7ed774
%changelog
d800759
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-4
d800759
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
d800759
b8334d5
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-3
b8334d5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
b8334d5
3917428
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-2
3917428
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
3917428
2fd59fc
* Sun Mar 27 2016 Jan Vcelak <jvcelak@fedoraproject.org> 1.2.0-1
2fd59fc
- rebase to new version
2fd59fc
dce12f9
* Mon Mar 21 2016 Jan Vcelak <jvcelak@fedoraproject.org> 1.1.5-1
dce12f9
- rebase to new version
dce12f9
60bc7b4
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.1-6
60bc7b4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
60bc7b4
864ebd1
* Tue Sep 15 2015 Jan Vcelak <jvcelak@fedoraproject.org> 1.1.1-5
864ebd1
- add pkg-config file from the upcoming upstream version
864ebd1
b7ed774
* Mon Sep 14 2015 Jan Vcelak <jvcelak@fedoraproject.org> 1.1.1-4
b7ed774
- remove utils subpackage and place mmdblookup into devel subpackage
b7ed774
- remove Group from the spec file
b7ed774
- move NOTICE and Changes.md to devel subpackage
b7ed774
b7ed774
* Thu Sep 03 2015 Jan Vcelak <jvcelak@fedoraproject.org> 1.1.1-3
b7ed774
- updated package licence
b7ed774
- added --as-needed linker flag
b7ed774
b7ed774
* Tue Sep 01 2015 Jan Vcelak <jvcelak@fedoraproject.org> 1.1.1-1
b7ed774
- initial version of the package