sys-libs/ncurses: move to SLOT=0 #557472
[gentoo.git] / app-crypt / heimdal / heimdal-1.5.3-r2.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6 PYTHON_COMPAT=( python{2_7,3_3,3_4} )
7 VIRTUALX_REQUIRED="manual"
8
9 inherit autotools db-use eutils multilib multilib-minimal python-any-r1 toolchain-funcs virtualx flag-o-matic
10
11 MY_P="${P}"
12 DESCRIPTION="Kerberos 5 implementation from KTH"
13 HOMEPAGE="http://www.h5l.org/"
14 SRC_URI="http://www.h5l.org/dist/src/${MY_P}.tar.gz"
15
16 LICENSE="BSD"
17 SLOT="0"
18 KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd"
19 IUSE="afs +berkdb caps hdb-ldap ipv6 otp +pkinit selinux ssl static-libs threads test X"
20
21 CDEPEND="ssl? ( >=dev-libs/openssl-1.0.1h-r2[${MULTILIB_USEDEP}] )
22         berkdb? ( >=sys-libs/db-4.8.30-r1[${MULTILIB_USEDEP}] )
23         !berkdb? ( >=sys-libs/gdbm-1.10-r1[${MULTILIB_USEDEP}] )
24         caps? ( sys-libs/libcap-ng )
25         >=dev-db/sqlite-3.8.2[${MULTILIB_USEDEP}]
26         >=sys-libs/e2fsprogs-libs-1.42.9[${MULTILIB_USEDEP}]
27         sys-libs/ncurses:0=
28         >=sys-libs/readline-6.2_p5-r1[${MULTILIB_USEDEP}]
29         afs? ( net-fs/openafs )
30         hdb-ldap? ( >=net-nds/openldap-2.3.0 )
31         X? ( x11-libs/libX11
32                 x11-libs/libXau
33                 x11-libs/libXt )
34         abi_x86_32? (
35                 !<=app-emulation/emul-linux-x86-baselibs-20140508-r1
36                 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
37         )
38         !!app-crypt/mit-krb5
39         !!app-crypt/mit-krb5-appl"
40
41 DEPEND="${CDEPEND}
42         ${PYTHON_DEPS}
43         >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
44         >=sys-devel/autoconf-2.62
45         test? ( X? ( ${VIRTUALX_DEPEND} ) )"
46
47 RDEPEND="${CDEPEND}
48         selinux? ( sec-policy/selinux-kerberos )"
49
50 MULTILIB_WRAPPED_HEADERS=(
51         /usr/include/krb5-types.h
52         /usr/include/cms_asn1.h
53         /usr/include/digest_asn1.h
54         /usr/include/hdb_asn1.h
55         /usr/include/krb5_asn1.h
56         /usr/include/pkcs12_asn1.h
57         /usr/include/pkinit_asn1.h
58         /usr/include/rfc2459_asn1.h
59 )
60
61 MULTILIB_CHOST_TOOLS=(
62         /usr/bin/krb5-config
63 )
64
65 src_prepare() {
66         epatch "${FILESDIR}/heimdal_missing-include.patch"
67         epatch "${FILESDIR}/heimdal_db6.patch"
68         epatch "${FILESDIR}/heimdal_disable-check-iprop.patch"
69         epatch "${FILESDIR}/heimdal_link_order.patch"
70         epatch "${FILESDIR}/heimdal_missing_symbols.patch"
71         epatch "${FILESDIR}/heimdal_texinfo-5.patch"
72         epatch "${FILESDIR}/heimdal_tinfo.patch"
73         eautoreconf
74 }
75
76 src_configure() {
77         # QA
78         append-flags -fno-strict-aliasing
79
80         multilib-minimal_src_configure
81 }
82
83 multilib_src_configure() {
84         local myconf=()
85         if use berkdb; then
86                 myconf+=(
87                         --with-berkeley-db
88                         --with-berkeley-db-include="$(db_includedir)"
89                 )
90         else
91                 myconf+=(
92                         --without-berkeley-db
93                 )
94         fi
95
96         ECONF_SOURCE=${S} \
97         econf \
98                 --enable-kcm \
99                 --disable-osfc2 \
100                 --enable-shared \
101                 --with-libintl=/usr \
102                 --with-readline=/usr \
103                 --with-sqlite3=/usr \
104                 --libexecdir=/usr/sbin \
105                 $(use_enable afs afs-support) \
106                 $(use_enable otp) \
107                 $(use_enable pkinit kx509) \
108                 $(use_enable pkinit pk-init) \
109                 $(use_enable static-libs static) \
110                 $(use_enable threads pthread-support) \
111                 $(multilib_native_use_with caps capng) \
112                 $(multilib_native_use_with hdb-ldap openldap /usr) \
113                 $(use_with ipv6) \
114                 $(use_with ssl openssl /usr) \
115                 $(multilib_native_use_with X x) \
116                 "${myconf[@]}"
117 }
118
119 multilib_src_compile() {
120         if multilib_is_native_abi; then
121                 emake -j1
122         else
123                 emake -C include -j1
124                 emake -C base -j1
125                 emake -C lib -j1
126                 emake -C kdc -j1
127                 emake -C tools -j1
128                 emake -C tests/plugin -j1
129         fi
130 }
131
132 multilib_src_test() {
133         multilib_is_native_abi && emake check
134 }
135
136 multilib_src_install() {
137         if multilib_is_native_abi; then
138                 INSTALL_CATPAGES="no" emake DESTDIR="${D}" install
139         else
140                 emake -C include DESTDIR="${D}" install
141                 emake -C base DESTDIR="${D}" install
142                 emake -C lib DESTDIR="${D}" install
143                 emake -C kdc DESTDIR="${D}" install
144                 emake -C tools DESTDIR="${D}" install
145                 emake -C tests/plugin DESTDIR="${D}" install
146         fi
147 }
148
149 multilib_src_install_all() {
150         dodoc ChangeLog README NEWS TODO
151
152         # Begin client rename and install
153         for i in {telnetd,ftpd,rshd,popper}
154         do
155                 mv "${D}"/usr/share/man/man8/{,k}${i}.8
156                 mv "${D}"/usr/sbin/{,k}${i}
157         done
158
159         for i in {rcp,rsh,telnet,ftp,su,login,pagsh,kf}
160         do
161                 mv "${D}"/usr/share/man/man1/{,k}${i}.1
162                 mv "${D}"/usr/bin/{,k}${i}
163         done
164
165         mv "${D}"/usr/share/man/man5/{,k}ftpusers.5
166         mv "${D}"/usr/share/man/man5/{,k}login.access.5
167
168         newinitd "${FILESDIR}"/heimdal-kdc.initd-r2 heimdal-kdc
169         newinitd "${FILESDIR}"/heimdal-kadmind.initd-r2 heimdal-kadmind
170         newinitd "${FILESDIR}"/heimdal-kpasswdd.initd-r2 heimdal-kpasswdd
171         newinitd "${FILESDIR}"/heimdal-kcm.initd-r1 heimdal-kcm
172
173         newconfd "${FILESDIR}"/heimdal-kdc.confd heimdal-kdc
174         newconfd "${FILESDIR}"/heimdal-kadmind.confd heimdal-kadmind
175         newconfd "${FILESDIR}"/heimdal-kpasswdd.confd heimdal-kpasswdd
176         newconfd "${FILESDIR}"/heimdal-kcm.confd heimdal-kcm
177
178         insinto /etc
179         newins "${FILESDIR}"/krb5.conf krb5.conf.example
180
181         if use hdb-ldap; then
182                 insinto /etc/openldap/schema
183                 doins "${S}/lib/hdb/hdb.schema"
184         fi
185
186         prune_libtool_files
187
188         # default database dir
189         keepdir /var/heimdal
190
191         # Ugly hack for broken symlink - bug #417081
192         rm "${D}"/usr/share/man/man5/qop.5 || die
193         dosym mech.5 /usr/share/man/man5/qop.5
194 }