#!/make -f

.my/stdacct:
	chmod 755 .ssh/authorized_keys*
	if [ -d "/usr/local/stow/packagehelper" ]; then \
	  tar --create --gzip --file .my/local/packagehelper.tar.gz \
	      --directory /usr/local/stow packagehelper ; \
	fi
	rm -rf .my/stdacct-build
	mkdir -p .my/stdacct-build
	tar --create --gzip --file .my/stdacct-build/stdaccount.tar.gz Makefile \
	  .bash_logout .bash_profile .bashrc .bash_initshared \
	  .cvsdeb.conf .kernel-pkg.conf .svn-buildpackage.conf \
	  .jedrc .mutt/muttrc .screenrc .xsession-local \
	  .chroot-init .devscripts .myaptrc \
	  .ssh/authorized_keys.d/dist/* \
	  $$(find .ssh/config.d -type f -regex '.*/[0-9]+_dist_[^/]+') \
      	  .my/bin/* .my/lib/cvs-buildpackage/* .my/local/*
	cp .my/bin/unpackstdacct .my/stdacct-build
	unset CDPATH && makeself --gzip .my/stdacct-build .my/stdacct stdacct unpackstdacct
	rm -rf .my/stdacct-build

.PHONY: .my/stdacct
