diff --git a/.gitignore b/.gitignore index e69de29..0430932 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/libmaxminddb-*.tar.gz diff --git a/libmaxminddb.spec b/libmaxminddb.spec new file mode 100644 index 0000000..d0b58ae --- /dev/null +++ b/libmaxminddb.spec @@ -0,0 +1,73 @@ +Name: libmaxminddb +Summary: C library for the MaxMind DB file format +Version: 1.1.1 +Release: 4%{?dist} +URL: https://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 +and the 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 +%{_libdir}/libmaxminddb.so.* + +%files devel +%license NOTICE +%doc Changes.md +%{_bindir}/mmdblookup +%{_includedir}/maxminddb.h +%{_includedir}/maxminddb_config.h +%{_libdir}/libmaxminddb.so +%{_mandir}/man1/* +%{_mandir}/man3/* + + +%changelog +* Mon Sep 14 2015 Jan Vcelak 1.1.1-4 +- remove utils subpackage and place mmdblookup into devel subpackage +- remove Group from the spec file +- move NOTICE and Changes.md to devel subpackage + +* 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 diff --git a/sources b/sources index e69de29..801429b 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +36c31f0814dbf71b210ee57c2b9ef98c libmaxminddb-1.1.1.tar.gz