sks-1.1.5-r3.ebuild 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit multilib user readme.gentoo systemd
  5. DESCRIPTION="An OpenPGP keyserver which is decentralized with highly reliable synchronization"
  6. HOMEPAGE="https://bitbucket.org/skskeyserver/sks-keyserver"
  7. SRC_URI="https://bitbucket.org/skskeyserver/sks-keyserver/downloads/${P}.tgz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="amd64 ~x86"
  11. IUSE="optimize test"
  12. DOC_CONTENTS="To get sks running, first build the database,
  13. start the database, import atleast one key, then
  14. run a cleandb. See the sks man page for more information
  15. Typical DB_CONFIG file and sksconf has been installed
  16. in /var/lib/sks and can be used as templates by renaming
  17. to remove the .typical extension. The DB_CONFIG file has
  18. to be in place before doing the database build, or the BDB
  19. environment has to be manually cleared from both KDB and PTree.
  20. The same applies if you are upgrading to this version with an existing KDB/Ptree,
  21. using another version of BDB than 4.8; you need to clear the environment
  22. using e.g. db4.6_recover -h . and db4.6_checkpoint -1h . in both KDB and PTree
  23. Additionally a sample web interface has been installed as
  24. web.typical in /var/lib/sks that can be used by renaming it to web
  25. Important: It is strongly recommended to set up SKS behind a
  26. reverse proxy. Instructions on properly configuring SKS can be
  27. found at https://bitbucket.org/skskeyserver/sks-keyserver/wiki/Peering"
  28. DEPEND=">=dev-lang/ocaml-4.0
  29. dev-ml/camlp4
  30. dev-ml/cryptokit
  31. sys-libs/db:4.8"
  32. RDEPEND="${DEPEND}"
  33. pkg_setup() {
  34. ebegin "Creating named group and user"
  35. enewgroup sks
  36. enewuser sks -1 -1 /var/lib/sks sks
  37. }
  38. src_prepare() {
  39. cp Makefile.local.unused Makefile.local || die
  40. sed -i \
  41. -e "s:^BDBLIB=.*$:BDBLIB=-L/usr/$(get_libdir):g" \
  42. -e "s:^BDBINCLUDE=.*$:BDBINCLUDE=-I/usr/include/db4.8/:g" \
  43. -e "s:^LIBDB=.*$:LIBDB=-ldb-4.8:g" \
  44. -e "s:^PREFIX=.*$:PREFIX=${D}/usr:g" \
  45. -e "s:^MANDIR=.*$:MANDIR=${D}/usr/share/man:g" \
  46. Makefile.local || die
  47. sed -i \
  48. -e 's:^CAMLINCLUDE= -I lib -I bdb$:CAMLINCLUDE= -I lib -I bdb -I +cryptokit:g' \
  49. -e 's:-Werror-implicit-function-declaration::g' \
  50. Makefile bdb/Makefile || die
  51. sed -i \
  52. -e 's:/usr/sbin/sks:/usr/bin/sks:g' \
  53. sks_build.sh || die
  54. epatch "${FILESDIR}/${P}-eddsa.patch"
  55. epatch "${FILESDIR}/${P}-disable-warn-error-a.patch"
  56. epatch "${FILESDIR}/${P}-curve25519.patch"
  57. }
  58. src_compile() {
  59. emake dep
  60. # sks build fails with paralell build in module Bdb
  61. emake -j1 all
  62. if use optimize; then
  63. emake all.bc
  64. fi
  65. }
  66. src_test() {
  67. ./sks unit_test || die
  68. }
  69. src_install() {
  70. if use optimize; then
  71. emake install.bc
  72. dosym /usr/bin/sks.bc usr/bin/sks
  73. dosym /usr/bin/sks_add_mail.bc usr/bin/sks_add_mail
  74. else
  75. emake install
  76. fi
  77. dodoc README.md
  78. newinitd "${FILESDIR}/sks-db.initd" sks-db
  79. newinitd "${FILESDIR}/sks-recon.initd" sks-recon
  80. newconfd "${FILESDIR}/sks.confd" sks
  81. systemd_dounit "${FILESDIR}"/sks-db.service
  82. systemd_dounit "${FILESDIR}"/sks-recon.service
  83. dodir "/var/lib/sks/web.typical"
  84. insinto /var/lib/sks
  85. newins sampleConfig/DB_CONFIG DB_CONFIG.typical
  86. newins sampleConfig/sksconf.typical sksconf.typical
  87. insinto /var/lib/sks/web.typical
  88. doins sampleWeb/HTML5/*
  89. keepdir /var/lib/sks
  90. readme.gentoo_create_doc
  91. }
  92. pkg_postinst() {
  93. readme.gentoo_print_elog
  94. if [[ -n ${REPLACING_VERSIONS} ]]; then
  95. einfo "Note when upgrading from versions of SKS earlier than 1.1.4"
  96. einfo "The default values for pagesize settings have changed. To continue"
  97. einfo "using an existing DB without rebuilding, explicit settings have to be"
  98. einfo "added to the sksconf file."
  99. einfo "pagesize: 4"
  100. einfo "ptree_pagesize: 1"
  101. fi;
  102. }