File: README.BUILDING-IP2LOCATION

package info (click to toggle)
ipv6calc 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 6,400 kB
  • sloc: ansic: 73,764; sh: 5,750; perl: 4,030; xml: 1,194; makefile: 888
file content (124 lines) | stat: -rw-r--r-- 3,740 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
GENERAL
-------
IP2Location changed the API layer several times
	2.x (no longer in scope)
	4.x -> 6.x
	6.x -> 7.x
	7.x -> 8.x

To avoid issues caused by undetectable incompatibilities (no library version function provided so far),
 program will not start in case of dynamic linking an incompatible library.

Supported so far:
	compiled with 4.0.2, supported library: 4.0.2 - 6.0.3 
	compiled with 6.0.x, supported library: 6.0.1 - 6.0.3 
	compiled with 7.0.0, supported library: 7.0.0

In dynamic load configuration, this will detected and features will be deactivated

Description of the various fields:
http://www.ip2location.com/databases/db24-ip-country-region-city-latitude-longitude-zipcode-timezone-isp-domain-netspeed-areacode-weather-mobile-elevation-usagetype


BUILDING IP2LOCATION
--------------------
If you want to use the IP2Location library with ipv6calc, you will
have to build and install it yourself separately.
Versions below 2.1.3 are NOT suported.


Instructions for version 4.0.2 building as RPM

Check for installed "libtool" package (otherwise, following error message appears: "configure.ac:40: error: possibly undefined macro: AC_PROG_LIBTOOL")


Rebuild available SRPMS (this requires an RPM build environment):

-Download SRPMS from http://rpm.pbone.net/index.php3
  e.g. ftp://ftp.icm.edu.pl/vol/rzm2/linux-mandriva/official/2011/SRPMS/contrib/release/ip2location-4.0.2-1.src.rpm

- extend .rpmmacros:

# for Mandrake SRPMS on non Mandrake systems
%mkrel()          %1
%mklibname(ds)    %{1}%{?2:%{2}}%{?3:_%{3}}%{-s:-static}%{-d:-devel}
%mdkversion       201200
%configure2_5x    %configure
%make             make
%makeinstall_std  %makeinstall

- rebuild by

$ rpmbuild --rebuild ip2location-4.0.2-1.src.rpm

at least on Fedora 17 + RHEL/CentOS 6:
$ QA_RPATHS=$[ 0x0002 ] rpmbuild --rebuild /tmp/ip2location-4.0.2-1.src.rpm


Instructions for version 6.0.1 building as RPM "on-top" of SRPMS for 4.0.2

- download RPM from above, install source rpm
   rpm -ihv PATH/TO/ip2location-4.0.2-1.src.rpm
- download newest version: https://www.ip2location.com/downloads/ip2location-c-6.0.1.tar.gz
- store file in rpmbuild/SOURCES
- apply changes to spec file
   - change version and source in spec file
	Version:        6.0.1
	Source0:        https://www.ip2location.com/downloads/ip2location-c-%{version}.tar.gz
   - remove Patch0 lines
   - remove IP2LOCATION_PRODUCTS_CATALOG.PDF from 2 lines
- build binary package
   rpm -bb rpmbuild/SPECS/ip2location.spec



From source code:

See also instructions on https://www.ip2location.com/developers/c
Note that sources are now available on GitHub

Extract, configure & compile

$ unzip -l master.zip
$ cd IP2Location-C-Library-master
$ autoreconf -i && ./configure && make

Install as user "root"

# make install

This will install following files:

/usr/local/include/IP2Location.h
/usr/local/include/imath.h
/usr/local/lib/libIP2Location.a
/usr/local/lib/libIP2Location.la
/usr/local/lib/libIP2Location.so


Extend dynamic linking

# echo "/usr/local/lib" >>/etc/ld.so.conf.d/usr-local-lib.conf
# ldconfig


Install databases

# mkdir -p /var/local/share/IP2Location
# cp data/IP* /var/local/share/IP2Location/
# chmod 644 /var/local/share/IP2Location/*

Update databases (requires subscription)
http://www.ip2location.com/IPV6-COUNTRY.aspx


Enable IP2Location support by using following configure options:
  --enable-ip2location

  In case, dynamic load of library should be enabled (conditional IP2Location support), add
     --with-ip2location-dynamic

  Having IP2Location databases not stored in /usr/share/IP2Location (or a softlink created), add e.g.
     --with-ip2location-db=/var/local/share/IP2Location

  For more specifc options see ./configure --help