File xtables-geoip.spec of Package xtables-geoip

# spec file for package xtables-geoip
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           xtables-geoip
Version:        2011.02
Release:        1
Group:          Productivity/Networking/Security
Summary:        GeoIP database files for xt_geoip
License:        BSD
Source1:        GeoIPCountryWhois.csv.xz
Source2:        GeoIPv6.csv.xz
Source3:        MAXMIND_LICENSE.txt
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  xtables-addons >= 1.33
BuildRequires:  perl perl-Text-CSV_XS xz

The package contains the GeoIP definition files (which IP addresses
belong to which country) that are needed for Xtables-addons's
xt_geoip module.

This product includes GeoLite data created by MaxMind, available from

	The GeoIP data is from
Please do not contact them for errors with this package.

cp "%{S:3}" .;

xz -cd "%{S:1}" >ipv4.csv;
xz -cd "%{S:2}" >ipv6.csv;

rm -Rf "$b"
mkdir "$b"
mkdir -p "$b/%_datadir/xt_geoip";
%_libexecdir/xtables-addons/xt_geoip_build \
	-D "$b/%_datadir/xt_geoip" *.csv;

rm -Rf "%buildroot"