Commit d66c40952623726b7a676865a36b9d0322fc65fb

Thomas de Grivel 2023-02-22T23:55:57

bootstrap

diff --git a/bin/rbpkg_bootstrap b/bin/rbpkg_bootstrap
index 08774d2..f8ae21a 100755
--- a/bin/rbpkg_bootstrap
+++ b/bin/rbpkg_bootstrap
@@ -51,13 +51,27 @@ else
 fi
 
 # profile
-mkdir -p "${RBPKG_DIR}/etc/rbpkg"
+mkdir -p "${RBPKG_DIR}/etc"
 {
-    echo "export RBPKG_DIR='${RBPKG_DIR}'"
-    echo "export PATH='${RBPKG_DIR}/bin:${PATH}'"
-    echo "export LD_LIBRARY_PATH='${RBPKG_DIR}/lib'"
-} > "${RBPKG_DIR}/etc/rbpkg/profile"
+    cat <<EOF
+# rbpkg
+
+: \${RBPKG_DIR:=${RBPKG_DIR}}
+export RBPKG_DIR
+
+# runtime
+
+export PATH="\${RBPKG_DIR}/bin:$PATH"
+export LD_LIBRARY_PATH="\${RBPKG_DIR}/lib:${LD_LIBRARY_PATH}"
+
+# compile time
+
+export CPPFLAGS="${CPPFLAGS} -I\${RBPKG_DIR}/include"
+export LDFLAGS="${LDFLAGS} -L\${RBPKG_DIR}/lib"
+export PKG_CONFIG_PATH="\${RBPKG_DIR}/lib/pkgconfig"
+EOF
+} > "${RBPKG_DIR}/etc/profile"
 
 # source profile
-echo ". ${RBPKG_DIR}/etc/rbpkg/profile"
-. "${RBPKG_DIR}/etc/rbpkg/profile"
+echo ". ${RBPKG_DIR}/etc/profile"
+. "${RBPKG_DIR}/etc/profile"