# set this one to '0' and do "rpm -bc lsof-.spec" to just compile lsof %global final_build 1 Summary: A utility which lists open files on a Linux/UNIX system Name: lsof Version: 4.86 Release: 1 License: zlib Group: Development/Debuggers URL: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof Source0: %{name}_%{version}.tar.bz2 Source1: %{name}_%{version}.tar.bz2.sig %ifos aix5.1 Source2: %{name}-%{version}-aix5.1-64bit %endif %ifos aix5.2 Source2: %{name}-%{version}-aix5.2-64bit %endif %ifos aix5.3 Source2: %{name}-%{version}-aix5.3-64bit %endif Patch0: %{name}-%{version}-check64kern.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root %ifos aix5.1 Requires: AIX-rpm >= 5.1.0.0 Requires: AIX-rpm < 5.2.0.0 %endif %ifos aix5.2 Requires: AIX-rpm >= 5.2.0.0 Requires: AIX-rpm < 5.3.0.0 %endif %ifos aix5.3 Requires: AIX-rpm >= 5.3.0.0 Requires: AIX-rpm < 5.4.0.0 %endif %ifos aix6.1 Requires: AIX-rpm >= 6.1.0.0 Requires: AIX-rpm < 6.2.0.0 %endif %ifos aix7.1 Requires: AIX-rpm >= 7.1.0.0 Requires: AIX-rpm < 7.2.0.0 %endif %description Lsof stands for LiSt Open Files, and it does just that: it lists information about files that are open by the processes running on a UNIX system. %prep %setup -q -n %{name}_%{version} tar xf %{name}_%{version}_src.tar chmod -R u+w * # the patch is only needed for AIX V5.1, V5.2 and V5.3 # starting with AIX V6.1 there is only a 64-bit kernel, no 32-bit kernel anymore %if %final_build %ifos aix5.1 %patch0 %endif %ifos aix5.2 %patch0 %endif %ifos aix5.3 %patch0 %endif %endif %build cd %{name}_%{version}_src %ifos aix5.1 LSOF_VSTR=5.1.0.0 %endif %ifos aix5.2 LSOF_VSTR=5.2.0.0 %endif %ifos aix5.3 LSOF_VSTR=5.3.0.0 %endif %ifos aix6.1 LSOF_VSTR=6.1.0.0 %endif %ifos aix7.1 LSOF_VSTR=7.1.0.0 %endif LSOF_VSTR=${LSOF_VSTR} ./Configure -n aix make %{?_smp_mflags} %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd %{name}_%{version}_src mkdir -p ${RPM_BUILD_ROOT}%{_sbindir} cp %{name} ${RPM_BUILD_ROOT}%{_sbindir}/%{name} %ifos aix5.1 || %ifos aix5.2 || %ifos aix5.3 cp %{SOURCE2} ${RPM_BUILD_ROOT}%{_sbindir}/%{name}64 chmod 2755 ${RPM_BUILD_ROOT}%{_sbindir}/%{name}* %endif /usr/bin/strip -X32_64 ${RPM_BUILD_ROOT}%{_sbindir}/%{name}* || : mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man8 cp %{name}.8 ${RPM_BUILD_ROOT}%{_mandir}/man8/ chmod 0644 ${RPM_BUILD_ROOT}%{_mandir}/man8/ cd ${RPM_BUILD_ROOT} mkdir -p usr/linux/sbin cd usr/linux/sbin ln -sf ../../..%{_sbindir}/* . %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 00* %{_sbindir}/%{name}* %{_mandir}/man*/* /usr/linux/sbin/%{name}* %changelog * Thu Apr 19 2012 Michael Perzl - 4.86-1 - updated to version 4.86 * Fri Oct 14 2011 Michael Perzl - 4.85-1 - first version for AIX V5.1 and higher