commit:     5572206ce66a7efca524f9ac45221ddbda28e185
Author:     Kristian Fiskerstrand <k_f <AT> gentoo <DOT> org>
AuthorDate: Sun Jul  9 19:10:49 2017 +0000
Commit:     Kristian Fiskerstrand <k_f <AT> gentoo <DOT> org>
CommitDate: Sun Jul  9 19:11:16 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5572206c

net-misc/sks: backport a few additional fixes from upstream

Package-Manager: Portage-2.3.6, Repoman-2.3.1

 net-misc/sks/files/sks-1.1.6-use-ocamlfind2.patch |  19 ++++
 net-misc/sks/files/sks-1.1.6-use-ocamlfind3.patch |  21 ++++
 net-misc/sks/sks-1.1.6-r5.ebuild                  | 118 ++++++++++++++++++++++
 3 files changed, 158 insertions(+)

diff --git a/net-misc/sks/files/sks-1.1.6-use-ocamlfind2.patch 
b/net-misc/sks/files/sks-1.1.6-use-ocamlfind2.patch
new file mode 100644
index 00000000000..1fba250fd4b
--- /dev/null
+++ b/net-misc/sks/files/sks-1.1.6-use-ocamlfind2.patch
@@ -0,0 +1,19 @@
+# HG changeset patch
+# User Kristian Fiskerstrand <k...@sumptuouscapital.com>
+# Date 1499610580 -7200
+# Node ID 719ffdf628a81a2f052f3b6dc746a3e1d37afe30
+# Parent  6352f0dbcadf35aac29c2fbf10fb218ae50d9c77
+Fix nums specification
+
+diff --git a/Makefile b/Makefile
+--- a/Makefile
++++ b/Makefile
+@@ -56,7 +56,7 @@
+ CAMLINCLUDE= -package cryptokit,unix,str,bigarray -I lib -I bdb
+ COMMONCAMLFLAGS=$(CAMLINCLUDE) $(OCAMLLIB) $(CAMLLDFLAGS) -ccopt -Lbdb 
-dtypes $(WARNERR)
+ OCAMLDEP=ocamldep $(CAMLP4)
+-CAMLLIBS=bdb.cma nums.cma
++CAMLLIBS=bdb.cma
+ OCAMLFLAGS=$(COMMONCAMLFLAGS) -linkpkg -g $(CAMLLIBS)
+ OCAMLOPTFLAGS=$(COMMONCAMLFLAGS) -linkpkg -inline 40 $(CAMLLIBS:.cma=.cmxa)
+ 

diff --git a/net-misc/sks/files/sks-1.1.6-use-ocamlfind3.patch 
b/net-misc/sks/files/sks-1.1.6-use-ocamlfind3.patch
new file mode 100644
index 00000000000..ea5a82db653
--- /dev/null
+++ b/net-misc/sks/files/sks-1.1.6-use-ocamlfind3.patch
@@ -0,0 +1,21 @@
+# HG changeset patch
+# User Kristian Fiskerstrand <k...@sumptuouscapital.com>
+# Date 1499612080 -7200
+# Node ID 0106ba2f6abc8ee2f685026d3f218730114a60fa
+# Parent  719ffdf628a81a2f052f3b6dc746a3e1d37afe30
+Add num to findlib packages
+
+Although nums is detected, making this explicit
+
+diff --git a/Makefile b/Makefile
+--- a/Makefile
++++ b/Makefile
+@@ -53,7 +53,7 @@
+ endif
+ 
+ CAMLP4=-pp $(CAMLP4O)
+-CAMLINCLUDE= -package cryptokit,unix,str,bigarray -I lib -I bdb
++CAMLINCLUDE= -package cryptokit,unix,str,bigarray,num -I lib -I bdb
+ COMMONCAMLFLAGS=$(CAMLINCLUDE) $(OCAMLLIB) $(CAMLLDFLAGS) -ccopt -Lbdb 
-dtypes $(WARNERR)
+ OCAMLDEP=ocamldep $(CAMLP4)
+ CAMLLIBS=bdb.cma

