File smem.spec of Package smem

# spec file for package smem
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2018-2020, Martin Hauke <>
# 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

Name:           smem
Version:        1.5
Release:        0
Summary:        Application memory usage report tool
License:        GPL-2.0-or-later
Group:          System/Monitoring
Patch0:         smemcap-fix-build.patch
Requires:       python3

smem is a tool that can give numerous reports on memory usage on Linux
systems. Unlike existing tools, smem can report proportional set size (PSS),
which is a more meaningful representation of the amount of memory used by
libraries and applications in a virtual memory system.

Because large portions of physical memory are typically shared among
multiple applications, the standard measure of memory usage known as
resident set size (RSS) will significantly overestimate memory usage. PSS
instead measures each application's "fair share" of each shared area to give
a realistic measure.

%setup -q
%patch0 -p1
sed -i 's|%{_bindir}/env python|%{_bindir}/python3|g' smem

gcc %{optflags} -Wall smemcap.c -o smemcap

install -d %{buildroot}/%{_bindir}
install -pm 0755 smem %{buildroot}/%{_bindir}/smem
install -pm 0755 smemcap %{buildroot}/%{_bindir}/smemcap
install -Dpm 0644 smem.8 %{buildroot}/%{_mandir}/man8/smem.8

%license COPYING

openSUSE Build Service is sponsored by