From b2ff3724e367d82a1804759e01147713129910c5 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 24 Sep 2020 14:46:55 +0200 Subject: sync with Fedora --- IP2Location.spec | 195 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100644 IP2Location.spec (limited to 'IP2Location.spec') diff --git a/IP2Location.spec b/IP2Location.spec new file mode 100644 index 0000000..d7cd116 --- /dev/null +++ b/IP2Location.spec @@ -0,0 +1,195 @@ +# remirepo spec file for IP2Location, from +# +# fedora spec file for IP2Location +# +# License: MIT +# http://opensource.org/licenses/MIT +# +# Please, preserve the changelog entries +# +%define version 8.0.9 + +# enable the following for intermediate builds +%define gitcommit 6e49424dfc998856fa790df498bf77520e72ca28 + +%if 0%{?gitcommit:1} +%global shortcommit %(c=%{gitcommit}; echo ${c:0:7}) +%define build_timestamp %(date +"%Y%m%d") +%global gittag .%{build_timestamp}git%{shortcommit} +%endif + +Name: IP2Location +Summary: C library for mapping IP address to geolocation information +Version: %{version} +Release: 10%{?gittag}%{?dist} +License: MIT +URL: http://www.ip2location.com/ +%if 0%{?gitcommit:1} +Source0: https://github.com/chrislim2888/IP2Location-C-Library/archive/%{gitcommit}/%{name}-%{gitcommit}.tar.gz +%else +Source0: https://github.com/chrislim2888/IP2Location-C-Library/archive/%{version}/%{name}-%{version}.tar.gz +Patch0: IP2Location-8.0.9-adebc0ef.patch +Patch1: IP2Location-8.0.9-rpmlint.patch +%endif +BuildRequires: libtool +BuildRequires: perl(Math::BigInt) +BuildRequires: gcc +BuildRequires: autoconf +BuildRequires: automake + +Obsoletes: libip2location < %{version} +Provides: libip2location = %{version} + + +%description +IP2Location C library enables the user to get the country, region, city, +coordinates, ZIP code, time zone, ISP, domain name, connection type, +area code, weather info, mobile carrier, elevation and usage type from any IP +address or hostname. This library has been optimized for speed and memory +utilization. The library contains API to query all IP2Location LITE and +commercial binary databases. + +Users can download the latest LITE database from IP2Location web site using e.g. +the included downloader. + + +%package devel +Summary: Static library and header files for the IP2Location library +Requires: %{name} = %{version}-%{release} +Provides: %{name}-devel = %{version}-%{release} + +Obsoletes: libip2location-devel < %{version} +Provides: libip2location-devel = %{version} + + +%description devel +IP2Location C library enables the user to get the country, region, city, +coordinates, ZIP code, time zone, ISP, domain name, connection type, +area code, weather info, mobile carrier, elevation and usage type from any IP +address or hostname. This library has been optimized for speed and memory +utilization. The library contains API to query all IP2Location LITE and +commercial binary databases. + +This package contains the development files for the IP2Location library. + + +%package data-sample +Summary: Sample data files for the IP2Location library +Requires: %{name} = %{version}-%{release} + +Obsoletes: ip2location-country < %{version} +Provides: ip2location-country = %{version} + + +%description data-sample +IP2Location C library enables the user to get the country, region, city, +coordinates, ZIP code, time zone, ISP, domain name, connection type, +area code, weather info, mobile carrier, elevation and usage type from any IP +address or hostname. This library has been optimized for speed and memory +utilization. The library contains API to query all IP2Location LITE and +commercial binary databases. + +This package contains the sample data files for testing the library. + +Latest lite databases can be downloaded from + https://lite.ip2location.com + +Further sample databases can be downloaded from + https://www.ip2location.com/development-libraries/ip2location/c + + +%prep +%if 0%{?gitcommit:1} +%setup -q -n IP2Location-C-Library-%{gitcommit} +%else +%setup -q -n IP2Location-C-Library-%{version} +%patch0 -p1 +%patch1 -p1 +%endif + +# remove a warning option which break configure on older gcc versions +# (at least gcc version 4.1.2 20080704) +perl -pi -e 's/-Wno-unused-result//' configure.ac + + +%build +sh ./bootstrap +autoreconf -fiv + +%configure --disable-static +%make_build COPTS="$RPM_OPT_FLAGS" + +# convert CSV to BIN +make -C data convert + + +%check +LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH make check + + +%install +%make_install + +# cleanup +rm -f %{buildroot}%{_libdir}/*.*a + +# tools +install -d %{buildroot}%{_datadir}/%{name}/tools +install -pm 0755 tools/download.pl %{buildroot}%{_datadir}/%{name}/tools + +# database directory +install -d %{buildroot}%{_datadir}/%{name}/ +# note: according to https://www.ip2location.com/development-libraries/ip2location/c +# IPv6 sample file has *.SAMPLE* while IPv4 has *-SAMPLE* in ZIP file +install -p data/IP-COUNTRY.BIN %{buildroot}%{_datadir}/%{name}/IP-COUNTRY-SAMPLE.BIN +install -p data/IPV6-COUNTRY.BIN %{buildroot}%{_datadir}/%{name}/IPV6-COUNTRY.SAMPLE.BIN + + +%files +%license COPYING LICENSE.TXT + +%doc AUTHORS ChangeLog README.md NEWS + +%{_libdir}/libIP2Location.so.1 +%{_libdir}/libIP2Location.so.1.0.0 + +%{_datadir}/%{name}/tools/ + +%dir %{_datadir}/%{name}/ + + +%files devel +%{_includedir}/IP2Loc*.h +%{_libdir}/libIP2Location.so + +%doc Developers_Guide.txt + + +%files data-sample +%attr(644,-,-) %{_datadir}/%{name}/*.BIN + + +%changelog +* Thu Sep 24 2020 Peter Bieringer - 8.0.9-10 +- add additional Obsoletes/Provides/BuildRequires + +* Tue Sep 15 2020 Peter Bieringer - 8.0.9-8 +- subpackage data-sample: add suffix "SAMPLE" to included BIN files, fix file permissions +- use latest sources, git commit 6e49424dfc998856fa790df498bf77520e72ca28 + +* Fri Sep 11 2020 Peter Bieringer - 8.0.9-7 +- use latest sources, git commit 9a987645663b2e13191072df9d8866bf65bc85f5 +- add subpackage data-sample including the generated BIN files + +* Tue Sep 08 2020 Peter Bieringer - 8.0.9-6 +- add patch to sync with upstream +- add patch to make rpmlint happy + +* Fri Aug 28 2020 Peter Bieringer +- fix spec file according to BZ#1873302 + +* Sat Oct 5 2019 Peter Bieringer - 8.0.9-5 +- update version to 8.0.9 + +* Tue Nov 7 2017 Remi Collet - 8.0.7-1 +- initial package -- cgit