%define webalizer_uid 67 %define ver 2.23 %define patchlevel 08 %define _default_patch_fuzz 2 Name: webalizer Summary: A flexible Web server log file analysis program Group: Applications/Internet Version: %{ver}_%{patchlevel} Release: 1 URL: http://www.mrunix.net/webalizer/ License: GPLv2+ Source0: ftp://ftp.mrunix.net/pub/webalizer/%{name}-%{ver}-%{patchlevel}-src.tgz Source1: %{name}.conf Source2: %{name}-httpd.conf Patch0: %{name}-%{version}-aix.patch Patch4: %{name}-2.21-02-underrun.patch Patch6: %{name}-2.23-05-confuser.patch Patch9: %{name}-2.23-08-groupvisit.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: patch BuildRequires: bzip2 >= 1.0.2-4 BuildRequires: db4-devel >= 4.7.25-2 BuildRequires: gd-devel >= 2.0.35-5 BuildRequires: GeoIP-devel >= 1.4.7-0.1.20090931cvs BuildRequires: zlib-devel >= 1.2.3-3 Requires: bzip2 >= 1.0.2-4 Requires: db4 >= 4.7.25-2 Requires: gd >= 2.0.35-5 Requires: GeoIP >= 1.4.7-0.1.20090931cvs Requires: zlib >= 1.2.3-3 Requires: httpd %description The Webalizer is a Web server log analysis program. It is designed to scan Web server log files in various formats and produce usage statistics in HTML format for viewing through a browser. It produces professional looking graphs which make analyzing when and where your Web traffic is coming from easy. %prep %setup -q -n %{name}-%{ver}-%{patchlevel} export PATH=/opt/freeware/bin:$PATH %patch4 -p1 -b .underrun %patch6 -p1 -b .confuser %patch9 -p1 -b .groupvisit %patch0 %build ./configure \ --prefix=%{_prefix} \ --localstatedir=/var \ --mandir=%{_mandir} \ --enable-dns \ --enable-bz2 \ --enable-geoip make %{?_smp_mflags} %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} make install DESTDIR=${RPM_BUILD_ROOT} /usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/* || : rm -f ${RPM_BUILD_ROOT}%{_sysconfdir}/webalizer.conf.sample mkdir -p ${RPM_BUILD_ROOT}/var/lib/%{name} chmod 0755 ${RPM_BUILD_ROOT}/var/lib/%{name} cp %{SOURCE1} ${RPM_BUILD_ROOT}%{_sysconfdir}/ chmod 0644 ${RPM_BUILD_ROOT}%{_sysconfdir}/* mkdir -p ${RPM_BUILD_ROOT}/var/www/usage chmod 0755 ${RPM_BUILD_ROOT}/var/www/usage cp *.png ${RPM_BUILD_ROOT}/var/www/usage/ chmod 0644 ${RPM_BUILD_ROOT}/var/www/usage/* mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d chmod 0755 ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d cp %{SOURCE2} ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d/webalizer.conf chmod 0644 ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d/webalizer.conf cd ${RPM_BUILD_ROOT} mkdir -p usr/bin cd usr/bin ln -sf ../..%{_bindir}/* . %pre # add the "webalizr" user only if it does not yet exist result=`/usr/sbin/lsuser webalizr | /usr/bin/awk '{ print $1 }' 2>/dev/null` if [[ "${result}" != "webalizr" ]] ; then /usr/bin/mkuser id=%{webalizer_uid} pgrp='system' gecos='Webalizer User' \ home='/var/www/usage' login='false' rlogin='false' webalizr 2> /dev/null || : fi %preun # remove "webalizr" user /usr/sbin/rmuser -p webalizr || : %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system) %doc README %config(noreplace) %{_sysconfdir}/webalizer.conf %config(noreplace) %{_sysconfdir}/httpd/conf.d/webalizer.conf %{_bindir}/* %{_mandir}/man1/*.1* %attr(-,webalizr,system) %dir /var/www/usage %attr(-,webalizr,system) %dir /var/lib/webalizer %attr(-,webalizr,system) /var/www/usage/*.png /usr/bin/* %changelog * Wed Oct 29 2014 Michael Perzl - 2.23_08-1 - updated to version 2.23_08 * Mon Nov 21 2011 Michael Perzl - 2.23_05-1 - updated to version 2.23_05 * Tue Apr 19 2011 Michael Perzl - 2.21_02-1 - first version for AIX V5.1 and higher