summaryrefslogtreecommitdiffstats
path: root/remote/modules/cron/module.build
blob: d9f1e825d823615462f6d8b5635f183910c1634b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash


fetch_source() {
	[ -d "${MODULE_DIR}/src/.git" ] && return 0
	rm -rf -- "${MODULE_DIR}/src"
	git clone --depth 1 "${REQUIRED_GIT}" "${MODULE_DIR}/src" || perror "Could not create ${MODULE_DIR}/src"
	cd "${MODULE_DIR}/src"
	git checkout "${REQUIRED_COMMIT}" || perror "Could not switch to required commit"
	cd -
}

build() {

	# compilation
	cd "${MODULE_DIR}/src" || perror "Could not cd to '${MODULE_DIR}/src'. Did fetch_source work?"
	./autogen.sh || perror "Autogen failed"
	./configure --disable-dependency-tracking --enable-syscrontab --prefix= --exec-prefix= --bindir=/opt/openslx/bin --sbindir=/opt/openslx/sbin || perror "configure failed"

	make || perror "Could not compile cron using 'make'."

	# NO MAKE INSTALL: Copy to build dir, since there are no shared libs linked in
	mkdir -p "${MODULE_BUILD_DIR}/opt/openslx/sbin"
	cp "${MODULE_DIR}/src/src/crond" "${MODULE_BUILD_DIR}/opt/openslx/sbin/" || perror "Could not copy crond binary to ${MODULE_BUILD_DIR}"

	cd - &>/dev/null
}

post_copy() {
	:
}