tlsdate-0.0.13.ebuild 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit autotools eutils systemd vcs-snapshot user
  5. DESCRIPTION="Update local time over HTTPS"
  6. HOMEPAGE="https://github.com/ioerror/tlsdate"
  7. SRC_URI="https://github.com/ioerror/tlsdate/tarball/${P} -> ${P}.tar.gz"
  8. LICENSE="BSD"
  9. SLOT="0"
  10. KEYWORDS="amd64 arm arm64 hppa ia64 m68k ~mips s390 sh sparc x86"
  11. IUSE="dbus +seccomp static-libs"
  12. DEPEND="dev-libs/openssl:0=
  13. dev-libs/libevent:=
  14. dbus? ( sys-apps/dbus )"
  15. RDEPEND="${DEPEND}"
  16. PATCHES=(
  17. "${FILESDIR}"/${P}-tlsdated-service.patch
  18. )
  19. src_prepare() {
  20. # Use the system cert store rather than a custom one specific
  21. # to the tlsdate package. #534394
  22. sed -i \
  23. -e 's:/tlsdate/ca-roots/tlsdate-ca-roots.conf:/ssl/certs/ca-certificates.crt:' \
  24. Makefile.am || die
  25. default
  26. eautoreconf
  27. }
  28. src_configure() {
  29. econf \
  30. --disable-silent-rules \
  31. $(use_enable dbus) \
  32. $(use_enable seccomp seccomp-filter) \
  33. --disable-hardened-checks \
  34. --without-polarssl \
  35. --with-unpriv-user=tlsdate \
  36. --with-unpriv-group=tlsdate
  37. }
  38. src_install() {
  39. default
  40. # Use the system cert store; see src_prepare. #446426 #534394
  41. rm "${ED}"/etc/tlsdate/ca-roots/tlsdate-ca-roots.conf || die
  42. rmdir "${ED}"/etc/tlsdate/ca-roots || die
  43. newinitd "${FILESDIR}"/tlsdated.rc tlsdated
  44. newconfd "${FILESDIR}"/tlsdated.confd tlsdated
  45. newinitd "${FILESDIR}"/tlsdate.rc tlsdate
  46. newconfd "${FILESDIR}"/tlsdate.confd tlsdate
  47. systemd_newunit "${S}"/systemd/tlsdated.service tlsdated.service
  48. systemd_newtmpfilesd "${FILESDIR}"/tlsdated.tmpfiles.conf tlsdated.conf
  49. insinto /etc/default
  50. newins "${FILESDIR}"/tlsdated.default tlsdated
  51. insinto /etc/dbus-1/system.d/
  52. doins dbus/org.torproject.tlsdate.conf
  53. use static-libs || \
  54. find "${ED}"/usr '(' -name '*.la' -o -name '*.a' ')' -delete
  55. }
  56. pkg_preinst() {
  57. enewgroup tlsdate 124
  58. enewuser tlsdate 124 -1 /dev/null tlsdate
  59. }