summaryrefslogtreecommitdiffstats
path: root/remote/modules/pam/module.build
diff options
context:
space:
mode:
authorJonathan Bauer2014-03-25 15:24:04 +0100
committerJonathan Bauer2014-03-25 15:24:04 +0100
commit3d1235af060955e271be68240c0ca46bc6d81b03 (patch)
treeef02dcc4bb8476cfeef07e2df6a38b4c29d350df /remote/modules/pam/module.build
parent[rootfs-stage32] /var/log/openslx in tmpfiles.d (diff)
downloadtm-scripts-3d1235af060955e271be68240c0ca46bc6d81b03.tar.gz
tm-scripts-3d1235af060955e271be68240c0ca46bc6d81b03.tar.xz
tm-scripts-3d1235af060955e271be68240c0ca46bc6d81b03.zip
[modules] new module naming convention
rename $MODULE.{conf,build} to module.{conf,build}
Diffstat (limited to 'remote/modules/pam/module.build')
-rw-r--r--remote/modules/pam/module.build45
1 files changed, 45 insertions, 0 deletions
diff --git a/remote/modules/pam/module.build b/remote/modules/pam/module.build
new file mode 100644
index 00000000..15828fb8
--- /dev/null
+++ b/remote/modules/pam/module.build
@@ -0,0 +1,45 @@
+fetch_source() {
+ # get pam-script source
+ download_untar "$REQUIRED_PAM_SCRIPT_URL" "src/"
+ if [[ "$SYS_DISTRIBUTION" == "opensuse" && "$SYS_VERSION" == "13.1" ]]; then
+ pinfo "Downloading $REQUIRED_NSS_LDAPD_URL ..."
+ download_untar "$REQUIRED_NSS_LDAPD_URL" "src/"
+ fi
+}
+
+build() {
+ mkdir -p "$MODULE_BUILD_DIR/opt/openslx/bin"
+ gcc -o "$MODULE_BUILD_DIR/opt/openslx/bin/sslconnect" "$MODULE_DIR/sslconnect.c" -lssl -lcrypto -O3 || perror "Could not compile sslconnect.c"
+ local COPYLIST="$MODULE_BUILD_DIR/list_packet_files"
+ # TODO: Hack for SUSE: Ignore file (/var/lib/nfs/state) that does not exist :(
+ list_packet_files | grep -v '/var/lib/nfs/state' | sort -u > "$COPYLIST"
+ tarcopy "$(cat "$COPYLIST")" "${MODULE_BUILD_DIR}"
+
+ # build pam-script separatly since we use a source tarball
+ # HACK: find pam_unix.so in MODULE_BUILD_DIR to see where to put pam_script at
+ cd "$MODULE_BUILD_DIR"
+ local PAM_UNIX_LOCATION=$(find . -name pam_unix.so)
+ cd "${MODULE_DIR}/src/pam-script-${REQUIRED_PAM_SCRIPT_VERSION}" || perror "Could not cd to ${MODULE_DIR}/src/pam-script-${REQUIRED_PAM_SCRIPT_VERSION}."
+ ./configure --prefix=/ --sysconfdir=/etc/pam-script --libdir="$(dirname ${PAM_UNIX_LOCATION:1})" || perror "pam-script: ./configure failed."
+ make DESTDIR="${MODULE_BUILD_DIR}" install || perror "pam-script: make install to ${MODULE_BUILD_DIR} failed."
+ # openSuse 13.1 has no package nss-pam-ldapd. So, we compile it.
+ if [[ "$SYS_DISTRIBUTION" == "opensuse" && "$SYS_VERSION" == "13.1" ]]; 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
+ [ -z "$NSLCD_PATH" ] && perror "Could not 'which nslcd'"
+ # Build nslcd service file
+ mkdir -p "etc/systemd/system"
+ sed "s,%PATH%,$NSLCD_PATH,g" "$MODULE_DIR/templates/nslcd-systemd.service" > "etc/systemd/system/nslcd.service" || perror "Could not fill nslcd.service template"
+}
+
+post_copy() {
+ :
+}