[Bug 225924] [NEW PORT] dns/kadnode: P2P DNS resolver

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu May 10 15:30:24 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225924

Tobias Kortkamp <tobik at freebsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tobik at freebsd.org

--- Comment #1 from Tobias Kortkamp <tobik at freebsd.org> ---
Hi,

thanks for your submission. Unfortunately it's not in a committable
state right now.  Some comments below.

In general the order of variables is wrong. Please see [1] for how to
order them.

XPORTNAME=      kadnode
XPORTVERSION=   2.2.0
XPORTREVISION=  1

We start port revisions at zero, so either remove PORTREVISION or set it
to 0.

XCATEGORIES=    dns
XDISTDIR=       ${PWD}

This doesn't make sense. Please do not set DISTDIR. It's not a variable
that ports should overwrite. The ports tree could be mounted read-only
and then the build would fail. It's always mounted read-only in
Poudriere jails which is what we use to build the packages on pkg.FreeBSD.org.

XMAINTAINER=    moritzwarning at web.de
XCOMMENT=       P2P name resolution daemon
XLICENSE=       MIT

Add LICENSE_FILE if there is one in the tarball.

XUSES=          gmake

XWRKSRC=                ${WRKDIR}/KadNode-${PORTVERSION}
XMASTER_SITES=   https://github.com/mwarning/KadNode/archive/
XDISTNAME=      v${PORTVERSION}

Please look into USE_GITHUB in the porter's handbook.

XCATEGORIES=    dns

Already set above.

XOPTIONS_DEFINE=        AUTH CMD DEBUG DNS LPD NATPMP NSS UPNP
XAUTH_DESC=     Authorization support based on mbedtls.
XCMD_DESC=      Command line control tool kadnode-ctl.
XDEBUG_DESC=    Build with debug messages and symbols.

DEBUG already has a description in bsd.options.desc.mk so please remove
this one.

XDNS_DESC=      Include local DNS interface.
XLPD_DESC=      Local peer discovery.
XNATPMP_DESC=   NAT-PMP support. Enables remote port forwarding on the router.
XNSS_DESC=      Name Service Switch support to intercept host queries
(/etc/nsswitch.conf).
XUPNP_DESC=     UPnP support. Enable remote port forwarding on the router.
X
XOPTIONS_DEFAULT=       AUTH CMD LPD NSS
X
X.include <bsd.port.options.mk>
X
X.if ${PORT_OPTIONS:MAUTH}
XFEATURES+=bob tls
XDEPENDS+=      ${PORTSDIR}/security/mbedtls
X.endif

Please look into options helpers. Also I'm not sure what DEPENDS does?

X
X.if ${PORT_OPTIONS:MCMD}
XFEATURES+=cmd
X.endif
X
X.if ${PORT_OPTIONS:MDEBUG}
XFEATURES+=debug
X.endif
X
X.if ${PORT_OPTIONS:MDNS}
XFEATURES+=dns
X.endif
X
X.if ${PORT_OPTIONS:MLPD}
XFEATURES+=lpd
X.endif
X
X.if ${PORT_OPTIONS:MNATPMP}
XFEATURES+=natpmp
XLIB_DEPENDS+=  libnatpmp.so:${PORTSDIR}/net/libnatpmp
X.endif

Please remove the ${PORTSDIR}/ prefix from dependency specs. It hasn't
been required in a long time now.

If you set DEVELOPER=yes in /etc/make.conf during port development then
you'll get warnings about things like this.

X
X.if ${PORT_OPTIONS:MNSS}
XFEATURES+=nss
X.endif
X
X.if ${PORT_OPTIONS:MUPNP}
XFEATURES+=upnp
XLIB_DEPENDS+=  libminiupnpc.so:${PORTSDIR}/net/miniupnpc
X.endif
X
XMAKE_ENV+=     FEATURES="${FEATURES}"
X
Xdo-install:
X       ${MKDIR} ${STAGEDIR}/usr/bin
X       ${INSTALL_PROGRAM} ${WRKSRC}/build/kadnode ${STAGEDIR}${PREFIX}/bin/
X       ${LN} -sf kadnode ${STAGEDIR}${PREFIX}/bin/kadnode-ctl
X
X       ${INSTALL_LIB} ${WRKSRC}/build/libnss_kadnode.so.2
${STAGEDIR}${PREFIX}/lib/nss_kadnode.so
X       ${LN} -sf ${STAGEDIR}${PREFIX}/lib/nss_kadnode.so
${STAGEDIR}${PREFIX}/lib/nss_kadnode.so.1

