A new user interface for you! Read more...

File numactl.spec of Package numactl

%define realname numactl
%define realver  2.0.12
%define srcext   tar.gz

%define so_ver   1

# turn off the generation of debuginfo rpm  (RH9) ??
%global debug_package %{nil}

# Common info
Name:          %{realname}
Version:       %{realver}
Release:       %{?extraver:0.}1%{?dist}
License:       GPL-2.0
Group:         System/Management
URL:           https://github.com/numactl/numactl/
Summary:       Program to control NUMA policy for processes or shared memory

# Build-time parameters
BuildRequires: pkg-config
BuildRoot:     %{_tmppath}/%{name}-root
Source:        https://github.com/numactl/numactl/releases/download/v%{realver}/%{realname}-%{realver}%{?extraver}.%{srcext}

%description
numactl runs processes with a specific NUMA scheduling or memory
placement policy. The policy is set for command and inherited by all
of its children. In addition it can set persistent policy for shared
memory segments or files.

%package -n %{?suse_version:libnuma%{?so_ver}}%{!?suse_version:numactl-libs}
License:       LGPL-2.1
Group:         System/Libraries
Summary:       NUMA policy library

%description -n %{?suse_version:libnuma%{?so_ver}}%{!?suse_version:numactl-libs}
The libnuma library offers a simple programming interface to the
NUMA (Non Uniform Memory Access) policy supported by the Linux kernel.

The libnuma library provides convenient ways for you to add NUMA memory policies
into your own program.

%package -n %{?suse_version:lib}numa%{!?suse_version:ctl}-devel
License:       LGPL-2.1
Group:         Development/Languages/C and C++
Summary:       Development files for %{name}
Requires:      %{?suse_version:libnuma%{?so_ver}}%{!?suse_version:numactl-libs} = %{version}-%{release}
Provides:      %{!?suse_version:lib}numa-devel

%description -n %{?suse_version:lib}numa%{!?suse_version:ctl}-devel
Development files for %{name}

# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{realver}%{?extraver}

%build
%configure \
 --disable-static \
 CFLAGS="%{optflags}" \
 CXXFLAGS="%{optflags}" \
 LDFLAGS="-Wl,--as-needed -Wl,--strip-all -Wl,-z,now -Wl,-z,relro"
%{__make} %{?_smp_mflags}

%install
%{__make} install DESTDIR=%{buildroot}

%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}

%files
%defattr(-,root,root)
%doc README.md
%{_bindir}/*
%doc %{_mandir}/man8/*

%files -n %{?suse_version:libnuma%{?so_ver}}%{!?suse_version:numactl-libs}
%defattr(-,root,root)
%{_libdir}/libnuma.so.%{?so_ver}*

# Development stuff
%files -n %{?suse_version:lib}numa%{!?suse_version:ctl}-devel
%defattr(-,root,root)
%{_includedir}/*.h
%{_libdir}/pkgconfig/numa.pc
%{_libdir}/libnuma.so
%exclude %{_libdir}/*.la
%doc %{_mandir}/man2/*
%doc %{_mandir}/man3/*

%post   -n %{?suse_version:libnuma%{?so_ver}}%{!?suse_version:numactl-libs} -p /sbin/ldconfig
%postun -n %{?suse_version:libnuma%{?so_ver}}%{!?suse_version:numactl-libs} -p /sbin/ldconfig

%changelog