File: rules

package info (click to toggle)
geoip-database 20170512-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 143,368 kB
  • ctags: 1
  • sloc: sh: 31; makefile: 29
file content (40 lines) | stat: -rwxr-xr-x 1,371 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f

BUILD_DATE := $(shell dpkg-parsechangelog | grep ^Date: | sed "s/^Date: //")

%:
	dh $@

override_dh_install:
	mkdir -p $(CURDIR)/tmp/
	# Building geoip v4 country database.
	/usr/lib/geoip/geoip-generator -v -4 \
		--info="$$(date -u +'GEO-106FREE %Y%m%d Build' -d '$(BUILD_DATE)')" \
		-o $(CURDIR)/tmp/GeoIP.dat GeoIPCountryWhois.csv
	# Convert the v4 csv layout to the v6 one.
	perl /usr/lib/geoip/v4-to-v6-layout.pl \
		< GeoIPCountryWhois.csv \
		> $(CURDIR)/tmp/v4_converted.csv
	# Merge the converted v4 with the v6 database.
	cat v6.csv $(CURDIR)/tmp/v4_converted.csv \
		> $(CURDIR)/tmp/v4v6merged.csv
	# Building geoip v6 country database.
	/usr/lib/geoip/geoip-generator -v -6 \
		--info="$$(date -u +'GEO-106FREE %Y%m%d Build' -d '$(BUILD_DATE)')" \
		-o $(CURDIR)/tmp/GeoIPv6.dat $(CURDIR)/tmp/v4v6merged.csv
	# Building geoip v4 city database.
	/usr/lib/geoip/geoip-generator -v -4 \
		--info="$$(date -u +'GEO-106FREE %Y%m%d Build' -d '$(BUILD_DATE)')" \
		-t GEOIP_CITY_EDITION_REV1 \
		-l GeoLiteCity-Location.csv \
		-o $(CURDIR)/tmp/GeoIPCity.dat \
		GeoLiteCity-Blocks.csv
	# Building ASN database.
	/usr/lib/geoip/geoip-generator-asn -v -4 \
		--info="$$(date -u +'GEO-106FREE %Y%m%d Build' -d '$(BUILD_DATE)')" \
		-o $(CURDIR)/tmp/GeoIPASNum.dat GeoIPASNum2.csv
	dh_install

override_dh_clean:
	rm -rf $(CURDIR)/tmp/
	dh_clean