Name: libmaxminddb Summary: C library for the MaxMind DB file format Version: 1.1.1 Release: 3%{?dist} Group: Development/Libraries URL: http://maxmind.github.io/libmaxminddb Source0: https://github.com/maxmind/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz # original libmaxminddb code is Apache Licence 2.0 # src/maxminddb-compat-util.h is BSD License: ASL 2.0 and BSD %description The package contains libmaxminddb library. %package devel Requires: %{name}%{?_isa} = %{version}-%{release} Summary: Development header files for libmaxminddb %description devel The package contains development header files for the libmaxminddb library. %package utils Requires: %{name}%{?_isa} = %{version}-%{release} Summary: Utilities distributed with libmaxminddb %description utils The package contains mmdblookup utility which allows IP address lookup in a MaxMind DB file. %prep %setup -q %build %configure --disable-static # remove embeded RPATH sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool # link only requried libraries sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool make %{?_smp_mflags} %check # tests are linked dynamically, preload the library as we have removed RPATH LD_PRELOAD=%{buildroot}%{_libdir}/libmaxminddb.so make check %install %make_install rm -fv %{buildroot}%{_libdir}/*.la %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %license LICENSE %doc NOTICE Changes.md %{_libdir}/libmaxminddb.so.* %files devel %{_includedir}/maxminddb.h %{_includedir}/maxminddb_config.h %{_libdir}/libmaxminddb.so %{_mandir}/man3/* %files utils %{_bindir}/mmdblookup %{_mandir}/man1/* %changelog * Thu Sep 03 2015 Jan Vcelak 1.1.1-3 - updated package licence - added --as-needed linker flag * Tue Sep 01 2015 Jan Vcelak 1.1.1-1 - initial version of the package