diff --git a/net-misc/sks/sks-1.1.6-r5.ebuild b/net-misc/sks/sks-1.1.6-r5.ebuild
new file mode 100644
index 00000000000..3ca116dbae9
--- /dev/null
+++ b/net-misc/sks/sks-1.1.6-r5.ebuild
@@ -0,0 +1,118 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit multilib user readme.gentoo-r1 systemd
+
+DESCRIPTION="An OpenPGP keyserver which is decentralized with highly reliable 
synchronization"
+HOMEPAGE="https://bitbucket.org/skskeyserver/sks-keyserver";
+SRC_URI="https://bitbucket.org/skskeyserver/sks-keyserver/downloads/${P}.tgz";
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="optimize test"
+DOC_CONTENTS="To get sks running, first build the database,
+start the database, import atleast one key, then
+run a cleandb. See the sks man page for more information
+Typical DB_CONFIG file and sksconf has been installed
+in /var/lib/sks and can be used as templates by renaming
+to remove the .typical extension. The DB_CONFIG file has
+to be in place before doing the database build, or the BDB
+environment has to be manually cleared from both KDB and PTree.
+The same applies if you are upgrading to this version with an existing 
KDB/Ptree,
+using another version of BDB than 4.8; you need to clear the environment
+using e.g. db4.6_recover -h . and db4.6_checkpoint -1h . in both KDB and PTree
+Additionally a sample web interface has been installed as
+web.typical in /var/lib/sks that can be used by renaming it to web
+Important: It is strongly recommended to set up SKS behind a
+reverse proxy. Instructions on properly configuring SKS can be
+found at https://bitbucket.org/skskeyserver/sks-keyserver/wiki/Peering";
+
+RDEPEND=">=dev-lang/ocaml-4.0:=
+       dev-ml/camlp4:=
+       dev-ml/cryptokit:=
+       sys-libs/db:5.3"
+DEPEND="${RDEPEND}
+       dev-ml/findlib"
+
+pkg_setup() {
+       ebegin "Creating named group and user"
+       enewgroup sks
+       enewuser sks -1 -1 /var/lib/sks sks
+}
+
+src_prepare() {
+       eapply "${FILESDIR}/${P}-unbundle-cryptokit.patch" \
+                       "${FILESDIR}/${P}-use-ocamlfind.patch" \
+                       "${FILESDIR}/${P}-use-ocamlfind2.patch" \
+                       "${FILESDIR}/${P}-use-ocamlfind3.patch"
+
+
+       cp Makefile.local.unused Makefile.local || die
+       sed -i \
+               -e "s:^BDBLIB=.*$:BDBLIB=-L/usr/$(get_libdir):g" \
+               -e "s:^BDBINCLUDE=.*$:BDBINCLUDE=-I/usr/include/db5.3/:g" \
+               -e "s:^LIBDB=.*$:LIBDB=-ldb-5.3:g" \
+               -e "s:^PREFIX=.*$:PREFIX=${D}/usr:g" \
+               -e "s:^MANDIR=.*$:MANDIR=${D}/usr/share/man:g" \
+               Makefile.local || die
+       sed -i \
+               -e 's:/usr/sbin/sks:/usr/bin/sks:g' \
+               sks_build.sh || die
+       eapply_user
+}
+
+src_compile() {
+       emake dep
+       # sks build fails with paralell build in module Bdb
+       emake -j1 all
+       if use optimize; then
+               emake all.bc
+       fi
+}
+
+src_test() {
+       ./sks unit_test || die
+}
+
+src_install() {
+       if use optimize; then
+               emake install.bc
+               dosym /usr/bin/sks.bc usr/bin/sks
+               dosym /usr/bin/sks_add_mail.bc usr/bin/sks_add_mail
+       else
+               emake install
+       fi
+
+       dodoc README.md
+
+       newinitd "${FILESDIR}/sks-db.initd" sks-db
+       newinitd "${FILESDIR}/sks-recon.initd" sks-recon
+       newconfd "${FILESDIR}/sks.confd" sks
+       systemd_dounit "${FILESDIR}"/sks-db.service
+       systemd_dounit "${FILESDIR}"/sks-recon.service
+
+       dodir "/var/lib/sks/web.typical"
+       insinto /var/lib/sks
+       newins sampleConfig/DB_CONFIG DB_CONFIG.typical
+       newins sampleConfig/sksconf.typical sksconf.typical
+       insinto /var/lib/sks/web.typical
+       doins sampleWeb/HTML5/*
+
+       keepdir /var/lib/sks
+       readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+       readme.gentoo_print_elog
+
+       if [[ -n ${REPLACING_VERSIONS} ]]; then
+               einfo "Note when upgrading from versions of SKS earlier than 
1.1.4"
+               einfo "The default values for pagesize settings have changed. 
To continue"
+               einfo "using an existing DB without rebuilding, explicit 
settings have to be"
+               einfo "added to the sksconf file."
+               einfo "pagesize:       4"
+               einfo "ptree_pagesize: 1"
+       fi;
+}

Reply via email to