# Copyright 1999-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 USE_PHP="php8-2 php8-3 php8-4 php8-5" PHP_EXT_NAME="auth_nds" PHP_EXT_OPTIONAL_USE="php" inherit flag-o-matic pam php-ext-source-r3 DESCRIPTION="Provides access to Netware services using the NCP protocol" HOMEPAGE="https://ftp.disconnected-by-peer.at/ncpfs/" # Temporary development release tarball. SRC_URI="https://gitea.disconnected-by-peer.at/mars_nwe/ncpfs/releases/download/v${PV}/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~mips ~ppc ~ppc64 ~x86" IUSE="nls pam php" DEPEND=" nls? ( sys-devel/gettext ) pam? ( sys-libs/pam ) " RDEPEND=" ${DEPEND} net-fs/ncpfs-modules net-misc/ipx-utils " src_prepare() { default # Bug #273484. sed -i '/ldconfig/d' lib/Makefile.in || die # Old codebase; still needed for some remaining legacy declarations. append-cflags -fcommon -Wincompatible-pointer-types if use php; then local slot for slot in $(php_get_slots); do local php_build_dir="${WORKDIR}/${slot}" rm -rf "${php_build_dir}" || die cp -a "${S}/contrib/php" "${php_build_dir}" || die php_init_slot_env "${slot}" php-ext-source-r3_phpize done fi } src_configure() { econf \ --prefix="${EPREFIX}/usr" \ $(use_enable nls) \ $(use_enable pam pam "$(getpam_mod_dir)") \ --disable-php \ --disable-ipx-tools \ --enable-ipx if use php; then mkdir -p "${WORKDIR}/include" || die cp "${S}/include/config.h" "${WORKDIR}/include/config.h" || die php-ext-source-r3_src_configure fi } src_compile() { emake if use php; then php-ext-source-r3_src_compile fi } src_install() { cd "${S}" || die dodir "$(getpam_mod_dir)" /usr/sbin emake DESTDIR="${D}" install emake DESTDIR="${D}" install-dev if use php; then ( php-ext-source-r3_src_install ) fi dodoc "${S}"/FAQ "${S}"/README } pkg_postinst() { if use php; then elog "The bundled PHP extension auth_nds was built and installed." elog "It was built for the enabled PHP_TARGETS slots." elog "Make sure your active PHP slot loads the matching extension directory." fi }