%if 0%{?rhel} %global apxs /usr/sbin/apxs %endif %if 0%{?fedora} %global apxs /usr/bin/apxs %endif %global apache apache %global apache_libexecdir %(%{apxs} -q LIBEXECDIR) %global apache_sysconfdir %(%{apxs} -q SYSCONFDIR) %global apache_includedir %(%{apxs} -q INCLUDEDIR) %global apache_serverroot %(%{apxs} -q PREFIX) %global apache_localstatedir %(%{apxs} -q LOCALSTATEDIR) %global apache_mmn %(MMN=$(%{apxs} -q LIBEXECDIR)_MMN; test -x $MMN && $MMN) Name: mod_asn Summary: Apache module that looks up the AS and network prefix of IP addresses URL: http://mirrorbrain.org/mod_asn/ Version: 1.5 Release: 1.20131217svn93%{?dist} License: ASL 2.0 Group: Applications/Internet Source: mod_asn-%{version}-1.20131217svn93.tar.gz BuildRequires: httpd-devel Requires: httpd Requires: apr-util-pgsql %description Apache module doing lookups of the autonomous system (AS)[1], and the network prefix[2] which contains a given (clients) IP address. It is written with scalability in mind. To do high-speed lookups, it uses the PostgreSQL ip4r datatype[3] that is indexable with a Patricia Trie[4] algorithm to store network prefixes. This is the only algorithm that can search through the ~250.000 existing prefixes in a breeze. It comes with script to create such a database (and keep it up to date) with snapshots from global routing data - from a router's "view of the world", so to speak. Apache-internally, the module sets the looked up data as env table variables, for perusal by other Apache modules. In addition, it can send it as response headers to the client. It is published under the Apache License, Version 2.0. Source code can be obtained from http://mirrorbrain.org/mod_asn/ resp. http://svn.mirrorbrain.org/svn/mod_asn/ Links: [1] http://en.wikipedia.org/wiki/Autonomous_system_(Internet) [2] http://en.wikipedia.org/wiki/Subnetwork [3] http://pgfoundry.org/projects/ip4r/ [4] http://en.wikipedia.org/wiki/Radix_tree %package tools License: ASL 2.0 Group: Applications/Internet Summary: Tools for maintaining the pgsql db for mod_asn %description tools Tools for maintaining the pgsql db for mod_asn %prep %setup -n mod_asn-%{version} %build %{apxs} -c mod_asn.c %install mkdir -p %{buildroot}%{apache_libexecdir} cp -p .libs/mod_asn.so %{buildroot}%{apache_libexecdir} install -D -p -m 755 asn_import.py %{buildroot}%{_bindir}/asn_import install -D -p -m 755 asn_get_routeviews.py %{buildroot}%{_bindir}/asn_get_routeviews %files %doc docs %doc asn.sql %doc mod_asn.conf %{apache_libexecdir}/mod_asn.so %files tools %{_bindir}/asn_import %{_bindir}/asn_get_routeviews %changelog * Tue Dec 17 2013 Andrea Veri 1.5-1.20131217svn93 - First package release.