# enable the following for intermediate builds #%#define gitcommit d3a4108cb7aeb6f731bb07989f91d8a7f449f0f0 %if 0%{?gitcommit:1} %global shortcommit %(c=%{gitcommit}; echo ${c:0:7}) %define build_timestamp %(date +"%Y%m%d") %global gittag .%{build_timestamp}git%{shortcommit} %endif # shared library support (deselectable) %if "%{?_without_shared:0}%{?!_without_shared:1}" == "1" %define enable_shared 1 %endif Summary: IPv6 address format change and calculation utility Name: ipv6calc Version: 1.0.0 Release: 20%{?gittag}%{?dist} Group: Applications/Text URL: http://www.deepspace6.net/projects/%{name}.html License: GPLv2 %if 0%{?gitcommit:1} Source: https://github.com/pbiering/%{name}/archive/%{gitcommit}/%{name}-%{gitcommit}.tar.gz %else Source: ftp://ftp.bieringer.de/pub/linux/IPv6/ipv6calc/%{name}-%{version}.tar.gz %endif BuildRequires: openssl-devel BuildRequires: perl-generators BuildRequires: perl(Digest::MD5), perl(Digest::SHA1), perl(URI::Escape) BuildRequires: perl(strict), perl(warnings) BuildRequires: procps-ng Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) %if %{enable_shared} Provides: ipv6calc-libs = %{version}-%{release}} %else Conflicts: ipv6calc-libs %endif BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) # mod_ipv6calc related %{!?_httpd_apxs: %{expand: %%global _httpd_apxs %%{_sbindir}/apxs}} %{!?_httpd_moddir: %{expand: %%global _httpd_moddir %%{_libdir}/httpd/modules}} %{!?_httpd_confdir: %{expand: %%global _httpd_confdir %%{_sysconfdir}/httpd/conf.d}} # database support (deselectable) %if "%{?_without_ip2location:0}%{?!_without_ip2location:1}" == "1" %define enable_ip2location 1 %endif %if "%{?_without_geoip:0}%{?!_without_geoip:1}" == "1" %define enable_geoip 1 %endif %if "%{?_without_dbip:0}%{?!_without_dbip:1}" == "1" %define enable_dbip 1 %endif %if "%{?_without_external:0}%{?!_without_external:1}" == "1" %define enable_external 1 %endif %if "%{?_without_mod_ipv6calc:0}%{?!_without_mod_ipv6calc:1}" == "1" %define enable_mod_ipv6calc 1 %endif # database locations %define ip2location_db %{_datadir}/IP2Location %define geoip_db %{_datadir}/GeoIP %define dbip_db %{_datadir}/DBIP %define external_db %{_datadir}/%{name}/db # Berkeley DB selector %define require_db4 %(echo "%{dist}" | egrep -q '^\.el(5|6)$' && echo 1 || echo 0) %if %{require_db4} BuildRequires: db4-devel %else BuildRequires: libdb-devel %endif # RPM license macro detector %define rpm_license_extra %(echo "%{_defaultlicensedir}" | grep -q defaultlicensedir && echo 0 || echo 1) %description ipv6calc is a small utility which formats and calculates IPv4/IPv6 addresses in different ways. Install this package, if you want to retrieve information about a particular IPv4/IPv6/MAC address (-i ADDRESS) or make life easier in adding entries to reverse IPv6 DNS zones (e.g. -a 2001:db8:1234::1/48). In addition many format and type conversions are supported, see online help and/or given URL for more. Also this package contains additional programs - ipv6loganon: anonymize Apache web server logs - ipv6logconv: special Apache web server log converter (examples included for use with analog) - ipv6logstats: create statistics from list of IPv4/IPv6 addresses (examples included for use with gnu-plot) - mod_ipv6calc: Apache module for anonymization/information logging on-the-fly Support for following databases - IP2Location %{?enable_ip2location:ENABLED}%{?!enable_ip2location:DISABLED} default directory for downloaded db files: %{ip2location_db} (requires also external library on system) - GeoIP %{?enable_geoip:ENABLED}%{?!enable_geoip:DISABLED} default directory for downloaded db files: %{geoip_db} (requires also external library on system) - db-ip.com %{?enable_dbip:ENABLED}%{?!enable_dbip:DISABLED} (once generated database files are found on system) default directory for generated db files: %{dbip_db} - External %{?enable_external:ENABLED}%{?!enable_external:DISABLED} default directory for generated db files: %{external_db} Built %{?enable_shared:WITH}%{?!enable_shared:WITHOUT} shared-library Available rpmbuild rebuild options: --without ip2location --without geoip --without dbip --without external --without shared --without mod_ipv6calc %package ipv6calcweb Summary: IP address information web utility Group: Applications/Internet Requires: ipv6calc httpd Requires: perl(URI) perl(Digest::SHA1) perl(Digest::MD5) perl(HTML::Entities) BuildRequires: perl(URI) perl(Digest::SHA1) perl(Digest::MD5) perl(HTML::Entities) %description ipv6calcweb ipv6calcweb contains a CGI program and a configuration file for displaying information of IP addresses on a web page using ipv6calc. Check/adjust %{_sysconfdir}/httpd/conf.d/ipv6calcweb.conf Default restricts access to localhost %if %{enable_mod_ipv6calc} %package mod_ipv6calc Summary: Apache module for ipv6calc Group: Applications/Internet BuildRequires: httpd-devel psmisc curl Requires: httpd >= 2.4.0 Requires: httpd <= 2.4.99999 Requires: ipv6calc = %{version}-%{release} %if %{enable_shared} Requires: ipv6calc-libs = %{version}-%{release}} %endif %description mod_ipv6calc mod_ipv6calc contains an Apache module and a default configuration file. Features: - store anonymized IPv4/v6 address in environment variable - store CountryCode of IPv4/v6 address in environment variable (environment variables can be used for custom log format) Check/adjust %{_sysconfdir}/httpd/conf.d/ipv6calc.conf By default the module is disabled. %endif %prep %if 0%{?gitcommit:1} %setup -q -n %{name}-%{gitcommit} %else %setup -q %endif %configure \ %{?enable_ip2location:--enable-ip2location} \ %{?enable_ip2location:--with-ip2location-dynamic --with-ip2location-headers-fallback} \ --with-ip2location-db=%{ip2location_db} \ %{?enable_geoip:--enable-geoip} \ %{?enable_geoip:--with-geoip-dynamic --with-geoip-headers-fallback} \ --with-geoip-db=%{geoip_db} \ %{?enable_dbip:--enable-dbip} \ --with-dbip-db=%{dbip_db} \ %{?enable_external:--enable-external} \ --with-external-db=%{external_db} \ %{?enable_shared:--enable-shared} \ %{?enable_mod_ipv6calc:--enable-mod_ipv6calc} %build make clean make %{?_smp_mflags} COPTS="$RPM_OPT_FLAGS" %install rm -rf %{buildroot} make install DESTDIR=%{buildroot} ## Install examples and helper files install -d -p %{buildroot}%{_docdir}/%{name}-%{version}/ ## examples install -d %{buildroot}%{_datadir}/%{name}/examples/ # ipv6logconv install -d %{buildroot}%{_datadir}/%{name}/examples/ipv6logconv for file in examples/analog/*.{cfg,txt,tab,sh}; do install $file %{buildroot}%{_datadir}/%{name}/examples/ipv6logconv/ done # ipv6loganon install -d %{buildroot}%{_datadir}/%{name}/examples/ipv6loganon for file in ipv6loganon/README; do install $file %{buildroot}%{_datadir}/%{name}/examples/ipv6loganon/ done # ipv6logstats install -d %{buildroot}%{_datadir}/%{name}/examples/ipv6logstats for file in ipv6logstats/README ipv6logstats/example_* ipv6logstats/collect_ipv6logstats.pl; do install $file %{buildroot}%{_datadir}/%{name}/examples/ipv6logstats/ done # db directory install -d %{buildroot}%{external_db} # ipv6calcweb install -d %{buildroot}%{_sysconfdir}/httpd/conf.d install -d %{buildroot}%{_localstatedir}/www/cgi-bin install ipv6calcweb/ipv6calcweb.conf %{buildroot}%{_sysconfdir}/httpd/conf.d install -m 755 ipv6calcweb/ipv6calcweb.cgi %{buildroot}%{_localstatedir}/www/cgi-bin %clean rm -rf %{buildroot} %check %ifnarch ppc64 make test %endif %files %if %{rpm_license_extra} %doc ChangeLog README CREDITS TODO USAGE doc/ipv6calc.lyx doc/ipv6calc.sgml doc/ipv6calc.html doc/ipv6calc.xml %license COPYING LICENSE %else %doc ChangeLog README CREDITS TODO USAGE doc/ipv6calc.lyx doc/ipv6calc.sgml doc/ipv6calc.html doc/ipv6calc.xml COPYING LICENSE %endif %defattr(644,root,root,755) # binaries %attr(755,-,-) %{_bindir}/* # man pages %{_mandir}/man8/* # tools %attr(755,-,-) %{_datadir}/%{name}/tools/* # shared library %{?enable_shared:%attr(755,-,-) %{_libdir}/libipv6calc*} # database directory %{external_db} # examples %attr(755,-,-) %{_datadir}/%{name}/examples/*/*.pl %attr(755,-,-) %{_datadir}/%{name}/examples/*/*.sh %{_datadir}/%{name}/examples/* %files ipv6calcweb %if %{rpm_license_extra} %doc ipv6calcweb/README ipv6calcweb/USAGE %license COPYING LICENSE %else %doc ipv6calcweb/README ipv6calcweb/USAGE COPYING LICENSE %endif %defattr(644,root,root,755) %attr(755,-,-) %{_localstatedir}/www/cgi-bin/ipv6calcweb.cgi %config(noreplace) %{_sysconfdir}/httpd/conf.d/ipv6calcweb.conf %files mod_ipv6calc %if %{rpm_license_extra} %doc mod_ipv6calc/README.mod_ipv6calc %license COPYING LICENSE %else %doc mod_ipv6calc/README.mod_ipv6calc COPYING LICENSE %endif %defattr(644,root,root,755) %config(noreplace) %{_httpd_confdir}/ipv6calc.conf %attr(755,-,-) %{_httpd_moddir}/mod_ipv6calc.so %post /usr/sbin/ldconfig %postun /usr/sbin/ldconfig %changelog * Fri Jun 23 2017 Peter Bieringer - 1.0.0-20 - new release 1.0.0 * Sun Jun 04 2017 Jitka Plesnikova - 0.99.2-19 - Perl 5.26 rebuild * Sun Apr 16 2017 Peter Bieringer - add missing build requirement procps-ng * Sun Feb 12 2017 Peter Bieringer - add ipv6calc-0.99.2-2017-02-12.patch to fix broken build * Fri Feb 10 2017 Fedora Release Engineering - 0.99.2-18 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Wed Dec 28 2016 Peter Bieringer - 0.99.2-17 - new release 0.99.2 - add support for git commit hash * Sun May 15 2016 Jitka Plesnikova - 0.99.1-16 - Perl 5.24 rebuild * Thu Feb 04 2016 Peter Bieringer - 0.99.1-15 - minor fixes to make fedpkg lint happy * Wed Feb 03 2016 Peter Bieringer - 0.99.1-14 - conditionally set compiler option -Wno-unused-const-variable * Sat Sep 05 2015 Peter Bieringer - 0.99.1-13 - new release 0.99.1 (introduces new subpackage mod_ipv6calc) * Sat Jul 25 2015 Peter Bieringer - Replace ipv6calc.{lyx,sgml,html,xml} by dedicated file.suffix * Wed Jun 17 2015 Fedora Release Engineering - 0.99.0-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Sat Jun 06 2015 Jitka Plesnikova - 0.99.0-11 - Perl 5.22 rebuild * Sat May 02 2015 Peter Bieringer - 0.99.0-10 - new release 0.99.0 * Mon Mar 02 2015 Peter Bieringer - 0.98.0-10 - new (fixed) upstream 0.98.0 tar.gz * Sun Mar 01 2015 Peter Bieringer - 0.98.0-9 - remove not necessary x-bits for some files by proper definition in files section * Fri Feb 20 2015 Peter Bieringer - 0.98.0-8 - new release 0.98.0 * Wed Feb 18 2015 Peter Bieringer - add support for conditional builds * Sat Oct 25 2014 Peter Bieringer - add /usr/share/ipv6calc/db directory * Sat Oct 11 2014 Peter Bieringer - add additional requirements for ipv6calc-ipv6calcweb - enable db-ip.com & external database support * Thu Aug 28 2014 Jitka Plesnikova - 0.97.4-7 - Perl 5.20 rebuild * Tue Aug 19 2014 Peter Bieringer - 0.97.4-7 - new package for EPEL6/EPEL7 * Sun Aug 17 2014 Peter Bieringer - add missing requirement for ipv6calc-ipv6calcweb * Sat Aug 16 2014 Fedora Release Engineering - 0.97.4-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild * Sat Aug 02 2014 Peter Bieringer - 0.97.4-5 - new release 0.97.4 * Thu Jul 31 2014 Peter Bieringer - include also tools into main package - remove UTF-8 conversion, fixed in upstream now * Tue Jul 29 2014 Peter Bieringer - introduce subpackage ipv6calcweb (align with upstream) - enable fallback option for IP2Location - build with dynamic load of GeoIP and IP2Location support * Thu Jul 17 2014 Peter Bieringer - replace DESTDIR=$RPM_BUILD_ROOT with macro, define BuildRoot * Wed Jul 16 2014 Peter Bieringer - change requirements from krb5-libs/devel to openssl(-libs)/-devel * Tue Jul 15 2014 Peter Bieringer - 0.97.3-3 - align package description with upstream * Mon Jul 14 2014 Peter Bieringer - 0.97.3-2 - new release 0.97.3 * Sat Jun 07 2014 Fedora Release Engineering - 0.97.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Mon May 26 2014 Marcela Mašláňová - 0.97.2-2 - new release 0.97.2 * Wed May 21 2014 Marcela Mašláňová - 0.97.1-1 - new release 0.97.1 * Mon May 19 2014 Marcela Mašláňová - 0.97.0-1 - new release 0.97 * Fri Feb 14 2014 Marcela Mašláňová - 0.96.0-1 - new release 0.96 * Mon Dec 2 2013 Marcela Mašláňová - 0.95.0-1 - new release #1033041 * Sat Aug 03 2013 Fedora Release Engineering - 0.94.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Sun Jul 21 2013 Petr Pisar - 0.94.1-2 - Perl 5.18 rebuild * Tue May 14 2013 Marcela Mašláňová - 0.94.1-1 - update to 0.94.1 * Mon Feb 18 2013 Marcela Mašláňová - 0.93.1-6 - fix days in changelog * Thu Feb 14 2013 Fedora Release Engineering - 0.93.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild * Thu Aug 2 2012 Marcela Mašláňová - 0.93.1-4 - 804317 on ppc64 tests never fully worked, conditionalized * Thu Jul 19 2012 Fedora Release Engineering - 0.93.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Mon Jun 11 2012 Petr Pisar - 0.93.1-2 - Perl 5.16 rebuild * Mon Feb 6 2012 Marcela Mašláňová - 0.93.1-1 - minor update * Sun Jan 22 2012 Marcela Mašláňová - 0.93.0-1 - update to 0.93 release - add Perl requirements for cgi * Fri Jan 13 2012 Fedora Release Engineering - 0.92.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Mon Oct 10 2011 Marcela Mašláňová - 0.92.0-1 - update to 0.92 release * Fri May 27 2011 Marcela Mašláňová - 0.90.0-1 - update to 0.90 release * Fri May 6 2011 Marcela Mašláňová - 0.82.1-1 - update to 0.82.1 release * Wed Mar 30 2011 Marcela Mašláňová - 0.82.0-1 - update to 0.82.0 release * Mon Feb 28 2011 Marcela Mašláňová - 0.81.0-1 - update to the new upstream version * Wed Feb 09 2011 Fedora Release Engineering - 0.80.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Tue Jan 4 2011 Marcela Mašláňová - 0.80.0-1 - update to the latest version * Mon Mar 01 2010 Marcela Mašláňová - 0.73.0-1 - update to the latest version * Fri Jul 24 2009 Fedora Release Engineering - 0.72.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Mon Jun 01 2009 Marcela Mašláňová - 0.72.1-1 - update to the latest version - change installonly to standart DESTDIR * Wed Feb 25 2009 Fedora Release Engineering - 0.71.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Thu Jul 31 2008 Tom "spot" Callaway - 0.71.0-3 - fix license tag * Tue Feb 19 2008 Fedora Release Engineering - 0.71.0-2 - Autorebuild for GCC 4.3 * Mon Aug 20 2007 Marcela Maslanova - 0.71.0-1 - new version from upstream * Tue Feb 27 2007 Marcela Maslanova - 0.61-2 - package merge review - rhbz#225910 * Fri Sep 01 2006 Marcela Maslanova - 0.61-1 - upgrade to 0.61-1 - from upstream * Wed Jul 12 2006 Jesse Keating - 0.60.1-1.1 - rebuild * Tue Jul 11 2006 Radek Vokál 0.60.1-1 - upgrade to 0.60.1 - fix for big endian archs * Sun Jun 25 2006 Radek Vokál 0.60.0-1 - upgrade to 0.60.0 * Wed Feb 22 2006 Radek Vokál 0.51-1 - upgrade to 0.51 * Fri Feb 10 2006 Jesse Keating - 0.50-1.2.1 - bump again for double-long bug on ppc(64) * Tue Feb 07 2006 Jesse Keating - 0.50-1.2 - rebuilt for new gcc4.1 snapshot and glibc changes * Fri Dec 09 2005 Jesse Keating - rebuilt * Fri Sep 16 2005 Radek Vokal 0.50-1 - due to several other off-by-one bugs upgrade to 0.50 * Thu Sep 15 2005 Radek Vokal 0.49-2 - smash stack fix in ipv6calc_copy - increase len of tmpstr * Thu Sep 15 2005 Radek Vokal 0.49-1 - upgrade to 0.49 * Tue Apr 19 2005 Radek Vokal 0.48-5 - using CVS tarball, patch clean-up * Sun Apr 17 2005 Robert Scheck - lots of spec file cleanups (#155164) * Wed Apr 13 2005 Florian La Roche - remove empty scripts * Fri Mar 04 2005 Radek Vokal 0.48-3 - gcc4 rebuilt * Mon Nov 1 2004 Radek Vokal 0.48-2 - spec file cleanup - md5 patch for makefile * Sat Oct 30 2004 Peter Bieringer - remove openssl(-devel) from requirements, no longer needed * Tue Oct 26 2004 Radek Vokal 0.47-4 - spec file cleanup, typo patch * Mon Oct 18 2004 Radek Vokal 0.47-3 - initial build for Fedora Core * Sat Nov 22 2003 Peter Bieringer - adjustments * Fri Nov 21 2003 Peter Bieringer - add ipv6logstats - add man pages - add configure options * Mon Nov 11 2002 Peter Bieringer - change IPv6 address in description * Sat Apr 20 2002 Peter Bieringer - Change URL * Sun Apr 07 2002 Peter Bieringer - add more analog example files * Fri Apr 05 2002 Peter Bieringer - remove BuildRequires extension, not needed for normal build * Sun Mar 24 2002 Peter Bieringer - extend BuildRequires for perl /usr/bin/aggregate wget * Mon Mar 18 2002 Peter Bieringer - add ipv6calcweb.cgi * Sat Mar 16 2002 Peter Bieringer - add ipv6logconv, analog examples * Mon Mar 11 2002 Peter Bieringer - Add perl to buildrequire and openssl to require * Mon Jan 21 2002 Peter Bieringer - Add LICENSE + COPYING file * Thu Dec 27 2001 Peter Bieringer - Add comment header - Add call to configure on build * Tue Dec 18 2001 Peter Bieringer - Replace hardwired version number with autoconf/configure variable * Wed Apr 25 2001 Peter Bieringer - Fix permissions of doc files * Thu Mar 15 2001 Peter Bieringer - Add doc directory also to files to make sure the directory will be removed on update or deinstall - change install permissions for entries in doc directory - change "make install" to "make installonly" (make test should be only executed once) * Wed Mar 14 2001 Peter Bieringer - Add "make clean" and "make test" on build * Tue Mar 13 2001 Peter Bieringer - add CREDITS and TODO for install * Sat Mar 10 2001 Peter Bieringer - enable "URL" * Sun Mar 04 2001 Peter Bieringer - change install location to /bin * Tue Feb 27 2001 Peter Bieringer - review for new release, now named "ipv6calc" - review install section for RedHat 7.0.91 * Sun Feb 25 2001 Peter Bieringer - initial build