2023-12-05 11:34:06 +08:00
|
|
|
|
%define debug_package %{nil}
|
|
|
|
|
|
|
|
|
|
|
|
Name: powerapi
|
|
|
|
|
|
Version: 1.0.0
|
2023-12-15 15:33:47 +08:00
|
|
|
|
Release: 2
|
2023-12-05 11:34:06 +08:00
|
|
|
|
Summary: The ability to support openEuler power consumption control.
|
|
|
|
|
|
|
|
|
|
|
|
License: MulanPSL-2.0
|
|
|
|
|
|
URL: https://gitee.com/openeuler/powerapi/
|
|
|
|
|
|
Source0: %{name}-%{version}.tar.gz
|
|
|
|
|
|
|
|
|
|
|
|
BuildRequires: gcc,cmake,zip,unzip
|
|
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
|
Including a power API SO and the Power API Service.
|
|
|
|
|
|
|
|
|
|
|
|
%package -n powerapi-devel
|
|
|
|
|
|
Summary: The ability to support openEuler power consumption control.
|
|
|
|
|
|
BuildRequires: gcc,cmake,zip,unzip
|
|
|
|
|
|
|
|
|
|
|
|
%description -n powerapi-devel
|
|
|
|
|
|
Contains the client and server components and API header files for powerapi integration development.
|
|
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
|
%autosetup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
|
sh build.sh release
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
|
install -d %{buildroot}/%{_sysconfdir}/sysconfig/pwrapis
|
|
|
|
|
|
cp release/pwrapis/conf/pwrapis_config.ini %{buildroot}/%{_sysconfdir}/sysconfig/pwrapis
|
2023-12-15 15:33:47 +08:00
|
|
|
|
install -d %{buildroot}/%{_sbindir}
|
|
|
|
|
|
cp release/pwrapis/pwrapis %{buildroot}/%{_sbindir}
|
|
|
|
|
|
install -d %{buildroot}/%{_sysconfdir}/systemd/system
|
|
|
|
|
|
cp pwrapis/pwrapis.service %{buildroot}/%{_sysconfdir}/systemd/system
|
2023-12-05 11:34:06 +08:00
|
|
|
|
install -d %{buildroot}/%{_libdir}
|
|
|
|
|
|
cp release/pwrapic/lib/libpwrapi.so %{buildroot}/%{_libdir}
|
|
|
|
|
|
install -d %{buildroot}/%{_includedir}/pwrapic
|
2023-12-15 15:33:47 +08:00
|
|
|
|
cp -r release/pwrapic/inc/* %{buildroot}/%{_includedir}/pwrapic
|
|
|
|
|
|
|
|
|
|
|
|
%post
|
|
|
|
|
|
systemctl start pwrapis
|
|
|
|
|
|
|
|
|
|
|
|
%preun
|
|
|
|
|
|
systemctl stop pwrapis
|
|
|
|
|
|
|
|
|
|
|
|
%post -n powerapi-devel
|
|
|
|
|
|
systemctl start pwrapis
|
|
|
|
|
|
|
|
|
|
|
|
%preun -n powerapi-devel
|
|
|
|
|
|
systemctl stop pwrapis
|
2023-12-05 11:34:06 +08:00
|
|
|
|
|
|
|
|
|
|
%files
|
2023-12-15 15:33:47 +08:00
|
|
|
|
%{_sbindir}/pwrapis
|
2023-12-05 11:34:06 +08:00
|
|
|
|
%{_libdir}/libpwrapi.so
|
|
|
|
|
|
%dir %{_sysconfdir}/sysconfig/pwrapis
|
|
|
|
|
|
%{_sysconfdir}/sysconfig/pwrapis/*
|
2023-12-15 15:33:47 +08:00
|
|
|
|
%{_sysconfdir}/systemd/system/pwrapis.service
|
2023-12-05 11:34:06 +08:00
|
|
|
|
|
|
|
|
|
|
%files -n powerapi-devel
|
2023-12-15 15:33:47 +08:00
|
|
|
|
%{_sbindir}/pwrapis
|
2023-12-05 11:34:06 +08:00
|
|
|
|
%{_libdir}/libpwrapi.so
|
|
|
|
|
|
%dir %{_sysconfdir}/sysconfig/pwrapis
|
|
|
|
|
|
%{_sysconfdir}/sysconfig/pwrapis/*
|
|
|
|
|
|
%dir %{_includedir}/pwrapic
|
|
|
|
|
|
%{_includedir}/pwrapic/*
|
2023-12-15 15:33:47 +08:00
|
|
|
|
%{_sysconfdir}/systemd/system/pwrapis.service
|
2023-12-05 11:34:06 +08:00
|
|
|
|
|
|
|
|
|
|
%changelog
|
2023-12-18 17:22:12 +08:00
|
|
|
|
* Mon Dec 18 2023 xuchongyu <xuchongyu@huawei.com> - 1.0.0-2
|
|
|
|
|
|
- update souce code:retain debug compilation mode
|
|
|
|
|
|
|
2023-12-15 15:33:47 +08:00
|
|
|
|
* Fri Dec 15 2023 xuchongyu <xuchongyu@huawei.com> - 1.0.0-2
|
|
|
|
|
|
- add pwrapis.service
|
|
|
|
|
|
|
2023-12-05 11:34:06 +08:00
|
|
|
|
* Tue Dec 5 2023 xuchongyu <xuchongyu@huawei.com> - 1.0.0-1
|
|
|
|
|
|
- init powerapi
|