File lsof.spec of Package lsof

# spec file for package lsof
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

# norootforbuild

Name:           lsof
Version:        4.84
Release:        3
AutoReqProv:    on
Group:          System/Monitoring
License:        BSD3c ; Other uncritical OpenSource License
Summary:        A Program That Lists Information about Files Opened by Processes
Source:         %{name}_%{version}_src.tar.bz2
Patch0:         %{name}_4.81-include.patch
Patch1:         %{name}_4.81-fmt.patch
Patch2:         lsof-no-build-date-etc.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?sles_version} < 10 || 0%{?sles_version} > 10
BuildRequires:  libselinux-devel

Lsof lists information about files opened by processes. An open file
may be a regular file, a directory, a block special file, a character
special file, an executing text reference, a library, a stream, or a
network file (Internet socket, NFS file, or UNIX domain socket.)  A
specific  file or all the files in a file system may be selected by

    Victor A. Abell <>

%setup -q -n %{name}_%{version}_src

./Configure -n linux
make %{?_smp_mflags} DEBUG="$RPM_OPT_FLAGS -Wall -Wno-unused"
cd tests
chmod u+w TestDB
make DEBUG="$RPM_OPT_FLAGS -Wall -Wno-unused"

install -m755 -d $RPM_BUILD_ROOT%{_bindir} $RPM_BUILD_ROOT%{_mandir}/man8
install -m755 lsof $RPM_BUILD_ROOT%{_bindir}
install -m644 lsof.8 $RPM_BUILD_ROOT%{_mandir}/man8
mkdir SuSE_docs
for s in 00* ; do
	mv $s SuSE_docs/${s#00}
%__sed -i -e "s|/usr/local/bin/perl|/usr/bin/perl|g" scripts/*
mv scripts/00MANIFEST scripts/MANIFEST
mv scripts/00README scripts/README

%{?buildroot:%__rm -rf "%{buildroot}"}

%defattr(-, root, root)
%doc SuSE_docs/* scripts
%doc %{_mandir}/man8/lsof.8%{ext_man}