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