summaryrefslogtreecommitdiffstats
path: root/core/modules/nslcd/module.build
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/nslcd/module.build')
-rw-r--r--core/modules/nslcd/module.build42
1 files changed, 42 insertions, 0 deletions
diff --git a/core/modules/nslcd/module.build b/core/modules/nslcd/module.build
new file mode 100644
index 00000000..76fa2bed
--- /dev/null
+++ b/core/modules/nslcd/module.build
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+fetch_source() {
+ if [ -n "$REQUIRED_NSS_LDAPD_URL" ]; then
+ pinfo "Downloading $REQUIRED_NSS_LDAPD_URL ..."
+ download_untar "$REQUIRED_NSS_LDAPD_URL" "src/"
+ fi
+}
+
+build() {
+
+ COPYLIST="list_dpkg_output"
+ [ -e "$COPYLIST" ] && rm "$COPYLIST"
+
+ list_packet_files >> "$COPYLIST"
+ tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}"
+
+ # OpenSuSE 13.1 has no 'nss-pam-ldapd'. Let's compile
+ if [ -n "$REQUIRED_NSS_LDAPD_URL" ]; then
+ cd "${MODULE_WORK_DIR}/src/$REQUIRED_NSS_LDAPD_VERSION"
+ pinfo "compiling pam-nss-ldapd for openSuse 13.1 ..."
+ ./configure || perror "openSuse 13.1 - pam-nss-ldapd: ./configure failed."
+ make DESTDIR="${MODULE_BUILD_DIR}" install || perror "openSuse 13.1 - pam-nss-ldapd: make install to ${MODULE_BUILD_DIR} failed."
+ cd "$MODULE_BUILD_DIR"
+ local NSLCD_PATH=$(find . -executable -name "nslcd") # Not in path, so we 'find' below MODULE_BUILD_DIR
+ else
+ cd "$MODULE_BUILD_DIR"
+ local NSLCD_PATH=$(which nslcd)
+ fi
+ [[ $REQUIRED_BINARIES = *nslcd* ]] && [ -z "$NSLCD_PATH" ] && perror "Could not 'which nslcd'"
+
+
+ # Build nslcd service file
+ mkdir -p "${MODULE_BUILD_DIR}/etc/systemd/system"
+ sed "s,%PATH%,${NSLCD_PATH},g" "${MODULE_DIR}/templates/nslcd-systemd.service" > "${MODULE_BUILD_DIR}/etc/systemd/system/nslcd.service" || perror "Could not fill nslcd.service template"
+
+ return 0
+}
+
+post_copy() {
+ :
+}