# Contributor: Marten Ringwelski <git+alpine@maringuu.de>
# Maintainer: Marten Ringwelski <git+alpine@maringuu.de>
pkgname=dumb_runtime_dir
pkgver=1.0.4
pkgrel=4
pkgdesc="Creates an XDG_RUNTIME_DIR on login and never removes it"
url="https://github.com/ifreund/dumb_runtime_dir"
arch="all"
license="0BSD"
makedepends="linux-pam-dev"
source="https://github.com/ifreund/dumb_runtime_dir/archive/v$pkgver/dumb_runtime_dir-v$pkgver.tar.gz
	0001-Prefix-directory-name-with-user.patch"
options="!check" # no test suite

build() {
	# Create XDG_RUNTIME_DIRs directly in /run, the default is /run/user/,
	# which would mean the user has to create it manually with the right
	# permissions. In the future OpenRC may create /run/user [1].
	#
	# [1]: https://github.com/OpenRC/openrc/issues/658
	make RUNTIME_DIR_PARENT=/run
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
f7607a1e048efa686e8f266efc9b798c905840fe660a8d3d4ead538b258971a1787406e94c792883e886360672ebc1d9fb812b2bf54755f1135a15479514d962  dumb_runtime_dir-v1.0.4.tar.gz
f61607657a8f173e54b46ee36f68c9b97c9396ffa20c83df47056a1f33277882f7b471e8c81caef6fb3f0d6c8111aa0190c12164fef553d35193b0edb250effe  0001-Prefix-directory-name-with-user.patch
"
