summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2020-09-24 14:46:55 +0200
committerRemi Collet <remi@remirepo.net>2020-09-24 14:46:55 +0200
commitb2ff3724e367d82a1804759e01147713129910c5 (patch)
tree41f591319d68af97b680cd59297243fed3e9b9b1
parent68502f3287a08eea44a240d9ab8372fc2f775278 (diff)
sync with Fedora
-rw-r--r--IP2Location.spec195
-rw-r--r--libip2location.spec121
2 files changed, 195 insertions, 121 deletions
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 <pb@bieringer.de> - 8.0.9-10
+- add additional Obsoletes/Provides/BuildRequires
+
+* Tue Sep 15 2020 Peter Bieringer <pb@bieringer.de> - 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 <pb@bieringer.de> - 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 <pb@bieringer.de> - 8.0.9-6
+- add patch to sync with upstream
+- add patch to make rpmlint happy
+
+* Fri Aug 28 2020 Peter Bieringer <pb@bieringer.de>
+- fix spec file according to BZ#1873302
+
+* Sat Oct 5 2019 Peter Bieringer <pb@bieringer.de> - 8.0.9-5
+- update version to 8.0.9
+
+* Tue Nov 7 2017 Remi Collet <remi@remirepo.net> - 8.0.7-1
+- initial package
diff --git a/libip2location.spec b/libip2location.spec
deleted file mode 100644
index 0df7ba4..0000000
--- a/libip2location.spec
+++ /dev/null
@@ -1,121 +0,0 @@
-# remirepo/fedora spec file for libip2location
-#
-# Copyright (c) 2017-2018 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}
-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: gcc
-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
-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
-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
-
-
-%if 0%{?fedora} < 28 && 0%{?rhel} < 8
-%post -p /sbin/ldconfig
-%postun -p /sbin/ldconfig
-%endif
-
-
-%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
-* Mon Feb 26 2018 Remi Collet <remi@remirepo.net> - 8.0.7-2
-- F28 cleanup
-
-* Tue Nov 7 2017 Remi Collet <remi@remirepo.net> - 8.0.7-1
-- initial package