opentmpfiles-0.1.2.ebuild 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. if [[ ${PV} = 9999* ]]; then
  5. inherit git-r3
  6. EGIT_REPO_URI="git://github.com/openrc/${PN}"
  7. else
  8. SRC_URI="https://github.com/openrc/${PN}/archive/${PV}.tar.gz ->
  9. ${P}.tar.gz"
  10. KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 m68k ~mips ppc ppc64 s390 sh ~sparc x86"
  11. fi
  12. DESCRIPTION="A standalone utility to process systemd-style tmpfiles.d files"
  13. HOMEPAGE="https://github.com/openrc/opentmpfiles"
  14. LICENSE="BSD-2"
  15. SLOT="0"
  16. IUSE="selinux"
  17. RDEPEND="!<sys-apps/openrc-0.23
  18. selinux? ( sec-policy/selinux-base-policy )"
  19. src_install() {
  20. default
  21. cd openrc
  22. for f in opentmpfiles-dev opentmpfiles-setup; do
  23. newconfd ${f}.confd ${f}
  24. newinitd ${f}.initd ${f}
  25. done
  26. }
  27. add_service() {
  28. local initd=$1
  29. local runlevel=$2
  30. elog "Auto-adding '${initd}' service to your ${runlevel} runlevel"
  31. ln -snf /etc/init.d/${initd} "${EROOT}"etc/runlevels/${runlevel}/${initd}
  32. }
  33. pkg_postinst() {
  34. if [[ -z $REPLACING_VERSIONS ]]; then
  35. add_service opentmpfiles-dev sysinit
  36. add_service opentmpfiles-setup boot
  37. fi
  38. }