# 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.2.0 %define soname 3 # 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: 0%{?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 %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} %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 %if 0%{?make_build:1} %make_build COPTS="$RPM_OPT_FLAGS" %else make %{?_smp_mflags} COPTS="$RPM_OPT_FLAGS" %endif # convert CSV to BIN make -C data convert %check LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH make check %install %if 0%{?make_install:1} %make_install %else make install DESTDIR=%{buildroot} %endif # 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 %{!?_licensedir:%global license %%doc} %license COPYING LICENSE.TXT %doc AUTHORS ChangeLog README.md NEWS %{_libdir}/libIP2Location.so.%{soname} %{_libdir}/libIP2Location.so.%{soname}.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 * Sat Oct 17 2020 Remi Collet - 8.2.0-0 - sync with Fedora and rename to IP2location - rebuild for #remirepo with release = 0 to manage update from old version * Wed Oct 07 2020 Peter Bieringer - 8.2.0-12 - update version to 8.2.0 (soname: 3) * Tue Oct 6 2020 Remi Collet - 8.1.3-0 - sync with Fedora and rename to IP2location - rebuild for #remirepo with release = 0 to manage update from old version * Fri Sep 25 2020 Peter Bieringer - 8.1.3-11 - update version to 8.1.3 * Fri Sep 25 2020 Peter Bieringer - 8.1.2-11 - update version to 8.1.2 (soname: 2) * Thu Sep 24 2020 Remi Collet - 8.0.9-0 - sync with Fedora and rename to IP2location - rebuild for #remirepo with release = 0 to manage update from old version * 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