diff options
author | Jonathan Bauer | 2015-01-28 14:28:38 +0100 |
---|---|---|
committer | root | 2015-01-28 14:28:38 +0100 |
commit | 632f841f9c48f3338749408d0b1971059b5ec1c1 (patch) | |
tree | 86d5dc9682f889a43ad3b877f5a15240428957f8 /remote/modules/nslcd | |
parent | [ncp] bad directories fetched - ./lib does not exist in the build tree of thi... (diff) | |
download | tm-scripts-632f841f9c48f3338749408d0b1971059b5ec1c1.tar.gz tm-scripts-632f841f9c48f3338749408d0b1971059b5ec1c1.tar.xz tm-scripts-632f841f9c48f3338749408d0b1971059b5ec1c1.zip |
[pam/nlscd] split nslcd stuff to its own module
Diffstat (limited to 'remote/modules/nslcd')
-rw-r--r-- | remote/modules/nslcd/module.build | 42 | ||||
-rw-r--r-- | remote/modules/nslcd/module.conf | 6 | ||||
-rw-r--r-- | remote/modules/nslcd/module.conf.debian | 6 | ||||
-rw-r--r-- | remote/modules/nslcd/module.conf.ubuntu | 6 | ||||
-rw-r--r-- | remote/modules/nslcd/templates/nslcd-systemd.service | 8 |
5 files changed, 68 insertions, 0 deletions
diff --git a/remote/modules/nslcd/module.build b/remote/modules/nslcd/module.build new file mode 100644 index 00000000..aa1b3915 --- /dev/null +++ b/remote/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_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() { + : +} diff --git a/remote/modules/nslcd/module.conf b/remote/modules/nslcd/module.conf new file mode 100644 index 00000000..7dae2ba1 --- /dev/null +++ b/remote/modules/nslcd/module.conf @@ -0,0 +1,6 @@ +REQUIRED_BINARIES=" + nslcd +" +REQUIRED_FILES=" + /etc/systemd/system/nslcd.service +" diff --git a/remote/modules/nslcd/module.conf.debian b/remote/modules/nslcd/module.conf.debian new file mode 100644 index 00000000..3d83fc81 --- /dev/null +++ b/remote/modules/nslcd/module.conf.debian @@ -0,0 +1,6 @@ +REQUIRED_INSTALLED_PACKAGES=" + nslcd +" +REQUIRED_CONTENT_PACKAGES=" + nslcd +" diff --git a/remote/modules/nslcd/module.conf.ubuntu b/remote/modules/nslcd/module.conf.ubuntu new file mode 100644 index 00000000..3d83fc81 --- /dev/null +++ b/remote/modules/nslcd/module.conf.ubuntu @@ -0,0 +1,6 @@ +REQUIRED_INSTALLED_PACKAGES=" + nslcd +" +REQUIRED_CONTENT_PACKAGES=" + nslcd +" diff --git a/remote/modules/nslcd/templates/nslcd-systemd.service b/remote/modules/nslcd/templates/nslcd-systemd.service new file mode 100644 index 00000000..540e67cd --- /dev/null +++ b/remote/modules/nslcd/templates/nslcd-systemd.service @@ -0,0 +1,8 @@ +[Unit] +Description=Naming services LDAP client daemon +After=network.target + +[Service] +Type=forking +PIDFile=/var/run/nslcd/nslcd.pid +ExecStart=%PATH% |