summary refs log tree commit diff
path: root/pkgs/data/misc/geolite-legacy/builder.sh
blob: 683b2e8606b8bd371b504f965a9e43a8a8e7dcdf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
source "$stdenv/setup"

mkdir -p $out/share/GeoIP
cd $out/share/GeoIP

# Iterate over all environment variable names beginning with "src":
for var in "${!src@}"; do
	# Store the value of the variable with name $var in $src:
	eval src="\$$var"

	# Copy $src to current directory, removing Nix hash from the filename:
	dest="${src##*/}"
	dest="${dest#*-}"
	cp "$src" "$dest"
done

gzip -dv *.gz

ln -s GeoLiteCity.dat GeoIPCity.dat
ln -s GeoLiteCityv6.dat GeoIPCityv6.dat