summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-11-07 08:41:15 +0100
committerRemi Collet <remi@remirepo.net>2017-11-07 08:41:15 +0100
commit5a318c2ddf8fa7d00906863e8e68604e7f71c416 (patch)
treef2b3fd9ac2245fea179d27704faca0a117e0e3ae
New package
-rw-r--r--.gitignore8
-rw-r--r--Makefile4
-rw-r--r--libip2location.spec118
3 files changed, 130 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..fc9aa8c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+clog
+package-*.xml
+*.tgz
+*.tar.gz
+*.tar.xz
+*.tar.xz.asc
+*.src.rpm
+*/*rpm
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..91b0fd5
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,4 @@
+SRCDIR := $(shell pwd)
+NAME := $(shell basename $(SRCDIR))
+include ../../common/Makefile
+
diff --git a/libip2location.spec b/libip2location.spec
new file mode 100644
index 0000000..2e3ccee
--- /dev/null
+++ b/libip2location.spec
@@ -0,0 +1,118 @@
+# 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 <remi@remirepo.net> - 8.0.7-1
+- initial package