Gentoo Archives: gentoo-commits

From: Kristian Fiskerstrand <k_f@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/sks/files/, net-misc/sks/
Date: Sun, 25 Jun 2017 22:34:56
Message-Id: 1498430081.c5d3a33403d2ff4f05b29ec925e06adf600e6a98.k_f@gentoo
1 commit: c5d3a33403d2ff4f05b29ec925e06adf600e6a98
2 Author: Kristian Fiskerstrand <k_f <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 25 22:34:09 2017 +0000
4 Commit: Kristian Fiskerstrand <k_f <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 25 22:34:41 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c5d3a334
7
8 net-misc/sks: Unbundle cryptokit
9
10 Gentoo-Bug: 591326
11
12 Package-Manager: Portage-2.3.6, Repoman-2.3.1
13
14 .../sks/files/sks-1.1.6-unbundle-cryptokit.patch | 79 ++++++++++++++
15 net-misc/sks/sks-1.1.6-r1.ebuild | 117 +++++++++++++++++++++
16 2 files changed, 196 insertions(+)
17
18 diff --git a/net-misc/sks/files/sks-1.1.6-unbundle-cryptokit.patch b/net-misc/sks/files/sks-1.1.6-unbundle-cryptokit.patch
19 new file mode 100644
20 index 00000000000..da11839fa12
21 --- /dev/null
22 +++ b/net-misc/sks/files/sks-1.1.6-unbundle-cryptokit.patch
23 @@ -0,0 +1,79 @@
24 +diff -r 4af75b3526d9 Makefile
25 +--- a/Makefile Sun Jun 25 20:39:45 2017 +0000
26 ++++ b/Makefile Mon Jun 26 00:27:10 2017 +0200
27 +@@ -53,10 +53,11 @@
28 + endif
29 +
30 + CAMLP4=-pp $(CAMLP4O)
31 +-CAMLINCLUDE= -I lib -I bdb
32 ++CRYPTOKIT=$(shell ocamlfind query cryptokit)
33 ++CAMLINCLUDE= -I lib -I bdb -I $(CRYPTOKIT)
34 + COMMONCAMLFLAGS=$(CAMLINCLUDE) $(OCAMLLIB) $(CAMLLDFLAGS) -ccopt -Lbdb -dtypes $(WARNERR)
35 + OCAMLDEP=ocamldep $(CAMLP4)
36 +-CAMLLIBS=unix.cma str.cma bdb.cma nums.cma bigarray.cma cryptokit.cma
37 ++CAMLLIBS=unix.cma str.cma bdb.cma nums.cma bigarray.cma $(CRYPTOKIT)/cryptokit.cma
38 + OCAMLFLAGS=$(COMMONCAMLFLAGS) -g $(CAMLLIBS)
39 + OCAMLOPTFLAGS=$(COMMONCAMLFLAGS) -inline 40 $(CAMLLIBS:.cma=.cmxa)
40 +
41 +@@ -107,7 +108,7 @@
42 +
43 + EXEOBJS.bc=$(RSERVOBJS.bc) build.cmo fastbuild.cmo dbserver.cmo pdiskTest.cmo
44 +
45 +-LIBS.bc= lib/cryptokit.cma bdb/bdb.cma
46 ++LIBS.bc= bdb/bdb.cma
47 + LIBS=$(LIBS.bc:.cma=.cmxa)
48 +
49 + VERSION := $(shell cat VERSION)
50 +@@ -278,32 +279,11 @@
51 + touch prepared
52 +
53 +
54 +-CKVER=cryptokit-1.7
55 +-CKDIR=$(CKVER)/src
56 +-
57 + $(CKVER)/README.txt:
58 + tar xmvfz $(CKVER).tar.gz
59 + patch -p 0 < $(CKVER)-sks.patch
60 + patch -p 0 < $(CKVER)-sks-custom_compare.patch
61 +
62 +-$(CKDIR)/cryptokit.cma: $(CKVER)/README.txt
63 +- cd $(CKDIR) && $(MAKE) all
64 +-
65 +-$(CKDIR)/cryptokit.cmxa: $(CKVER)/README.txt
66 +- cd $(CKDIR) && $(MAKE) allopt
67 +-
68 +-lib/cryptokit.cma: $(CKDIR)/cryptokit.cma $(CKDIR)/cryptokit.cmxa prepared
69 +- cp $(CKDIR)/cryptokit.cmi $(CKDIR)/cryptokit.cma \
70 +- $(CKDIR)/cryptokit.mli lib
71 +- cp $(CKDIR)/libcryptokit.a lib
72 +- if test -f $(CKDIR)/dllcryptokit.so; then \
73 +- cp $(CKDIR)/dllcryptokit.so lib; fi
74 +- if test -f $(CKDIR)/cryptokit.cmxa; then \
75 +- cp $(CKDIR)/cryptokit.cmxa $(CKDIR)/cryptokit.cmx \
76 +- $(CKDIR)/cryptokit.a lib; fi
77 +-
78 +-lib/cryptokit.cmxa: lib/cryptokit.cma
79 +-
80 + ################################
81 + # old stuff
82 + ################################
83 +@@ -340,16 +320,16 @@
84 + dumbloop: $(LIBS) $(ALLOBJS) dumbloop.cmo
85 + $(OCAMLC) -o dumbloop $(OCAMLFLAGS) $(ALLOBJS) dumbloop.cmo
86 +
87 +-scan: $(OBJS) cryptokit dblib scan.ml
88 ++scan: $(OBJS) dblib scan.ml
89 + $(OCAMLC) -o scan $(OCAMLFLAGS) $(OBJS) scan.ml
90 +
91 + query: $(LIBS) $(ALLOBJS) query.cmo
92 + $(OCAMLC) -o query $(OCAMLFLAGS) $(ALLOBJS) query.cmo
93 +
94 +-printids: $(OBJS:.cmo=.cmx) cryptokit printids.ml
95 ++printids: $(OBJS:.cmo=.cmx) printids.ml
96 + $(OCAMLOPT) -o printids $(OCAMLOPTFLAGS) $(OBJS:.cmo=.cmx) printids.ml
97 +
98 +-printids.bc: $(OBJS) cryptokit printids.ml
99 ++printids.bc: $(OBJS) printids.ml
100 + $(OCAMLC) -o printids $(OCAMLFLAGS) $(OBJS) printids.ml
101 +
102 + krecode: $(ALLOBJS.opt) $(LIBS) recode.ml
103
104 diff --git a/net-misc/sks/sks-1.1.6-r1.ebuild b/net-misc/sks/sks-1.1.6-r1.ebuild
105 new file mode 100644
106 index 00000000000..1368af1fdc2
107 --- /dev/null
108 +++ b/net-misc/sks/sks-1.1.6-r1.ebuild
109 @@ -0,0 +1,117 @@
110 +# Copyright 1999-2017 Gentoo Foundation
111 +# Distributed under the terms of the GNU General Public License v2
112 +
113 +EAPI=6
114 +
115 +inherit multilib user readme.gentoo-r1 systemd
116 +
117 +DESCRIPTION="An OpenPGP keyserver which is decentralized with highly reliable synchronization"
118 +HOMEPAGE="https://bitbucket.org/skskeyserver/sks-keyserver"
119 +SRC_URI="https://bitbucket.org/skskeyserver/sks-keyserver/downloads/${P}.tgz"
120 +LICENSE="GPL-2"
121 +SLOT="0"
122 +KEYWORDS="~amd64 ~x86"
123 +IUSE="optimize test"
124 +DOC_CONTENTS="To get sks running, first build the database,
125 +start the database, import atleast one key, then
126 +run a cleandb. See the sks man page for more information
127 +Typical DB_CONFIG file and sksconf has been installed
128 +in /var/lib/sks and can be used as templates by renaming
129 +to remove the .typical extension. The DB_CONFIG file has
130 +to be in place before doing the database build, or the BDB
131 +environment has to be manually cleared from both KDB and PTree.
132 +The same applies if you are upgrading to this version with an existing KDB/Ptree,
133 +using another version of BDB than 4.8; you need to clear the environment
134 +using e.g. db4.6_recover -h . and db4.6_checkpoint -1h . in both KDB and PTree
135 +Additionally a sample web interface has been installed as
136 +web.typical in /var/lib/sks that can be used by renaming it to web
137 +Important: It is strongly recommended to set up SKS behind a
138 +reverse proxy. Instructions on properly configuring SKS can be
139 +found at https://bitbucket.org/skskeyserver/sks-keyserver/wiki/Peering"
140 +
141 +DEPEND=">=dev-lang/ocaml-4.0
142 + dev-ml/findlib
143 + dev-ml/camlp4
144 + dev-ml/cryptokit:0/1.10
145 + sys-libs/db:5.3"
146 +RDEPEND="${DEPEND}"
147 +
148 +pkg_setup() {
149 + ebegin "Creating named group and user"
150 + enewgroup sks
151 + enewuser sks -1 -1 /var/lib/sks sks
152 +}
153 +
154 +src_prepare() {
155 + eapply "${FILESDIR}/${P}-unbundle-cryptokit.patch"
156 + cp Makefile.local.unused Makefile.local || die
157 + sed -i \
158 + -e "s:^BDBLIB=.*$:BDBLIB=-L/usr/$(get_libdir):g" \
159 + -e "s:^BDBINCLUDE=.*$:BDBINCLUDE=-I/usr/include/db5.3/:g" \
160 + -e "s:^LIBDB=.*$:LIBDB=-ldb-5.3:g" \
161 + -e "s:^PREFIX=.*$:PREFIX=${D}/usr:g" \
162 + -e "s:^MANDIR=.*$:MANDIR=${D}/usr/share/man:g" \
163 + Makefile.local || die
164 + sed -i \
165 + -e 's:^CAMLINCLUDE= -I lib -I bdb$:CAMLINCLUDE= -I lib -I bdb -I +cryptokit:g' \
166 + -e 's:-Werror-implicit-function-declaration::g' \
167 + Makefile bdb/Makefile || die
168 + sed -i \
169 + -e 's:/usr/sbin/sks:/usr/bin/sks:g' \
170 + sks_build.sh || die
171 + eapply_user
172 +}
173 +
174 +src_compile() {
175 + emake dep
176 + # sks build fails with paralell build in module Bdb
177 + emake -j1 all
178 + if use optimize; then
179 + emake all.bc
180 + fi
181 +}
182 +
183 +src_test() {
184 + ./sks unit_test || die
185 +}
186 +
187 +src_install() {
188 + if use optimize; then
189 + emake install.bc
190 + dosym /usr/bin/sks.bc usr/bin/sks
191 + dosym /usr/bin/sks_add_mail.bc usr/bin/sks_add_mail
192 + else
193 + emake install
194 + fi
195 +
196 + dodoc README.md
197 +
198 + newinitd "${FILESDIR}/sks-db.initd" sks-db
199 + newinitd "${FILESDIR}/sks-recon.initd" sks-recon
200 + newconfd "${FILESDIR}/sks.confd" sks
201 + systemd_dounit "${FILESDIR}"/sks-db.service
202 + systemd_dounit "${FILESDIR}"/sks-recon.service
203 +
204 + dodir "/var/lib/sks/web.typical"
205 + insinto /var/lib/sks
206 + newins sampleConfig/DB_CONFIG DB_CONFIG.typical
207 + newins sampleConfig/sksconf.typical sksconf.typical
208 + insinto /var/lib/sks/web.typical
209 + doins sampleWeb/HTML5/*
210 +
211 + keepdir /var/lib/sks
212 + readme.gentoo_create_doc
213 +}
214 +
215 +pkg_postinst() {
216 + readme.gentoo_print_elog
217 +
218 + if [[ -n ${REPLACING_VERSIONS} ]]; then
219 + einfo "Note when upgrading from versions of SKS earlier than 1.1.4"
220 + einfo "The default values for pagesize settings have changed. To continue"
221 + einfo "using an existing DB without rebuilding, explicit settings have to be"
222 + einfo "added to the sksconf file."
223 + einfo "pagesize: 4"
224 + einfo "ptree_pagesize: 1"
225 + fi;
226 +}