[v2,2/2] libcap: Adjust the lfs file to place pkg-config files in the correct place

Message ID 20230510204110.1183975-2-adolf.belka@ipfire.org
State Accepted
Headers
Series [v2,1/2] rng-tools: Update to version 2.16 |

Commit Message

Adolf Belka May 10, 2023, 8:41 p.m. UTC
  - libcap places the files by default in /lib and not /usr/lib etc. To fix this libcap made
   a symlink for the library file from /lib to /usr/lib. However the .pc files were left
   in /lib/pkgconfig and not /usr/lib/pkgconfig and were therefore not found by the update
   of rng-tools which now required libcap to be found.
- Changed the prefix settings for libcap which placed the libraries and .pc files in the
   correct locations while keeping the executables in their existing location.
- This removed the need for symlinking /usr/lib/libcap.so to /lib/libcap.so.2.67 as the
   libraries are now placed in /usr/lib
- Installed the ipfire build with these changes into a vm system and confirmed that
   everything worked. Input from Michael Tremer that if ping worked then libcap was
   functioning correctly.
- The prefixes have to be applied to both make and make install to end up with the files
   in the correct places.

Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
---
 config/rootfiles/common/libcap | 17 +++++++++--------
 lfs/libcap                     | 13 ++++++++-----
 2 files changed, 17 insertions(+), 13 deletions(-)
  

Patch

diff --git a/config/rootfiles/common/libcap b/config/rootfiles/common/libcap
index 194fc7f19..af1c22e83 100644
--- a/config/rootfiles/common/libcap
+++ b/config/rootfiles/common/libcap
@@ -1,11 +1,3 @@ 
-lib/libcap.so.2
-lib/libcap.so.2.67
-#lib/libpsx.so
-#lib/libpsx.so.2
-lib/libpsx.so.2.67
-#lib/pkgconfig/libcap.pc
-#lib/pkgconfig/libpsx.pc
-lib/security/pam_cap.so
 sbin/capsh
 sbin/getcap
 sbin/getpcaps
@@ -13,6 +5,15 @@  sbin/setcap
 #usr/include/sys/capability.h
 #usr/include/sys/psx_syscall.h
 usr/lib/libcap.so
+usr/lib/libcap.so.2
+usr/lib/libcap.so.2.67
+#usr/lib/libpsx.so
+#usr/lib/libpsx.so.2
+usr/lib/libpsx.so.2.67
+#usr/lib/pkgconfig/libcap.pc
+#usr/lib/pkgconfig/libpsx.pc
+#usr/lib/security
+usr/lib/security/pam_cap.so
 #usr/share/man/man1/capsh.1
 #usr/share/man/man3/cap_clear.3
 #usr/share/man/man3/cap_clear_flag.3
diff --git a/lfs/libcap b/lfs/libcap
index 9eab679ff..63f4ef8b0 100644
--- a/lfs/libcap
+++ b/lfs/libcap
@@ -72,10 +72,13 @@  $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
 	@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
 	# Prevent a static library from being installed
 	cd $(DIR_APP) && sed -i '/install -m.*STA/d' libcap/Makefile
-	cd $(DIR_APP) && make GOLANG=no
-	cd $(DIR_APP) && make install GOLANG=no
-	rm -vf /lib/libcap.so
-	ln -svf /lib/libcap.so.2.67 /usr/lib/libcap.so
-	chmod +x /lib/libcap.so.*
+	cd $(DIR_APP) && make GOLANG=no \
+				  prefix=/usr \
+				  exec_prefix= \
+				  lib_prefix=/usr
+	cd $(DIR_APP) && make install GOLANG=no \
+				  prefix=/usr \
+				  exec_prefix= \
+				  lib_prefix=/usr
 	@rm -rf $(DIR_APP)
 	@$(POSTBUILD)