The "apkg build" breaks due pam.de/netopeer2.conf path issue
qupfer opened this issue · 2 comments
Hi,
running "apkg build" fails on a alma9 system due some issues with the path of "pam.d/netopeer2.conf" file
File not found: /home/build/netopeer2/pkg/build/pkgs/almalinux-9.4/netopeer2-2.2.28-1.el9/rpmbuild/BUILDROOT/netopeer2-2.2.28-1.el9.x86_64/etc/pam.d/netopeer2.conf
FYI: the file is found in ../usr/etc/pam.d/netopeer2.conf
I found to possible solutions:
- fix the path in the SPEC-File (change it it in the %files section to
%{_prefix}/%{_sysconfdir}/pam.d/netopeer2.conf
)- but then the file is put to
/usr/etc/pam.d
:-(
- but then the file is put to
- fix it in the make file and replace
install(FILES "${CMAKE_SOURCE_DIR}/pam/netopeer2.conf" DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/pam.d")
- to
install(FILES "${CMAKE_SOURCE_DIR}/pam/netopeer2.conf" DESTINATION "${SYSCONF_INSTALL_DIR}/pam.d")
But not sure if that breaks other/more genral setups
You can add a condition for your system and the correct definition of CMAKE_INSTALL_SYSCONFDIR
when building the package, for example, right?
Sure, but "I think" that if apkg config/preset is part of that project, it should "work" out of the box for default cases.
I don't understand, where "CMAKE_INSTALL_SYSCONFDIR" is (re)defined. cmake doku say, its set to "etc", which would be correct. Howether, it looks like its somewhere redefined to /usr/etc
(or %{_prefix}/etc
)
Edit: looks like its related with this: https://cmake.org/cmake/help/v3.26/module/GNUInstallDirs.html
However, add an absolut path to the spec file seems working. I can prepare an PR if wanted.
Edit: create an PR