8a9ab45b876807e7bb89631501c0d9672e084762
[gentoo.git] / sys-auth / libnss-pgsql / libnss-pgsql-1.4.0.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=0
5
6 inherit autotools eutils multilib
7
8 KEYWORDS="~x86"
9
10 DESCRIPTION="Name Service Switch module for use with PostgreSQL"
11 HOMEPAGE="http://pgfoundry.org/projects/sysauth/"
12 SRC_URI="http://pgfoundry.org/frs/download.php/605/${P}.tgz"
13 LICENSE="GPL-2"
14 SLOT="0"
15 IUSE=""
16
17 DEPEND="dev-db/postgresql
18                 app-text/xmlto"
19 RDEPEND="${DEPEND}"
20
21 src_unpack() {
22         unpack ${A}
23         cd "${S}"
24         epatch "${FILESDIR}/${P}-gentoo.patch"
25         epatch "${FILESDIR}/${P}-schema.patch"
26         eautoreconf
27 }
28
29 src_compile() {
30         econf \
31                 --libdir=/lib \
32                 --with-docdir=/usr/share/doc/${PF}/html || die "econf failed"
33         emake || die "emake failed"
34 }
35
36 src_install() {
37         insinto /$(get_libdir)
38         doins src/.libs/libnss_pgsql.so.2.0.0
39         dosym libnss_pgsql.so.2.0.0 /lib/libnss_pgsql.so.2
40         dosym libnss_pgsql.so.2.0.0 /lib/libnss_pgsql.so
41
42         dodoc AUTHORS ChangeLog NEWS README
43         dohtml doc/*.{png,html}
44         insinto /usr/share/doc/${PF}/examples
45         doins conf/*
46 }
47
48 pkg_postinst() {
49         elog "Next steps:"
50         elog "1. Create the required tables in the database:"
51         elog "   $ psql a_database -f ${ROOT}usr/share/${PN}/conf/dbschema.sql"
52         elog "2. Create the configuration file '/etc/nss-pgsql.conf'"
53         elog "   You can copy the example from ${ROOT}usr/share/doc/${PF}/examples/nss-pgsql.conf"
54         elog "3. Edit /etc/nsswitch.conf to use the NSS service 'pgsql'"
55         elog "   An example is available here: ${ROOT}usr/share/doc/${PF}/examples/nsswitch.conf"
56 }