build 757 Bytes
Newer Older
gsell's avatar
gsell committed
1
#!/usr/bin/env modbuild
gsell's avatar
gsell committed
2

gsell's avatar
gsell committed
3
pbuild::set_download_url "https://github.com/google/googletest/archive/release-1.8.1.tar.gz"
gsell's avatar
gsell committed
4
pbuild::add_to_group 'Compiler'
gsell's avatar
gsell committed
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

if (( V_MAJOR == 1 )) && (( V_MINOR <= 7 )); then
	pbuild::install_docfiles \
		CHANGES \
		CONTRIBUTORS \
		LICENSE \
		README

	pbuild::install() {
		local -r _include_srcdir="${SRC_DIR}/include/gtest"
		local -r _include_dstdir="${PREFIX}/include/gtest"
		if [[ -e "${_include_dstdir}" ]]; then
			chmod -R u+w "${_include_dstdir}"
		fi
		mkdir -p "${_include_dstdir}"
		cp -rv "${_include_srcdir}"/* "${_include_dstdir}"

		local -r _lib_dstdir="${PREFIX}/lib"
		mkdir -p "${_lib_dstdir}"
		cp -v *.a "${_lib_dstdir}"
	}
else
	pbuild::install_docfiles \
		CONTRIBUTING.md \
		LICENSE \
		README.md
fi
gsell's avatar
gsell committed
32