# Template file for 'fscrypt'
pkgname=fscrypt
version=0.3.5
revision=2
build_style=go
go_import_path=github.com/google/fscrypt
go_package="${go_import_path}/cmd/fscrypt"
go_ldflags="-X main.version=v${version}"
hostmakedepends="m4"
makedepends="pam-devel"
short_desc="Tool for managing Linux filesystem encryption"
maintainer="Andrea Brancaleoni <abc@pomel.me>"
license="Apache-2.0"
homepage="https://github.com/google/fscrypt"
distfiles="https://github.com/google/fscrypt/archive/v${version}.tar.gz"
checksum=368119b5e67c64bdc5f7872ffc7beed425e1401778003f4c7ae7c1062a45ebaf
conf_files="/etc/pam.d/fscrypt"

post_install() {
	# build and install the PAM module
	LDFLAGS= make PREFIX=/usr DESTDIR=${DESTDIR} install-pam
	# remove Ubuntu specific pam-config files
	rm -rf ${DESTDIR}/usr/share/pam-configs/
	# add PAM config file
	vinstall ${FILESDIR}/pam_config 644 etc/pam.d fscrypt

	vcompletion cmd/fscrypt/fscrypt_bash_completion bash

	vdoc README.md
}
