public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-misc/sks/, net-misc/sks/files/
@ 2017-07-08 17:36 Alexis Ballier
  0 siblings, 0 replies; 2+ messages in thread
From: Alexis Ballier @ 2017-07-08 17:36 UTC (permalink / raw
  To: gentoo-commits

commit:     e0555bdfc4695a025541918c967e3e415f026397
Author:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Sat Jul  8 17:35:43 2017 +0000
Commit:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Sat Jul  8 17:36:00 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e0555bdf

net-misc/sks: use ocamlfind for link and build.

Fixes build with latest cryptokit.
Improve a bit dependencies too.

Package-Manager: Portage-2.3.6, Repoman-2.3.2

 net-misc/sks/files/sks-1.1.6-use-ocamlfind.patch |  39 ++++++++
 net-misc/sks/sks-1.1.6-r3.ebuild                 | 118 +++++++++++++++++++++++
 2 files changed, 157 insertions(+)

diff --git a/net-misc/sks/files/sks-1.1.6-use-ocamlfind.patch b/net-misc/sks/files/sks-1.1.6-use-ocamlfind.patch
new file mode 100644
index 00000000000..c9afc259409
--- /dev/null
+++ b/net-misc/sks/files/sks-1.1.6-use-ocamlfind.patch
@@ -0,0 +1,39 @@
+Use ocamlfind for finding dependencies, esp. for doing their transitive closure.
+
+Ideally the build system should be converted to something more modern like
+jbuilder.
+
+Index: sks-1.1.6/Makefile
+===================================================================
+--- sks-1.1.6.orig/Makefile
++++ sks-1.1.6/Makefile
+@@ -21,10 +21,10 @@ CFLAGS=-O3  $(CINCLUDES) -I .
+ CXXFLAGS=-O3 $(CINCLUDES) -I .
+ 
+ ifndef OCAMLC
+-	OCAMLC=ocamlc
++	OCAMLC=ocamlfind ocamlc
+ endif
+ ifndef OCAMLOPT
+-	OCAMLOPT=ocamlopt
++	OCAMLOPT=ocamlfind ocamlopt
+ endif
+ ifndef CAMLP4O
+ 	CAMLP4O=camlp4o
+@@ -55,12 +55,12 @@ WARNERR=-warn-error A
+ endif
+ 
+ CAMLP4=-pp $(CAMLP4O)
+-CAMLINCLUDE= -I lib -I bdb -I +cryptokit
++CAMLINCLUDE= -package cryptokit,unix,str,bigarray -I lib -I bdb
+ COMMONCAMLFLAGS=$(CAMLINCLUDE) $(OCAMLLIB) $(CAMLLDFLAGS) -ccopt -Lbdb -dtypes $(WARNERR)
+ OCAMLDEP=ocamldep $(CAMLP4)
+-CAMLLIBS=unix.cma str.cma bdb.cma nums.cma bigarray.cma cryptokit.cma
+-OCAMLFLAGS=$(COMMONCAMLFLAGS) -g $(CAMLLIBS)
+-OCAMLOPTFLAGS=$(COMMONCAMLFLAGS) -inline 40 $(CAMLLIBS:.cma=.cmxa)
++CAMLLIBS=bdb.cma nums.cma
++OCAMLFLAGS=$(COMMONCAMLFLAGS) -linkpkg -g $(CAMLLIBS)
++OCAMLOPTFLAGS=$(COMMONCAMLFLAGS) -linkpkg -inline 40 $(CAMLLIBS:.cma=.cmxa)
+ 
+ EXE=sks sks_add_mail
+ ALL=$(EXE) sks.8.gz

diff --git a/net-misc/sks/sks-1.1.6-r3.ebuild b/net-misc/sks/sks-1.1.6-r3.ebuild
new file mode 100644
index 00000000000..a830d01e828
--- /dev/null
+++ b/net-misc/sks/sks-1.1.6-r3.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"
+	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:^CAMLINCLUDE= -I lib -I bdb$:CAMLINCLUDE= -I lib -I bdb -I +cryptokit:g' \
+		-e 's:-Werror-implicit-function-declaration::g' \
+		Makefile bdb/Makefile || 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;
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-misc/sks/, net-misc/sks/files/
@ 2021-04-06 22:47 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2021-04-06 22:47 UTC (permalink / raw
  To: gentoo-commits

commit:     ddd41714ba739d7ef77ef4b2cb5c0bfeb5386cf3
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Apr  6 22:47:08 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Apr  6 22:47:25 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ddd41714

net-misc/sks: add upstream patch for DB hang

Bug: https://bugs.gentoo.org/780141
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../sks/files/sks-1.1.6_p20200624-r1-db-hang.patch |  32 +++++
 net-misc/sks/sks-1.1.6_p20200624-r1.ebuild         | 133 +++++++++++++++++++++
 2 files changed, 165 insertions(+)

diff --git a/net-misc/sks/files/sks-1.1.6_p20200624-r1-db-hang.patch b/net-misc/sks/files/sks-1.1.6_p20200624-r1-db-hang.patch
new file mode 100644
index 00000000000..a09d55c1bb8
--- /dev/null
+++ b/net-misc/sks/files/sks-1.1.6_p20200624-r1-db-hang.patch
@@ -0,0 +1,32 @@
+https://bugs.gentoo.org/780141
+https://github.com/SKS-Keyserver/sks-keyserver/commit/c3ba6d5abb525dcb84745245631c410c11c07ec1.patch
+
+From c3ba6d5abb525dcb84745245631c410c11c07ec1 Mon Sep 17 00:00:00 2001
+From: ygrek <ygrek@autistici.org>
+Date: Thu, 4 Feb 2021 15:31:02 -0500
+Subject: [PATCH] do not set DB_DBT_READONLY (fix #82)
+
+it is allowed only on keys, but sks is not using any bdb functions that
+might mutate keys, so it is easier to just avoid using it altogether
+---
+ bdb/bdb_stubs.c | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/bdb/bdb_stubs.c b/bdb/bdb_stubs.c
+index 864f0b2..959ee27 100644
+--- a/bdb/bdb_stubs.c
++++ b/bdb/bdb_stubs.c
+@@ -58,13 +58,8 @@ static void dbt_from_string(DBT *dbt, value v) {
+   // uninitialized stack-allocated DBT
+   zerob(dbt, sizeof(*dbt));
+ 
+-  // Cast away the lack of const: we set DB_DBT_READONLY to
+-  // indicate to bdb that it shouldn't modify this buffer
+   dbt->data = (void *)String_val(v);
+   dbt->size = string_length(v);
+-#ifdef DB_DBT_READONLY
+-  dbt->flags = DB_DBT_READONLY;
+-#endif
+ }
+ 
+ #if OCAML_VERSION < 40600

diff --git a/net-misc/sks/sks-1.1.6_p20200624-r1.ebuild b/net-misc/sks/sks-1.1.6_p20200624-r1.ebuild
new file mode 100644
index 00000000000..86789aedbe7
--- /dev/null
+++ b/net-misc/sks/sks-1.1.6_p20200624-r1.ebuild
@@ -0,0 +1,133 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit readme.gentoo-r1 systemd toolchain-funcs
+
+COMMIT="591a7834dc9f1dff3d336d769a6561138a5befe7"
+DESCRIPTION="An OpenPGP keyserver which is decentralized with highly reliable synchronization"
+HOMEPAGE="https://github.com/SKS-Keyserver/sks-keyserver"
+SRC_URI="https://github.com/SKS-Keyserver/sks-keyserver/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${PN}-keyserver-${COMMIT}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="optimize test"
+RESTRICT="!test? ( 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="
+	acct-user/sks
+	acct-group/sks
+	>=dev-lang/ocaml-4.0:=
+	dev-ml/camlp4:=
+	dev-ml/cryptokit:=
+	dev-ml/num:=
+	sys-libs/db:5.3
+"
+DEPEND="${RDEPEND}
+	dev-ml/findlib"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-1.1.6_p20200624-respect-CFLAGS-CXXFLAGS.patch
+	"${FILESDIR}"/${PN}-1.1.6_p20200624-QA-fixups.patch
+	"${FILESDIR}"/${PN}-1.1.6_p20200624-r1-db-hang.patch
+)
+
+QA_FLAGS_IGNORED=(
+	/usr/bin/sks_add_mail
+)
+
+src_prepare() {
+	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
+
+	dosym sks_build.sh /usr/bin/sks_build.bc.sh
+	default
+}
+
+src_compile() {
+	tc-export CC CXX RANLIB
+
+	emake dep
+	# sks build fails with parallel 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 sks.bc usr/bin/sks
+		dosym 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
+	fowners sks:sks /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;
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-06 22:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-06 22:47 [gentoo-commits] repo/gentoo:master commit in: net-misc/sks/, net-misc/sks/files/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2017-07-08 17:36 Alexis Ballier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox