summaryrefslogtreecommitdiffstats
path: root/core/modules/cups-sicgs/module.build
blob: 37c2279874cc61b20e00922f5936115d06038e02 (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
#!/bin/bash


fetch_source() {
	[ -s "${MODULE_WORK_DIR}/src/driver.zip" ] && return 0
	rm -rf -- "${MODULE_WORK_DIR}/src"
	mkdir -p "${MODULE_WORK_DIR}/src"
	download "${REQUIRED_ARCHIVE}" "${MODULE_WORK_DIR}/src/driver.zip"
}

build() {
	cd "${MODULE_WORK_DIR}/src/" || perror "Could not cd to '${MODULE_WORK_DIR}/src'. Did fetch_source work?"
	# Initial archive is zip
	unzip -j -o "${MODULE_WORK_DIR}/src/driver.zip" || perror "Could not extract initial driver.zip"
	# Then we have two tgz, 32bit and 64bit
	tar -x -f *${X86_64_I386}*.tar* --wildcards '*/sic*' || perror "Could not extract binaries from inner tar"

	mkdir -p "${MODULE_BUILD_DIR}/usr/bin"
	find . -name "sic*" -type f -executable -exec cp {} "${MODULE_BUILD_DIR}/usr/bin" \; \
		|| perror "Could not copy sic* binaries to module build dir"

	cd - &>/dev/null
}

post_copy() {
	:
}