diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0c82a1e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/ipmctl-01.00.00.3262.tar.gz diff --git a/0001-cmake-specify-using-python3.patch b/0001-cmake-specify-using-python3.patch new file mode 100644 index 0000000..f8beffb --- /dev/null +++ b/0001-cmake-specify-using-python3.patch @@ -0,0 +1,35 @@ +From 9b77d58419f8afdb17776d4c89e9f9619f9e21c2 Mon Sep 17 00:00:00 2001 +From: Juston Li +Date: Tue, 18 Sep 2018 11:05:11 -0700 +Subject: [PATCH 1/2] cmake: specify using python3 + +Signed-off-by: Juston Li +--- + CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4c6f5e3..affceaf 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -515,7 +515,7 @@ add_custom_target(stringdefs ALL + DEPENDS ${STRING_DEFS_OUTPUT_FILES} ${STRING_DEFS_INPUT_FILES}) + + add_custom_command(OUTPUT ${STRING_DEFS_OUTPUT_FILES} +- COMMAND python ${ROOT}/src/os/efi_shim/os_efi_hii_auto_gen_strings.py ++ COMMAND python3 ${ROOT}/src/os/efi_shim/os_efi_hii_auto_gen_strings.py + COMMENT "Generating String Definitions" + DEPENDS ${STRING_DEFS_INPUT_FILES} + ) +@@ -536,7 +536,7 @@ endif() + + add_custom_command(OUTPUT ${OUTPUT_DIR}/ipmctl_default.conf + COMMAND ${CMAKE_C_COMPILER} ${MY_CMAKE_SYSROOT} ${PRECOMPILER_FLAG} ${ROOT}/src/os/ini/ipmctl_default.c > ${ROOT}/src/os/ini/ipmctl_default.i +- COMMAND python ${ROOT}/src/os/ini/ini_auto_gen_default_config.py ${ROOT}/src/os/ini/ipmctl_default.i ${OUTPUT_DIR}/ipmctl_default.conf ++ COMMAND python3 ${ROOT}/src/os/ini/ini_auto_gen_default_config.py ${ROOT}/src/os/ini/ipmctl_default.i ${OUTPUT_DIR}/ipmctl_default.conf + COMMAND ${CMAKE_COMMAND} -E remove -f ${ROOT}/src/os/ini/ipmctl_default.i + COMMENT "Generating INI Default Config File" + ) +-- +2.17.1 + diff --git a/0002-linux-add-logrotate-conf.patch b/0002-linux-add-logrotate-conf.patch new file mode 100644 index 0000000..1b7b73e --- /dev/null +++ b/0002-linux-add-logrotate-conf.patch @@ -0,0 +1,54 @@ +From a2298f4d7d808a510d1b67631ed1e26480e1f71f Mon Sep 17 00:00:00 2001 +From: Juston Li +Date: Tue, 18 Sep 2018 11:06:36 -0700 +Subject: [PATCH 2/2] linux: add logrotate conf + +monthly rotation, max of 4 archived logs + +Signed-off-by: Juston Li +--- + CMakeLists.txt | 7 +++++++ + install/linux/logrotate/ipmctl.conf | 6 ++++++ + 2 files changed, 13 insertions(+) + create mode 100644 install/linux/logrotate/ipmctl.conf + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index affceaf..939e0fa 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -554,6 +554,9 @@ FILE(GLOB NVM_HEADERS + FILE(COPY ${NVM_HEADERS} + DESTINATION ${OUTPUT_DIR}) + ++FILE(COPY install/linux/logrotate/ipmctl.conf ++ DESTINATION ${OUTPUT_DIR}) ++ + if(LNX_BUILD) + include(GNUInstallDirs) + find_package(PkgConfig) +@@ -604,6 +607,10 @@ if(LNX_BUILD) + DESTINATION ${CMAKE_INSTALL_LOCALSTATEDIR}/log + ) + ++ install(FILES ${OUTPUT_DIR}/ipmctl.conf ++ DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/logrotate.d ++ ) ++ + if(DEFINED INSTALL_SYSTEMDSYSTEMUNITDIR) + install (FILES src/os/monitor/ipmctl-monitor.service + DESTINATION ${INSTALL_SYSTEMDSYSTEMUNITDIR} +diff --git a/install/linux/logrotate/ipmctl.conf b/install/linux/logrotate/ipmctl.conf +new file mode 100644 +index 0000000..7e3f235 +--- /dev/null ++++ b/install/linux/logrotate/ipmctl.conf +@@ -0,0 +1,6 @@ ++/var/log/ipmctl/*log { ++ missingok ++ notifempty ++ rotate 4 ++ monthly ++} +-- +2.17.1 + diff --git a/ipmctl.spec b/ipmctl.spec new file mode 100644 index 0000000..b1bb391 --- /dev/null +++ b/ipmctl.spec @@ -0,0 +1,131 @@ +Name: ipmctl +Version: 01.00.00.3262 +Release: 1%{?dist} +Summary: Utility for managing Intel Optane DC persistent memory modules +License: BSD +URL: https://github.com/intel/ipmctl +Source: https://github.com/intel/ipmctl/archive/v%{version}/%{name}-%{version}.tar.gz +# https://bugzilla.redhat.com/show_bug.cgi?id=1628752 +Patch0: 0001-cmake-specify-using-python3.patch +Patch1: 0002-linux-add-logrotate-conf.patch +ExclusiveArch: x86_64 + +Requires: libipmctl%{?_isa} = %{version}-%{release} +BuildRequires: pkgconfig(libndctl) +BuildRequires: pkgconfig(safec-3.3) +BuildRequires: cmake +BuildRequires: python3 +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: asciidoctor +Obsoletes: ixpdimm-cli < 01.00.00.3000 + +%description +Utility for managing Intel Optane DC persistent memory modules +Supports functionality to: +Discover DCPMMs on the platform. +Provision the platform memory configuration. +View and update the firmware on DCPMMs. +Configure data-at-rest security on DCPMMs. +Monitor DCPMM health. +Track performance of DCPMMs. +Debug and troubleshoot DCPMMs. + +%prep +%setup -q -n %{name}-%{version} + +%patch0 -p1 +%patch1 -p1 + +%package -n ipmctl-monitor +Summary: Daemon for monitoring the status of Intel DCPMM +Requires: libipmctl%{?_isa} = %{version}-%{release} +%{?systemd_requires} +BuildRequires: systemd +Obsoletes: ixpdimm-monitor < 01.00.00.3000 + +%description -n ipmctl-monitor +A monitor daemon for monitoring the health and status of Intel Optane DC +persistent memory modules + +%package -n libipmctl +Summary: Library for Intel DCPMM management +Obsoletes: ixpdimm_sw < 01.00.00.3000 +Obsoletes: libixpdimm-common < 01.00.00.3000 +Obsoletes: libixpdimm-core < 01.00.00.3000 +Obsoletes: libixpdimm-cli < 01.00.00.3000 +Obsoletes: libixpdimm-cim < 01.00.00.3000 +Obsoletes: libixpdimm < 01.00.00.3000 +Obsoletes: ixpdimm-data < 01.00.00.3000 + +%description -n libipmctl +An Application Programming Interface (API) library for managing Intel Optane DC +persistent memory modules. + +%package -n libipmctl-devel +Summary: Development packages for libipmctl +Requires: libipmctl%{?_isa} = %{version}-%{release} +Obsoletes: ixpdimm-devel < 01.00.00.3000 +Obsoletes: ixpdimm_sw-devel < 01.00.00.3000 + +%description -n libipmctl-devel +API for development of Intel Optane DC persistent memory management utilities. + +%build +%cmake -DBUILDNUM=%{version} -DCMAKE_INSTALL_PREFIX=/ \ + -DLINUX_PRODUCT_NAME=%{name} \ + -DCMAKE_INSTALL_LIBDIR=%{_libdir} \ + -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \ + -DCMAKE_INSTALL_BINDIR=%{_bindir} \ + -DCMAKE_INSTALL_DATAROOTDIR=%{_datadir} \ + -DCMAKE_INSTALL_MANDIR=%{_mandir} \ + -DCMAKE_INSTALL_LOCALSTATEDIR=%{_localstatedir} \ + -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir} \ + -DINSTALL_UNITDIR=%{_unitdir} \ + -DRELEASE=ON \ + -DRPM_BUILD=ON +%make_build + +%install +%{!?_cmake_version: cd build} +%make_install -f Makefile + +%post -n ipmctl-monitor +%systemd_post ipmctl-monitor.service + +%preun -n ipmctl-monitor +%systemd_preun stop ipmctl-monitor.service + +%postun -n ipmctl-monitor +%systemd_postun_with_restart ipmctl-monitor.service + +%files -n ipmctl +%{_bindir}/ipmctl + +%files -n ipmctl-monitor +%{_bindir}/ipmctl-monitor +%{_unitdir}/ipmctl-monitor.service +%{_mandir}/man1/ipmctl* + +%files -n libipmctl +%{_libdir}/libipmctl.so.3* +%dir %{_datadir}/doc/ipmctl +%doc %{_datadir}/doc/ipmctl/ipmctl_default.conf +%config(noreplace) %{_sysconfdir}/ipmctl.conf +%dir %{_localstatedir}/log/ipmctl +%config(noreplace) %{_sysconfdir}/logrotate.d/ipmctl.conf + +%files -n libipmctl-devel +%{_libdir}/libipmctl.so +%{_includedir}/nvm_types.h +%{_includedir}/nvm_management.h +%{_includedir}/export_api.h +%{_includedir}/NvmSharedDefs.h +%{_libdir}/pkgconfig/libipmctl.pc + +%changelog +* Mon Sep 17 2018 Juston Li - 01.00.00.3262-1 +- Clean up spec for fedora review + +* Wed May 02 2018 Juston Li - 01.00.00.3000-1 +- initial spec diff --git a/sources b/sources new file mode 100644 index 0000000..a5c683f --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (ipmctl-01.00.00.3262.tar.gz) = 9457782cf0f726984f21bf62b81a0a76146aa8ee53efd02de5886587c39e6cef5bb4e9f94d32af0f5676a7bddbf1728c78725c8033a1295d335a05e286743d43