1 |
commit: e0555bdfc4695a025541918c967e3e415f026397 |
2 |
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jul 8 17:35:43 2017 +0000 |
4 |
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jul 8 17:36:00 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e0555bdf |
7 |
|
8 |
net-misc/sks: use ocamlfind for link and build. |
9 |
|
10 |
Fixes build with latest cryptokit. |
11 |
Improve a bit dependencies too. |
12 |
|
13 |
Package-Manager: Portage-2.3.6, Repoman-2.3.2 |
14 |
|
15 |
net-misc/sks/files/sks-1.1.6-use-ocamlfind.patch | 39 ++++++++ |
16 |
net-misc/sks/sks-1.1.6-r3.ebuild | 118 +++++++++++++++++++++++ |
17 |
2 files changed, 157 insertions(+) |
18 |
|
19 |
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 |
20 |
new file mode 100644 |
21 |
index 00000000000..c9afc259409 |
22 |
--- /dev/null |
23 |
+++ b/net-misc/sks/files/sks-1.1.6-use-ocamlfind.patch |
24 |
@@ -0,0 +1,39 @@ |
25 |
+Use ocamlfind for finding dependencies, esp. for doing their transitive closure. |
26 |
+ |
27 |
+Ideally the build system should be converted to something more modern like |
28 |
+jbuilder. |
29 |
+ |
30 |
+Index: sks-1.1.6/Makefile |
31 |
+=================================================================== |
32 |
+--- sks-1.1.6.orig/Makefile |
33 |
++++ sks-1.1.6/Makefile |
34 |
+@@ -21,10 +21,10 @@ CFLAGS=-O3 $(CINCLUDES) -I . |
35 |
+ CXXFLAGS=-O3 $(CINCLUDES) -I . |
36 |
+ |
37 |
+ ifndef OCAMLC |
38 |
+- OCAMLC=ocamlc |
39 |
++ OCAMLC=ocamlfind ocamlc |
40 |
+ endif |
41 |
+ ifndef OCAMLOPT |
42 |
+- OCAMLOPT=ocamlopt |
43 |
++ OCAMLOPT=ocamlfind ocamlopt |
44 |
+ endif |
45 |
+ ifndef CAMLP4O |
46 |
+ CAMLP4O=camlp4o |
47 |
+@@ -55,12 +55,12 @@ WARNERR=-warn-error A |
48 |
+ endif |
49 |
+ |
50 |
+ CAMLP4=-pp $(CAMLP4O) |
51 |
+-CAMLINCLUDE= -I lib -I bdb -I +cryptokit |
52 |
++CAMLINCLUDE= -package cryptokit,unix,str,bigarray -I lib -I bdb |
53 |
+ COMMONCAMLFLAGS=$(CAMLINCLUDE) $(OCAMLLIB) $(CAMLLDFLAGS) -ccopt -Lbdb -dtypes $(WARNERR) |
54 |
+ OCAMLDEP=ocamldep $(CAMLP4) |
55 |
+-CAMLLIBS=unix.cma str.cma bdb.cma nums.cma bigarray.cma cryptokit.cma |
56 |
+-OCAMLFLAGS=$(COMMONCAMLFLAGS) -g $(CAMLLIBS) |
57 |
+-OCAMLOPTFLAGS=$(COMMONCAMLFLAGS) -inline 40 $(CAMLLIBS:.cma=.cmxa) |
58 |
++CAMLLIBS=bdb.cma nums.cma |
59 |
++OCAMLFLAGS=$(COMMONCAMLFLAGS) -linkpkg -g $(CAMLLIBS) |
60 |
++OCAMLOPTFLAGS=$(COMMONCAMLFLAGS) -linkpkg -inline 40 $(CAMLLIBS:.cma=.cmxa) |
61 |
+ |
62 |
+ EXE=sks sks_add_mail |
63 |
+ ALL=$(EXE) sks.8.gz |
64 |
|
65 |
diff --git a/net-misc/sks/sks-1.1.6-r3.ebuild b/net-misc/sks/sks-1.1.6-r3.ebuild |
66 |
new file mode 100644 |
67 |
index 00000000000..a830d01e828 |
68 |
--- /dev/null |
69 |
+++ b/net-misc/sks/sks-1.1.6-r3.ebuild |
70 |
@@ -0,0 +1,118 @@ |
71 |
+# Copyright 1999-2017 Gentoo Foundation |
72 |
+# Distributed under the terms of the GNU General Public License v2 |
73 |
+ |
74 |
+EAPI=6 |
75 |
+ |
76 |
+inherit multilib user readme.gentoo-r1 systemd |
77 |
+ |
78 |
+DESCRIPTION="An OpenPGP keyserver which is decentralized with highly reliable synchronization" |
79 |
+HOMEPAGE="https://bitbucket.org/skskeyserver/sks-keyserver" |
80 |
+SRC_URI="https://bitbucket.org/skskeyserver/sks-keyserver/downloads/${P}.tgz" |
81 |
+LICENSE="GPL-2" |
82 |
+SLOT="0" |
83 |
+KEYWORDS="~amd64 ~x86" |
84 |
+IUSE="optimize test" |
85 |
+DOC_CONTENTS="To get sks running, first build the database, |
86 |
+start the database, import atleast one key, then |
87 |
+run a cleandb. See the sks man page for more information |
88 |
+Typical DB_CONFIG file and sksconf has been installed |
89 |
+in /var/lib/sks and can be used as templates by renaming |
90 |
+to remove the .typical extension. The DB_CONFIG file has |
91 |
+to be in place before doing the database build, or the BDB |
92 |
+environment has to be manually cleared from both KDB and PTree. |
93 |
+The same applies if you are upgrading to this version with an existing KDB/Ptree, |
94 |
+using another version of BDB than 4.8; you need to clear the environment |
95 |
+using e.g. db4.6_recover -h . and db4.6_checkpoint -1h . in both KDB and PTree |
96 |
+Additionally a sample web interface has been installed as |
97 |
+web.typical in /var/lib/sks that can be used by renaming it to web |
98 |
+Important: It is strongly recommended to set up SKS behind a |
99 |
+reverse proxy. Instructions on properly configuring SKS can be |
100 |
+found at https://bitbucket.org/skskeyserver/sks-keyserver/wiki/Peering" |
101 |
+ |
102 |
+RDEPEND=">=dev-lang/ocaml-4.0:= |
103 |
+ dev-ml/camlp4:= |
104 |
+ dev-ml/cryptokit:= |
105 |
+ sys-libs/db:5.3" |
106 |
+DEPEND="${RDEPEND} |
107 |
+ dev-ml/findlib" |
108 |
+ |
109 |
+pkg_setup() { |
110 |
+ ebegin "Creating named group and user" |
111 |
+ enewgroup sks |
112 |
+ enewuser sks -1 -1 /var/lib/sks sks |
113 |
+} |
114 |
+ |
115 |
+src_prepare() { |
116 |
+ eapply "${FILESDIR}/${P}-unbundle-cryptokit.patch" \ |
117 |
+ "${FILESDIR}/${P}-use-ocamlfind.patch" |
118 |
+ cp Makefile.local.unused Makefile.local || die |
119 |
+ sed -i \ |
120 |
+ -e "s:^BDBLIB=.*$:BDBLIB=-L/usr/$(get_libdir):g" \ |
121 |
+ -e "s:^BDBINCLUDE=.*$:BDBINCLUDE=-I/usr/include/db5.3/:g" \ |
122 |
+ -e "s:^LIBDB=.*$:LIBDB=-ldb-5.3:g" \ |
123 |
+ -e "s:^PREFIX=.*$:PREFIX=${D}/usr:g" \ |
124 |
+ -e "s:^MANDIR=.*$:MANDIR=${D}/usr/share/man:g" \ |
125 |
+ Makefile.local || die |
126 |
+ sed -i \ |
127 |
+ -e 's:^CAMLINCLUDE= -I lib -I bdb$:CAMLINCLUDE= -I lib -I bdb -I +cryptokit:g' \ |
128 |
+ -e 's:-Werror-implicit-function-declaration::g' \ |
129 |
+ Makefile bdb/Makefile || die |
130 |
+ sed -i \ |
131 |
+ -e 's:/usr/sbin/sks:/usr/bin/sks:g' \ |
132 |
+ sks_build.sh || die |
133 |
+ eapply_user |
134 |
+} |
135 |
+ |
136 |
+src_compile() { |
137 |
+ emake dep |
138 |
+ # sks build fails with paralell build in module Bdb |
139 |
+ emake -j1 all |
140 |
+ if use optimize; then |
141 |
+ emake all.bc |
142 |
+ fi |
143 |
+} |
144 |
+ |
145 |
+src_test() { |
146 |
+ ./sks unit_test || die |
147 |
+} |
148 |
+ |
149 |
+src_install() { |
150 |
+ if use optimize; then |
151 |
+ emake install.bc |
152 |
+ dosym /usr/bin/sks.bc usr/bin/sks |
153 |
+ dosym /usr/bin/sks_add_mail.bc usr/bin/sks_add_mail |
154 |
+ else |
155 |
+ emake install |
156 |
+ fi |
157 |
+ |
158 |
+ dodoc README.md |
159 |
+ |
160 |
+ newinitd "${FILESDIR}/sks-db.initd" sks-db |
161 |
+ newinitd "${FILESDIR}/sks-recon.initd" sks-recon |
162 |
+ newconfd "${FILESDIR}/sks.confd" sks |
163 |
+ systemd_dounit "${FILESDIR}"/sks-db.service |
164 |
+ systemd_dounit "${FILESDIR}"/sks-recon.service |
165 |
+ |
166 |
+ dodir "/var/lib/sks/web.typical" |
167 |
+ insinto /var/lib/sks |
168 |
+ newins sampleConfig/DB_CONFIG DB_CONFIG.typical |
169 |
+ newins sampleConfig/sksconf.typical sksconf.typical |
170 |
+ insinto /var/lib/sks/web.typical |
171 |
+ doins sampleWeb/HTML5/* |
172 |
+ |
173 |
+ keepdir /var/lib/sks |
174 |
+ readme.gentoo_create_doc |
175 |
+} |
176 |
+ |
177 |
+pkg_postinst() { |
178 |
+ readme.gentoo_print_elog |
179 |
+ |
180 |
+ if [[ -n ${REPLACING_VERSIONS} ]]; then |
181 |
+ einfo "Note when upgrading from versions of SKS earlier than 1.1.4" |
182 |
+ einfo "The default values for pagesize settings have changed. To continue" |
183 |
+ einfo "using an existing DB without rebuilding, explicit settings have to be" |
184 |
+ einfo "added to the sksconf file." |
185 |
+ einfo "pagesize: 4" |
186 |
+ einfo "ptree_pagesize: 1" |
187 |
+ fi; |
188 |
+} |