Name: petit Version: 1.0.3 Release: 1 Summary: Log analysis tool for syslog, Apache and raw log files Group: Applications/System License: GPLv3+ URL: http://crunchtools.com/software/petit/ Source0: http://crunchtools.com/wp-content/files/%{name}/%{name}-%{version}.tgz Patch0: %{name}-%{version}-aix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildArch: noarch BuildRequires: python-devel >= 2.6.2, sed Requires: python >= 2.6.2 %description Log analysis tool which is useful to systems administrators & systems analysts. It interacts with syslog and Apache logs to clarify what is happening in logs. %prep %setup -q -n %{name} %patch0 export PATH=/opt/freeware/bin:$PATH # remove binary manpage rm -f src/man/*.gz # remove hidden svn folders find -type d -name .svn | xargs rm -rf # replace (hardcoded) wrong path: /var/lib -> /opt/freeware/share find src -type f -exec sed -i -e 's|/var/lib|%{_datadir}|' {} \; # remove shebang/interpreter directive where not necessary sed -i -e '/#!\/usr\/bin\/env python/d' src/lib/crunchtools.py %build # nothing to do %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd src mkdir -p ${RPM_BUILD_ROOT}%{_bindir} cp bin/%{name} ${RPM_BUILD_ROOT}%{_bindir}/ chmod 0755 ${RPM_BUILD_ROOT}%{_bindir}/* mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name} cp lib/crunchtools.py ${RPM_BUILD_ROOT}%{_datadir}/%{name}/ chmod 0644 ${RPM_BUILD_ROOT}%{_datadir}/%{name}/* mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}/filters cp lib/filters/*.stopwords ${RPM_BUILD_ROOT}%{_datadir}/%{name}/filters/ chmod 0644 ${RPM_BUILD_ROOT}%{_datadir}/%{name}/filters/* mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}/fingerprints cp lib/fingerprints/*.fp ${RPM_BUILD_ROOT}%{_datadir}/%{name}/fingerprints/ chmod 0644 ${RPM_BUILD_ROOT}%{_datadir}/%{name}/fingerprints/* mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}/fingerprint_library/ cp lib/fingerprint_library/*.fp ${RPM_BUILD_ROOT}%{_datadir}/%{name}/fingerprint_library/ chmod 0644 ${RPM_BUILD_ROOT}%{_datadir}/%{name}/fingerprint_library/* mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man1 cp man/%{name}.1 ${RPM_BUILD_ROOT}%{_mandir}/man1/ chmod 0644 ${RPM_BUILD_ROOT}%{_mandir}/man1/* cd ${RPM_BUILD_ROOT} mkdir -p usr/bin cd usr/bin ln -sf ../..%{_bindir}/* . %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc AUTHORS COPYING README %{_bindir}/%{name} %{_datadir}/%{name} %{_mandir}/man1/%{name}.1 /usr/bin/%{name} %changelog * Wed Nov 10 2010 Michael Perzl - 1.0.3-1 - first version for AIX V5.1 and higher