From owner-svn-ports-all@freebsd.org Fri Sep 4 10:53:03 2020 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C4AC83DD86C; Fri, 4 Sep 2020 10:53:03 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BjZJv4rPGz3b4M; Fri, 4 Sep 2020 10:53:03 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AAEFB99A; Fri, 4 Sep 2020 10:53:03 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 084Ar3Ym023391; Fri, 4 Sep 2020 10:53:03 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 084Ar2Q6023386; Fri, 4 Sep 2020 10:53:02 GMT (envelope-from se@FreeBSD.org) Message-Id: <202009041053.084Ar2Q6023386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Fri, 4 Sep 2020 10:53:02 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r547529 - in head/net/relayd: . files X-SVN-Group: ports-head X-SVN-Commit-Author: se X-SVN-Commit-Paths: in head/net/relayd: . files X-SVN-Commit-Revision: 547529 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Sep 2020 10:53:03 -0000 Author: se Date: Fri Sep 4 10:53:01 2020 New Revision: 547529 URL: https://svnweb.freebsd.org/changeset/ports/547529 Log: Fix build with -no-common While here make the substitution of %%PREFIX%% operational (again?). It has probably been lost due to make makepatch generating patch files after the substitution by the actual prefix has been performed in the post-patch target. To prevent this issue in the future, the substitution of %%PREFIX%% by the actual prefix is moved in to the post-configure phase, since the configure command does not rely on the substitution having been performed. Added: head/net/relayd/files/patch-relayd_parse.y (contents, props changed) head/net/relayd/files/patch-relayd_relay.c (contents, props changed) head/net/relayd/files/patch-relayd_relayd.8 (contents, props changed) head/net/relayd/files/patch-relayd_relayd.conf.5 (contents, props changed) head/net/relayd/files/patch-relayd_relayd.h (contents, props changed) Modified: head/net/relayd/Makefile Modified: head/net/relayd/Makefile ============================================================================== --- head/net/relayd/Makefile Fri Sep 4 10:51:08 2020 (r547528) +++ head/net/relayd/Makefile Fri Sep 4 10:53:01 2020 (r547529) @@ -2,7 +2,7 @@ PORTNAME= relayd PORTVERSION= 5.5.20140810 -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= net MAINTAINER= koue@chaosophia.net @@ -25,13 +25,6 @@ MAKE_ARGS+= BINDIR=${PREFIX}/sbin \ USERS= _relayd GROUPS= _relayd -post-patch: - @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' \ - ${WRKSRC}/relayd/relay.c \ - ${WRKSRC}/relayd/relayd.h \ - ${WRKSRC}/relayd/relayd.conf.5 \ - ${WRKSRC}/relayd/relayd.8 - post-install: @${INSTALL_DATA} ${WRKSRC}/../etc/relayd.conf \ ${STAGEDIR}${PREFIX}/etc/relayd.conf.sample @@ -48,6 +41,11 @@ BUILD_DEPENDS+= ${NONEXISTENT}:security/libressl:stage CFLAGS+= -I${STAGEDIR_libressl}${LOCALBASE}/include post-configure: + ${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' \ + ${WRKSRC}/relayd/relay.c \ + ${WRKSRC}/relayd/relayd.h \ + ${WRKSRC}/relayd/relayd.conf.5 \ + ${WRKSRC}/relayd/relayd.8 ${REINPLACE_CMD} 's|-lssl|${STAGEDIR_libressl}${LOCALBASE}/lib/libssl.a|g' \ ${WRKSRC}/relayd/Makefile ${REINPLACE_CMD} 's|-lcrypto|${STAGEDIR_libressl}${LOCALBASE}/lib/libcrypto.a|g' \ Added: head/net/relayd/files/patch-relayd_parse.y ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/relayd/files/patch-relayd_parse.y Fri Sep 4 10:53:01 2020 (r547529) @@ -0,0 +1,11 @@ +--- relayd/parse.y.orig 2014-08-10 20:08:47 UTC ++++ relayd/parse.y +@@ -55,6 +55,8 @@ + + #include + ++#define IN_MAIN ++ + #include "relayd.h" + #include "http.h" + // FreeBSD #include "snmp.h" Added: head/net/relayd/files/patch-relayd_relay.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/relayd/files/patch-relayd_relay.c Fri Sep 4 10:53:01 2020 (r547529) @@ -0,0 +1,31 @@ +--- relayd/relay.c.orig 2014-08-10 20:08:47 UTC ++++ relayd/relay.c +@@ -2716,12 +2716,12 @@ relay_load_certfiles(struct relay *rlay) + return (-1); + + if (snprintf(certfile, sizeof(certfile), +- "/usr/local/etc/ssl/%s:%u.crt", hbuf, useport) == -1) ++ "%%PREFIX%%/etc/ssl/%s:%u.crt", hbuf, useport) == -1) + return (-1); + if ((rlay->rl_ssl_cert = relay_load_file(certfile, + &rlay->rl_conf.ssl_cert_len)) == NULL) { + if (snprintf(certfile, sizeof(certfile), +- "/usr/local/etc/ssl/%s.crt", hbuf) == -1) ++ "%%PREFIX%%/etc/ssl/%s.crt", hbuf) == -1) + return (-1); + if ((rlay->rl_ssl_cert = relay_load_file(certfile, + &rlay->rl_conf.ssl_cert_len)) == NULL) +@@ -2732,11 +2732,11 @@ relay_load_certfiles(struct relay *rlay) + + if (useport) { + if (snprintf(certfile, sizeof(certfile), +- "/usr/local/etc/ssl/private/%s:%u.key", hbuf, useport) == -1) ++ "%%PREFIX%%/etc/ssl/private/%s:%u.key", hbuf, useport) == -1) + return -1; + } else { + if (snprintf(certfile, sizeof(certfile), +- "/usr/local/etc/ssl/private/%s.key", hbuf) == -1) ++ "%%PREFIX%%/etc/ssl/private/%s.key", hbuf) == -1) + return -1; + } + if ((rlay->rl_ssl_key = ssl_load_key(env, certfile, Added: head/net/relayd/files/patch-relayd_relayd.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/relayd/files/patch-relayd_relayd.8 Fri Sep 4 10:53:01 2020 (r547529) @@ -0,0 +1,20 @@ +--- relayd/relayd.8.orig 2014-08-10 20:08:47 UTC ++++ relayd/relayd.8 +@@ -114,7 +114,7 @@ will run in the foreground and log to + .It Fl f Ar file + Specify an alternative configuration file. + The default is +-.Pa /usr/local/etc/relayd.conf . ++.Pa %%PREFIX%%/etc/relayd.conf . + .It Fl n + Configtest mode. + Only check the configuration file for validity. +@@ -123,7 +123,7 @@ Produce more verbose output. + .El + .Sh FILES + .Bl -tag -width "/var/run/relayd.sockXX" -compact +-.It /usr/local/etc/relayd.conf ++.It %%PREFIX%%/etc/relayd.conf + Default configuration file. + .It /var/run/relayd.sock + .Ux Ns -domain Added: head/net/relayd/files/patch-relayd_relayd.conf.5 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/relayd/files/patch-relayd_relayd.conf.5 Fri Sep 4 10:53:01 2020 (r547529) @@ -0,0 +1,88 @@ +--- relayd/relayd.conf.5.orig 2014-08-10 20:08:47 UTC ++++ relayd/relayd.conf.5 +@@ -90,7 +90,7 @@ Additional configuration files can be included with th + .Ic include + keyword, for example: + .Bd -literal -offset indent +-include "/usr/local/etc/relayd.conf.local" ++include "%%PREFIX%%/etc/relayd.conf.local" + .Ed + .Sh MACROS + Macros can be defined that will later be expanded in context. +@@ -304,7 +304,7 @@ Execute an external program to check the host state. + The program will be executed for each host by specifying the hostname + on the command line: + .Bd -literal -offset indent +-/usr/local/bin/checkload.pl front-www1.private.example.com ++%%PREFIX%%/bin/checkload.pl front-www1.private.example.com + .Ed + .Pp + .Xr relayd 8 +@@ -624,18 +624,18 @@ If the + keyword is present, the relay will accept connections using the + encrypted SSL protocol. + The relay will attempt to look up a private key in +-.Pa /usr/local/etc/ssl/private/address:port.key ++.Pa %%PREFIX%%/etc/ssl/private/address:port.key + and a public certificate in +-.Pa /usr/local/etc/ssl/address:port.crt , ++.Pa %%PREFIX%%/etc/ssl/address:port.crt , + where + .Ar address + is the specified IP address and + .Ar port + is the specified port that the relay listens on. + If these files are not present, the relay will continue to look in +-.Pa /usr/local/etc/ssl/private/address.key ++.Pa %%PREFIX%%/etc/ssl/private/address.key + and +-.Pa /usr/local/etc/ssl/address.crt . ++.Pa %%PREFIX%%/etc/ssl/address.crt . + See + .Xr ssl 8 + for details about SSL server certificates. +@@ -1256,18 +1256,18 @@ as detailed for the + directive above. + .El + .Sh FILES +-.Bl -tag -width "/usr/local/etc/ssl/private/address.keyXX" -compact +-.It Pa /usr/local/etc/relayd.conf ++.Bl -tag -width "%%PREFIX%%/etc/ssl/private/address.keyXX" -compact ++.It Pa %%PREFIX%%/etc/relayd.conf + .Xr relayd 8 + configuration file. + .Pp + .It Pa /etc/services + Service name database. + .Pp +-.It Pa /usr/local/etc/ssl/address.crt +-.It Pa /usr/local/etc/ssl/address:port.crt +-.It Pa /usr/local/etc/ssl/private/address.key +-.It Pa /usr/local/etc/ssl/private/address:port.key ++.It Pa %%PREFIX%%/etc/ssl/address.crt ++.It Pa %%PREFIX%%/etc/ssl/address:port.crt ++.It Pa %%PREFIX%%/etc/ssl/private/address.key ++.It Pa %%PREFIX%%/etc/ssl/private/address:port.key + Location of the relay SSL server certificates, where + .Ar address + is the configured IP address +@@ -1275,7 +1275,7 @@ and + .Ar port + is the configured port number of the relay. + .Pp +-.It Pa /usr/local/etc/ssl/cert.pem ++.It Pa %%PREFIX%%/etc/ssl/cert.pem + Default location of the CA bundle that can be used with + .Xr relayd 8 . + .El +@@ -1383,8 +1383,8 @@ section. + To start, first generate a new local CA key and certificate: + .Bd -literal -offset indent + # openssl req -x509 -days 365 -newkey rsa:2048 \e +- -keyout /usr/local/etc/ssl/private/ca.key \e +- -out /usr/local/etc/etc/ssl/ca.crt ++ -keyout %%PREFIX%%/etc/ssl/private/ca.key \e ++ -out %%PREFIX%%/etc/etc/ssl/ca.crt + .Ed + .Pp + An SSL server key and self-signed cert for 127.0.0.1 are also required; Added: head/net/relayd/files/patch-relayd_relayd.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/relayd/files/patch-relayd_relayd.h Fri Sep 4 10:53:01 2020 (r547529) @@ -0,0 +1,51 @@ +--- relayd/relayd.h.orig 2014-08-10 20:08:47 UTC ++++ relayd/relayd.h +@@ -21,6 +21,12 @@ + #ifndef _RELAYD_H + #define _RELAYD_H + ++#ifdef IN_MAIN ++#define EXTERN ++#else ++#define EXTERN extern ++#endif ++ + #include + + #include /* MAXHOSTNAMELEN */ +@@ -34,7 +40,7 @@ + #include + + #ifdef __FreeBSD__ +-#define CONF_FILE "/usr/local/etc/relayd.conf" ++#define CONF_FILE "%%PREFIX%%/etc/relayd.conf" + #else + #define CONF_FILE "/etc/relayd.conf" + #endif +@@ -867,11 +873,13 @@ struct control_sock { + }; + TAILQ_HEAD(control_socks, control_sock); + +-struct { ++struct control_state { + struct event ev; + int fd; +-} control_state; ++}; + ++EXTERN struct control_state control_state; ++ + enum blockmodes { + BM_NORMAL, + BM_NONBLOCK +@@ -978,7 +986,9 @@ enum privsep_procid { + PROC_PFE, + PROC_CA, + PROC_MAX +-} privsep_process; ++}; ++ ++EXTERN enum privsep_procid privsep_process; + + /* Attach the control socket to the following process */ + #define PROC_CONTROL PROC_PFE