Bug 181493 - [PATCH] www/nostromo: Fix build with clang plust other fixes
Summary: [PATCH] www/nostromo: Fix build with clang plust other fixes
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Guido Falsi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-24 00:20 UTC by Guido Falsi
Modified: 2013-09-15 10:30 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (3.32 KB, patch)
2013-08-24 00:20 UTC, Guido Falsi
no flags Details | Diff
file.diff (1.20 KB, patch)
2013-08-24 00:20 UTC, Guido Falsi
no flags Details | Diff
patch-src-libmy-strb64d (468 bytes, text/plain; charset=us-ascii)
2013-09-11 16:20 UTC, ast
no flags Details
patch-src-nhttpd-main (350 bytes, text/plain; charset=us-ascii)
2013-09-11 16:20 UTC, ast
no flags Details
patch-src-http_path-http (487 bytes, text/plain; charset=us-ascii)
2013-09-15 10:14 UTC, ast
no flags Details
patch-src-http_path-main (707 bytes, text/plain; charset=us-ascii)
2013-09-15 10:14 UTC, ast
no flags Details
patch-src-libmy-strb64d (521 bytes, text/plain; charset=us-ascii)
2013-09-15 10:14 UTC, ast
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Guido Falsi freebsd_committer 2013-08-24 00:20:00 UTC
- Fix build with clang
- Handle configuration file correctly
- Make installation directory relative to PREFIX, so it can be adjusted dynamically in the plist
- Trim Makefile headers

Fix: Property changes on: files/patch-src-libmy-strb64d.c
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Comment 1 Edwin Groothuis freebsd_committer 2013-08-24 00:20:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->miwi

miwi@ wants this submitter's PRs (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer 2013-08-24 00:20:09 UTC
Maintainer of www/nostromo,

Please note that PR ports/181493 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/181493

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Edwin Groothuis freebsd_committer 2013-08-24 00:20:10 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 4 Guido Falsi freebsd_committer 2013-09-02 22:31:41 UTC
Responsible Changed
From-To: miwi->madpilot

I'll take it.
Comment 5 dfilter service freebsd_committer 2013-09-10 21:28:38 UTC
Author: madpilot
Date: Tue Sep 10 20:28:30 2013
New Revision: 326930
URL: http://svnweb.freebsd.org/changeset/ports/326930

Log:
  - Fix build with clang
  - Handle configuration file correctly
  - Make installation directory relative to PREFIX, so it can be
    adjusted dynamically in the plist
  - Trim Makefile headers
  
  PR:		ports/181493
  Submitted by:	Me
  Approved by:	Maintainer timeout

Added:
  head/www/nostromo/files/patch-src-libmy-strb64d.c   (contents, props changed)
Modified:
  head/www/nostromo/Makefile   (contents, props changed)
  head/www/nostromo/pkg-plist   (contents, props changed)

Modified: head/www/nostromo/Makefile
==============================================================================
--- head/www/nostromo/Makefile	Tue Sep 10 20:17:11 2013	(r326929)
+++ head/www/nostromo/Makefile	Tue Sep 10 20:28:30 2013	(r326930)
@@ -1,12 +1,9 @@
-# New ports collection makefile for:	nostromo
-# Date created:		20 Mar 2011
-# Whom:			Adrian Steinmann <ast@marabu.ch>
-#
+# Created by: Adrian Steinmann <ast@marabu.ch>
 # $FreeBSD$
-#
 
 PORTNAME=	nostromo
 PORTVERSION=	1.9.5
+PORTREVISION=	1
 CATEGORIES=	www ipv6
 MASTER_SITES=	http://www.nazgul.ch/dev/
 
@@ -15,7 +12,7 @@ COMMENT=	A fast, secure HTTP/1.1 CGI/1.1
 
 LICENSE=	BSD
 
-NOSTROMO_DIR?=		${PREFIX}/nostromo
+NOSTROMO_DIR?=		nostromo
 NOSTROMO_LOGDIR?=	${NOSTROMO_DIR}/logs
 NOSTROMO_LOGDIR_PERMS?=	0775
 
