Here are spec files for powertop 2.16

I saw powertop is outdated. So created the updated .spec files (with help of AI; i am learning)

sharing here if anyone needs it.
feel free to delete if it doesn’t belong here

%define major   1
%define libname %mklibname traceevent %{major}
%define devname %mklibname traceevent -d

Summary:	Linux kernel trace event parsing library
Name:		libtraceevent
Version:	1.8.4
Release:	1
License:	LGPLv2.1
Group:		System/Libraries
Url:		https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/
Source0:	https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/snapshot/%{name}-%{version}.tar.gz

BuildSystem:	meson
BuildOption:	-Ddefault_library=shared
BuildOption:	-Ddoc=false

BuildRequires:	meson

%description
libtraceevent parses the raw Linux kernel trace event formats used by
ftrace and perf. It was originally embedded in trace-cmd and later
split out into its own library

%package -n %{libname}
Summary:	Linux kernel trace event parsing library
Group:		System/Libraries

%description -n %{libname}
libtraceevent parses the raw Linux kernel trace event formats used by
ftrace and perf.

%package -n %{devname}
Summary:	Development files for libtraceevent
Group:		Development/C
Requires:	%{libname} = %{version}-%{release}
Provides:	libtraceevent-devel = %{version}-%{release}

%description -n %{devname}
Headers, pkgconfig file, and unversioned .so symlink needed to build
software against libtraceevent.

%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig

%files -n %{libname}
%{_libdir}/%{name}.so.%{major}*
%dir %{_libdir}/traceevent
%{_libdir}/traceevent/plugins/

%files -n %{devname}
%{_libdir}/%{name}.so
%{_libdir}/pkgconfig/%{name}.pc
%{_includedir}/traceevent/
%define major   1
%define libname %mklibname tracefs %{major}
%define devname %mklibname tracefs -d

Summary:	Linux kernel tracefs access library
Name:		libtracefs
Version:	1.8.3
Release:	1
License:	LGPLv2.1
Group:		System/Libraries
Url:		https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/
Source0:	https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/snapshot/%{name}-%{version}.tar.gz

BuildSystem:	meson
BuildOption:	-Ddefault_library=shared
BuildOption:	-Ddoc=false
BuildOption:	-Dsamples=false
BuildOption:	-Dutest=false

BuildRequires:	meson
BuildRequires:	flex
BuildRequires:	bison
BuildRequires:	pkgconfig(libtraceevent) >= 1.8.1

%description
libtracefs provides APIs for accessing the Linux kernel's tracefs
filesystem (ftrace).

%package -n %{libname}
Summary:	Linux kernel tracefs access library
Group:		System/Libraries

%description -n %{libname}
libtracefs provides APIs for accessing the Linux kernel's tracefs
filesystem (ftrace).

%package -n %{devname}
Summary:	Development files for libtracefs
Group:		Development/C
Requires:	%{libname} = %{version}-%{release}
Requires:	pkgconfig(libtraceevent)
Provides:	libtracefs-devel = %{version}-%{release}

%description -n %{devname}
Headers, pkgconfig file, and unversioned .so symlink needed to build
software against libtracefs.

%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig

%files -n %{libname}
%{_libdir}/%{name}.so.%{major}*
%{_datadir}/bash-completion/completions/tracefs_sql.bash

%files -n %{devname}
%{_libdir}/%{name}.so
%{_libdir}/pkgconfig/%{name}.pc
%{_includedir}/libtracefs/
Summary:	Power saving diagnostic tool
Name:		powertop
Version:	2.16
Release:	1
License:	GPLv2+
Group:		System/Kernel and hardware
Url:		https://github.com/fenrus75/powertop
Source0:	https://github.com/fenrus75/powertop/archive/refs/tags/v%{version}/%{name}-%{version}.tar.gz

# Upstream switched to the meson build system as of 2.16
# (autotools files are still shipped but are stale/unmaintained).
BuildSystem:	meson

BuildRequires:	meson
BuildRequires:	pkgconfig(ncursesw)
BuildRequires:	pkgconfig(libpci)
BuildRequires:	pkgconfig(libnl-3.0)
BuildRequires:	pkgconfig(libtracefs)
BuildRequires:	pkgconfig(zlib)
BuildRequires:	gettext-devel

%description
PowerTOP tool is a program that collects the various pieces of
information from a system and presents an overview of how well a
laptop is doing in terms of power savings. In addition, PowerTOP will
provide an indication of which tunables and software components are
the biggest offenders in slurping up battery time. PowerTOP will
update it's display frequently so that the impact of any changes can
be seen directly.

%find_lang %{name}

%files -f %{name}.lang
%doc README.md TODO
%{_sbindir}/%{name}
%{_mandir}/*/*.*
%{_datadir}/bash-completion/completions/%{name}
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.