# remirepo/fedora spec file for libip2location # # Copyright (c) 2017 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # %global libname libIP2Location %global gh_commit e2b833065859250f8458e0983614e341613c87ba %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner chrislim2888 %global gh_project IP2Location-C-Library %global dbdir %{_datadir}/ip2location %global upstream_version 8.0.7 #global upstream_prever RC1 Name: libip2Location Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} Release: 1%{?dist} Group: System Environment/Libraries Summary: IP2Location C Library License: MIT URL: https://github.com/%{gh_owner}/%{gh_project} Source0: %{url}/archive/%{gh_commit}/%{gh_project}-%{upstream_version}%{?upstream_prever}-%{gh_short}.tar.gz BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool BuildRequires: %{_bindir}/perl BuildRequires: perl(Math::BigInt) %description IP2Location is a C library that enables the user to find the country, region, city, latitude, longitude, zip code, time zone, ISP, domain name, connection type, area code, weather, mobile network, elevation, usage type by IP address or hostname originates from. The library reads the geo location information from IP2Location BIN data file. Supported IPv4 and IPv6 address. %package -n ip2location-country Group: Development/Libraries Summary: Country database for %{name} Requires: %{name} = %{version}-%{release} BuildArch: noarch %description -n ip2location-country The %{name}-country package contains IPv4 anb IPv6 country databases. %package devel Group: Development/Libraries Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %prep %setup -qn %{gh_project}-%{gh_commit} sed -e 's/\r//' -i tools/download.pl mv README.md README sh ./bootstrap autoreconf -i -v --force %build %configure --disable-static make %{?_smp_mflags} make -C data convert %install make install DESTDIR=%{buildroot} rm %{buildroot}%{_libdir}/*.la install -Dpm 644 data/IP-COUNTRY.BIN %{buildroot}%{dbdir}/IP-COUNTRY.BIN install -Dpm 644 data/IPV6-COUNTRY.BIN %{buildroot}%{dbdir}/IPV6-COUNTRY.BIN install -Dpm 755 tools/download.pl %{buildroot}%{dbdir}/download.pl %check make check %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %{!?_licensedir:%global license %%doc} %license COPYING %{_libdir}/%{libname}.so.1* %dir %{dbdir} %{dbdir}/download.pl %files -n ip2location-country %{dbdir}/IP*BIN %files devel %doc Developers_Guide.txt %{_includedir}/IP*.h %{_libdir}/%{libname}.so %changelog * Tue Nov 7 2017 Remi Collet - 8.0.7-1 - initial package