@@ -24,6 +21,7 @@ USE_RC_SUBR=	nostromo
 MAN8=		nhttpd.8
 
 MAKE_ENV?=	MAKEOBJDIR=. PREFIX=${PREFIX} NOSTROMO_DIR=${NOSTROMO_DIR}
+PLIST_SUB+=	NOSTROMODIR="${NOSTROMO_DIR}" NOSTROMOLOGDIR="${NOSTROMO_LOGDIR}"
 
 post-extract:
 	@${REINPLACE_CMD} -e "s@/var/nostromo@${NOSTROMO_DIR}@g" \
@@ -37,19 +35,22 @@ do-install:
 	@${INSTALL_SCRIPT} ${WRKSRC}/src/nhttpd/nhttpd ${PREFIX}/sbin
 	@${INSTALL_SCRIPT} ${WRKSRC}/src/tools/crypt ${PREFIX}/sbin
 	@${INSTALL_MAN} ${WRKSRC}/src/nhttpd/nhttpd.8 ${PREFIX}/man/man8
-	@${MKDIR} ${NOSTROMO_DIR}
-	@${MKDIR} ${NOSTROMO_DIR}/conf
-	@${MKDIR} -m ${NOSTROMO_LOGDIR_PERMS} -p ${NOSTROMO_LOGDIR}
-	@${INSTALL_DATA} ${WRKSRC}/conf/mimes ${NOSTROMO_DIR}/conf
-	@${INSTALL_DATA} ${WRKSRC}/conf/nhttpd.conf-dist ${NOSTROMO_DIR}/conf
-	@${MKDIR} ${NOSTROMO_DIR}/htdocs
-	@${INSTALL_DATA} ${WRKSRC}/htdocs/index.html ${NOSTROMO_DIR}/htdocs
-	@${INSTALL_DATA} ${WRKSRC}/htdocs/nostromo.gif ${NOSTROMO_DIR}/htdocs
-	@${MKDIR} ${NOSTROMO_DIR}/htdocs/cgi-bin
+	@${MKDIR} ${PREFIX}/${NOSTROMO_DIR}
+	@${MKDIR} ${PREFIX}/${NOSTROMO_DIR}/conf
+	@${MKDIR} -m ${NOSTROMO_LOGDIR_PERMS} -p ${PREFIX}/${NOSTROMO_LOGDIR}
+	@${INSTALL_DATA} ${WRKSRC}/conf/mimes ${PREFIX}/${NOSTROMO_DIR}/conf
+	@${INSTALL_DATA} ${WRKSRC}/conf/nhttpd.conf-dist ${PREFIX}/${NOSTROMO_DIR}/conf
+	if [ ! -f ${PREFIX}/${NOSTROMO_DIR}/conf/nhttpd.conf ]; then \
+		${CP} -p ${PREFIX}/${NOSTROMO_DIR}/conf/nhttpd.conf-dist ${PREFIX}/${NOSTROMO_DIR}/conf/nhttpd.conf ; \
+	fi
+	@${MKDIR} ${PREFIX}/${NOSTROMO_DIR}/htdocs
+	@${INSTALL_DATA} ${WRKSRC}/htdocs/index.html ${PREFIX}/${NOSTROMO_DIR}/htdocs
+	@${INSTALL_DATA} ${WRKSRC}/htdocs/nostromo.gif ${PREFIX}/${NOSTROMO_DIR}/htdocs
+	@${MKDIR} ${PREFIX}/${NOSTROMO_DIR}/htdocs/cgi-bin
 	@${INSTALL_SCRIPT} ${WRKSRC}/htdocs/cgi-bin/printenv \
-		${NOSTROMO_DIR}/htdocs/cgi-bin
-	@${MKDIR} ${NOSTROMO_DIR}/icons
-	@${INSTALL_DATA} ${WRKSRC}/icons/dir.gif ${NOSTROMO_DIR}/icons
-	@${INSTALL_DATA} ${WRKSRC}/icons/file.gif ${NOSTROMO_DIR}/icons
+		${PREFIX}/${NOSTROMO_DIR}/htdocs/cgi-bin
+	@${MKDIR} ${PREFIX}/${NOSTROMO_DIR}/icons
+	@${INSTALL_DATA} ${WRKSRC}/icons/dir.gif ${PREFIX}/${NOSTROMO_DIR}/icons
+	@${INSTALL_DATA} ${WRKSRC}/icons/file.gif ${PREFIX}/${NOSTROMO_DIR}/icons
 
 .include <bsd.port.mk>