Use ${RLN} instead. This points into the non-existing STAGEDIR (after
make clean) otherwise.

X
X       ${MKDIR} ${STAGEDIR}/etc/kadnode
X       ${INSTALL_DATA} ${WRKSRC}/misc/peers.txt ${STAGEDIR}/etc/kadnode/
X       ${INSTALL_DATA} ${WRKSRC}/misc/kadnode.conf ${STAGEDIR}/etc/kadnode/

The config files need to go into ${STAGEDIR}${ETCDIR}. Putting files
into /etc from the base system is off-limits for ports.

X       ${MKDIR} ${STAGEDIR}/etc/rc.d/
X       ${INSTALL_SCRIPT} ${WRKSRC}/freebsd/files/kadnode.init
${STAGEDIR}/etc/rc.d/kadnode

rc.d scripts needs to go into ${STAGEDIR}${PREFIX}/etc/rc.d.  Look into
USE_RC_SUBR for this.

echo x - kadnode/pkg-descr
sed 's/^X//' >kadnode/pkg-descr << '3923b8a530675a9c5ca9607acba3d1c2'
XKadNode is a small decentralized DNS resolver that can use existing public key
infrastructures.
XIt utilizes the BitTorrent P2P network and mbedtls for TLS/crypto support.
X
XWWW: https://github.com/mwarning/KadNode

Please wrap this to 72 columns.

3923b8a530675a9c5ca9607acba3d1c2
echo x - kadnode/pkg-plist
sed 's/^X//' >kadnode/pkg-plist << 'ee61f23e7c6fbbf7d4eed6f11c8b046c'
Xbin/kadnode
Xbin/kadnode-ctl
Xlib/nss_kadnode.so
Xlib/nss_kadnode.so.1
Xman/man1/kadnode.1.gz
X/etc/rc.d/kadnode
X/etc/kadnode/kadnode.conf
X/etc/kadnode/peers.txt
X at dir /etc/kadnode
ee61f23e7c6fbbf7d4eed6f11c8b046c
echo c - kadnode/files
mkdir -p kadnode/files > /dev/null 2>&1
echo x - kadnode/files/kadnode.init
sed 's/^X//' >kadnode/files/kadnode.init << '0ee9ae9bd1c603ce26dc9c2f7241d306'
X#!/bin/sh
X
X# PROVIDE: kadnode
X# REQUIRE: SERVERS
X# BEFORE: DAEMON
X# KEYWORD: shutdown
X
X. /etc/rc.subr
X
Xname=kadnode
Xrcvar=kadnode_enable
X
Xpidfile="/var/run/${name}.pid"
X
Xcommand="/usr/local/bin/${name}"
Xkadnode_flags="--config /etc/kadnode/kadnode.conf --pidfile $pidfile --daemon"
X
Xrequired_files="/etc/kadnode/${name}.conf"
X
X#add/remove kadnode from /etc/nsswitch.conf
Xstart_precmd="kadnode_precmd"
Xstop_postcmd="kadnode_postcmd"
X
Xkadnode_precmd() {
X       sed -i -e '/kadnode/!s/^\(hosts:.*\)dns\(.*\)/\1kadnode dns\2/'
/etc/nsswitch.conf
X}
X
Xkadnode_postcmd() {
X       sed -i -e 's/^\(hosts:.*\)kadnode \(.*\)/\1\2/' /etc/nsswitch.conf
X}

This is not good. rc.d scripts should not modify system files. Leave it
for the user to setup. Maybe write a pkg-message to explain how.

[1] https://www.freebsd.org/doc/en/books/porters-handbook/porting-order.html

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list