Added: head/www/nostromo/files/patch-src-libmy-strb64d.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/nostromo/files/patch-src-libmy-strb64d.c	Tue Sep 10 20:28:30 2013	(r326930)
@@ -0,0 +1,11 @@
+--- src/libmy/strb64d.c.orig	2005-06-04 10:30:04.000000000 +0200
++++ src/libmy/strb64d.c	2013-08-23 19:17:25.700331962 +0200
+@@ -54,7 +54,7 @@
+ 	dst[0] = '\0';
+ 
+ 	while (1) {
+-		for (i = 0, j = j; i < 4; i++, j++) {
++		for (i = 0; i < 4; i++, j++) {
+ 			if (src[j] == '\0')
+ 				goto quit;
+ 			ch = src[j];

Modified: head/www/nostromo/pkg-plist
==============================================================================
--- head/www/nostromo/pkg-plist	Tue Sep 10 20:17:11 2013	(r326929)
+++ head/www/nostromo/pkg-plist	Tue Sep 10 20:28:30 2013	(r326930)
@@ -1,15 +1,17 @@
 sbin/crypt
 sbin/nhttpd
-nostromo/conf/mimes
-nostromo/conf/nhttpd.conf-dist
-nostromo/htdocs/index.html
-nostromo/htdocs/nostromo.gif
-nostromo/htdocs/cgi-bin/printenv
-nostromo/icons/dir.gif
-nostromo/icons/file.gif
-@dirrmtry nostromo/conf
-@dirrmtry nostromo/htdocs/cgi-bin
-@dirrmtry nostromo/htdocs
-@dirrmtry nostromo/icons
-@dirrmtry nostromo/logs
-@dirrmtry nostromo
+%%NOSTROMODIR%%/conf/mimes
+@unexec if cmp -s %D/%%NOSTROMODIR%%/conf/nhttpd.conf-dist %D/%%NOSTROMODIR%%/conf/nhttpd.conf; then rm -f %D/%%NOSTROMODIR%%/conf/nhttpd.conf; fi
+%%NOSTROMODIR%%/conf/nhttpd.conf-dist
+@exec if [ ! -f %D/%%NOSTROMODIR%%/conf/nhttpd.conf ] ; then cp -p %D/%F %B/nhttpd.conf; fi
+%%NOSTROMODIR%%/htdocs/index.html
+%%NOSTROMODIR%%/htdocs/nostromo.gif
+%%NOSTROMODIR%%/htdocs/cgi-bin/printenv
+%%NOSTROMODIR%%/icons/dir.gif
+%%NOSTROMODIR%%/icons/file.gif
+@dirrmtry %%NOSTROMODIR%%/conf
+@dirrmtry %%NOSTROMODIR%%/htdocs/cgi-bin
+@dirrmtry %%NOSTROMODIR%%/htdocs
+@dirrmtry %%NOSTROMODIR%%/icons
+@dirrmtry %%NOSTROMODIR%%/logs
+@dirrmtry %%NOSTROMODIR%%
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 6 Guido Falsi freebsd_committer 2013-09-10 21:28:56 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!
Comment 7 ast 2013-09-11 16:20:21 UTC
Actually, I was talking with the nostromo author Markus Glockner
and he wanted to fix this slightly differently in a 1.9.6 release
(see patch-src-libmy-strb64d).

There is also another important clang patch I included here now,
it will also go into 1.9.6. (patch-src-nhttpd-main)

Ast

On Tue, Sep 10, 2013 at 08:28:56PM +0000, madpilot@FreeBSD.org wrote:
> Synopsis: [PATCH] www/nostromo: Fix build with clang plust other fixes
> 
> State-Changed-From-To: feedback->closed
> State-Changed-By: madpilot
> State-Changed-When: Tue Sep 10 20:28:56 UTC 2013
> State-Changed-Why: 
> Committed. Thanks!
> 
> http://www.freebsd.org/cgi/query-pr.cgi?pr=181493
Comment 8 Guido Falsi freebsd_committer 2013-09-11 17:01:06 UTC
State Changed
From-To: closed->open

Open again this PR.
Comment 9 Guido Falsi freebsd_committer 2013-09-11 17:03:43 UTC
Hi

I've opened the PR again.

I'll integrate your patches and commit those too.

Thanks for the feedback.

-- 
Guido Falsi <madpilot@FreeBSD.org>
Comment 10 dfilter service freebsd_committer 2013-09-11 20:57:14 UTC
Author: madpilot
Date: Wed Sep 11 19:57:07 2013
New Revision: 327009
URL: http://svnweb.freebsd.org/changeset/ports/327009

Log:
  - Modify clang patch to match upstream
  
  PR:		ports/181493
  Submitted by:   Adrian Steinmann <ast@NetBSD.org> (maintainer from
  		different email, as followup)

Added:
  head/www/nostromo/files/patch-src-nhttpd-main   (contents, props changed)
Modified:
  head/www/nostromo/files/patch-src-libmy-strb64d.c

Modified: head/www/nostromo/files/patch-src-libmy-strb64d.c
==============================================================================
--- head/www/nostromo/files/patch-src-libmy-strb64d.c	Wed Sep 11 19:47:43 2013	(r327008)
+++ head/www/nostromo/files/patch-src-libmy-strb64d.c	Wed Sep 11 19:57:07 2013	(r327009)
@@ -1,11 +1,19 @@
---- src/libmy/strb64d.c.orig	2005-06-04 10:30:04.000000000 +0200
-+++ src/libmy/strb64d.c	2013-08-23 19:17:25.700331962 +0200
-@@ -54,7 +54,7 @@
+--- src/libmy/strb64d.c.orig	2013-09-10 09:58:37.814139989 +0200
++++ src/libmy/strb64d.c	2013-09-10 10:00:47.489957357 +0200
+@@ -47,14 +47,14 @@
+ int
+ strb64d(char *dst, const char *src, const int dsize)
+ {
+-	int		ch, i, j = 0;
++	int		ch, i, j;
+ 	char		out[3];
+ 	unsigned char	in_a[4], in_b[4];
+ 
  	dst[0] = '\0';
  
  	while (1) {
 -		for (i = 0, j = j; i < 4; i++, j++) {
-+		for (i = 0; i < 4; i++, j++) {
++		for (i = 0, j = 0; i < 4; i++, j++) {
  			if (src[j] == '\0')
  				goto quit;
  			ch = src[j];

Added: head/www/nostromo/files/patch-src-nhttpd-main
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/nostromo/files/patch-src-nhttpd-main	Wed Sep 11 19:57:07 2013	(r327009)
@@ -0,0 +1,11 @@
+--- src/nhttpd/main.c.orig	2013-09-10 10:02:24.538148541 +0200
++++ src/nhttpd/main.c	2013-09-10 10:12:40.431140031 +0200
+@@ -686,7 +686,7 @@
+ 	 * clear all environment variables and save PATH
+ 	 */
+ 	strlcpy(http_path, getenv("PATH"), sizeof(http_path));
+-	memset(environ, 0, sizeof(environ));
++	*environ = NULL;
+ 
+ 	/*
+ 	 * get servers IP adress(es)
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 11 Guido Falsi freebsd_committer 2013-09-11 20:57:31 UTC
State Changed
From-To: open->closed

Committed. Thanks!
Comment 12 ast 2013-09-15 10:14:03 UTC
Together with the the clang fix, I had done the squashing ENV
correctly, after further analysis I found that http_path was not
doing anything useful.

Thus I removed http_path altogether because it wasn't used except
to print out the environment; the intent was probably to squash
environ and put PATH back in, but that was never happening.

See also http://pkgsrc.se/www/nostromo

Ast