From nobody@FreeBSD.org  Mon Jan  9 06:38:57 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1A6B2106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  9 Jan 2012 06:38:57 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id F355F8FC13
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  9 Jan 2012 06:38:56 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q096cuG6073935
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 9 Jan 2012 06:38:56 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q096cuMk073934;
	Mon, 9 Jan 2012 06:38:56 GMT
	(envelope-from nobody)
Message-Id: <201201090638.q096cuMk073934@red.freebsd.org>
Date: Mon, 9 Jan 2012 06:38:56 GMT
From: Garrett Cooper <yaneurabeya@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] fix i386 build of dns/inadyn
X-Send-Pr-Version: www-3.1
X-GNATS-Notify: samm@os2.kiev.ua

>Number:         163942
>Category:       ports
>Synopsis:       [patch] fix i386 build of dns/inadyn
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 09 06:40:13 UTC 2012
>Closed-Date:    Sun Jan 29 10:58:29 UTC 2012
>Last-Modified:  Sun Feb 03 22:30:07 UTC 2013
>Originator:     Garrett Cooper
>Release:        9.0-RELEASE
>Organization:
iXsystems, Inc.
>Environment:
FreeBSD bayonetta.local 9.0-STABLE FreeBSD 9.0-STABLE #1 r229323M: Mon Jan  2 14:32:54 PST 2012     gcooper@bayonetta.local:/usr/obj/store/freebsd/stable/9/sys/BAYONETTA  amd64
>Description:
Building FreeNAS, we at iXsystems and the users that use FreeNAS have run into situations on more than one occasion where the inadyn binary has been corrupted somehow when building the i386 package (oddly enough the amd64 package isn't affected).

The following patch ignores the contributed Makefile -- which does this undesirable things, like using TARGET_ARCH, for OS names -- and instead uses a simple pmake Makefile to get the job done.

A few examples are as follows:

1. http://support.freenas.org/ticket/1144 , comments 3 and 5.
2. http://forums.freenas.org/showthread.php?2050-Dynamic-DNS-problem
3. http://forums.freenas.org/showthread.php?5078-8-0-3-RELEASE-coming-soon&p=19721&viewfull=1#post19721
>How-To-Repeat:
I don't have clear reproduction steps for the issue.
>Fix:


Patch attached with submission follows:

diff --exclude '*.orig' -Naur dns/inadyn/Makefile dns/inadyn/Makefile
--- dns/inadyn/Makefile	2009-07-10 16:23:38.000000000 -0700
+++ dns/inadyn/Makefile	2012-01-07 20:04:28.202978310 -0800
@@ -7,7 +7,7 @@
 
 PORTNAME=	inadyn
 PORTVERSION=	1.96.2
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	dns
 MASTER_SITES=	http://www.inatech.eu/inadyn/ \
 		${MASTER_SITE_LOCAL}
@@ -21,34 +21,29 @@
 USE_RC_SUBR=	inadyn
 USE_ZIP=	yes
 USE_DOS2UNIX=	yes
-USE_GMAKE=	yes
-MAKEFILE=	makefile
-
-MAN8=		inadyn.8
-MAN5=		inadyn.conf.5
-MANCOMPRESSED=	no
 
 PORTDOCS=	readme.html
 PLIST_FILES=	bin/inadyn
 
 NO_INSTALL_MANPAGES=yes
 
+MAKE_JOBS_SAFE=	yes
+MAKEFILE=	${FILESDIR}/BSDmakefile
+
+MAKE_ENV+=	MANDIR=${MANPREFIX}/man
+
 post-extract:
 	${MV} ${WRKDIR}/${PORTNAME} ${WRKDIR}/${PORTNAME}-${PORTVERSION}
 
 post-patch:
-	@${REINPLACE_CMD} -e 's|gcc|$$\(CC\)|g' ${WRKSRC}/makefile
 	${REINPLACE_CMD} -e "s,%%PREFIX%%,${PREFIX},g" \
 		${WRKSRC}/man/inadyn.8 ${WRKSRC}/readme.html \
 		${WRKSRC}/src/dyndns.h
 
-do-install:
+pre-install:
 .if !defined(NOPORTDOCS)
 	${MKDIR} ${DOCSDIR}
 	${INSTALL_MAN} ${WRKSRC}/${PORTDOCS} ${DOCSDIR}
 .endif
-	 ${INSTALL_SCRIPT} ${WRKSRC}/bin/linux/inadyn ${PREFIX}/bin
-	 ${INSTALL_SCRIPT} ${WRKSRC}/man/inadyn.8 ${MANPREFIX}/man/man8
-	 ${INSTALL_SCRIPT} ${WRKSRC}/man/inadyn.conf.5 ${MANPREFIX}/man/man5
 
 .include <bsd.port.mk>
diff --exclude '*.orig' -Naur dns/inadyn/files/BSDmakefile dns/inadyn/files/BSDmakefile
--- dns/inadyn/files/BSDmakefile	1969-12-31 16:00:00.000000000 -0800
+++ dns/inadyn/files/BSDmakefile	2012-01-07 20:02:28.322979665 -0800
@@ -0,0 +1,16 @@
+PROG=	inadyn
+
+MAN5=	inadyn.conf.5
+
+MAN8=	inadyn.8
+
+SRCS=	base64utils.c dyndns.c errorcode.c get_cmd.c http_client.c ip.c main.c os.c \
+	os_psos.c os_unix.c os_windows.c tcp.c inadyn_cmd.c
+
+.PATH:	man src
+
+WARNS=	2
+
+BINDIR=	${PREFIX}/bin
+
+.include <bsd.prog.mk>


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Mon Jan 9 06:40:23 UTC 2012 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=163942 

From: Edwin Groothuis <edwin@FreeBSD.org>
To: samm@os2.kiev.ua
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/163942: [patch] fix i386 build of dns/inadyn
Date: Mon, 9 Jan 2012 06:40:21 UT

 Maintainer of dns/inadyn,
 
 Please note that PR ports/163942 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/163942
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org

From: Alex Samorukov <samm@os2.kiev.ua>
To: bug-followup@FreeBSD.org, yanegomi@gmail.com
Cc:  
Subject: Re: ports/163942: [patch] fix i386 build of dns/inadyn
Date: Tue, 10 Jan 2012 18:20:53 +0100

 Hi,
 i was sure that it is fixed bug because it was discussed with one of the 
 commiters. I will submit correct patch soon. Problem is that 
 install_script should never be used for anything, but text files.
 
 Please, do not commit this diff, its overcomplicated.
 
From: Alex Samorukov <samm@os2.kiev.ua>
To: bug-followup@FreeBSD.org, yanegomi@gmail.com
Cc:  
Subject: Re: ports/163942: [patch] fix i386 build of dns/inadyn
Date: Tue, 10 Jan 2012 18:32:45 +0100

 This patch should address issue. Please commit it.
 
 diff -ruN --exclude=CVS /usr/ports/dns/inadyn/Makefile 
 /root/tmp/inadyn/Makefile
 --- /usr/ports/dns/inadyn/Makefile      2009-07-10 23:23:38.000000000 +0000
 +++ /root/tmp/inadyn/Makefile   2012-01-10 17:25:14.866475561 +0000
 @@ -45,10 +45,10 @@
   do-install:
   .if !defined(NOPORTDOCS)
          ${MKDIR} ${DOCSDIR}
 -       ${INSTALL_MAN} ${WRKSRC}/${PORTDOCS} ${DOCSDIR}
 +       ${INSTALL_DATA} ${WRKSRC}/${PORTDOCS} ${DOCSDIR}
   .endif
 -        ${INSTALL_SCRIPT} ${WRKSRC}/bin/linux/inadyn ${PREFIX}/bin
 -        ${INSTALL_SCRIPT} ${WRKSRC}/man/inadyn.8 ${MANPREFIX}/man/man8
 -        ${INSTALL_SCRIPT} ${WRKSRC}/man/inadyn.conf.5 ${MANPREFIX}/man/man5
 +        ${INSTALL_PROGRAM} ${WRKSRC}/bin/linux/inadyn ${PREFIX}/bin
 +        ${INSTALL_MAN} ${WRKSRC}/man/inadyn.8 ${MANPREFIX}/man/man8
 +        ${INSTALL_MAN} ${WRKSRC}/man/inadyn.conf.5 ${MANPREFIX}/man/man5
 
   .include <bsd.port.mk>
 
State-Changed-From-To: feedback->suspended 
State-Changed-By: linimon 
State-Changed-When: Tue Jan 10 23:17:42 UTC 2012 
State-Changed-Why:  
Maintainer is working on a more general solution. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=163942 
State-Changed-From-To: suspended->open 
State-Changed-By: linimon 
State-Changed-When: Wed Jan 11 14:22:22 UTC 2012 
State-Changed-Why:  
Maintainer had already replied with updated patch.  The Audit-Trail 
has been re-edited to reflect that. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=163942 
State-Changed-From-To: open->closed 
State-Changed-By: avl 
State-Changed-When: Sun Jan 29 10:58:27 UTC 2012 
State-Changed-Why:  
Committed, with changes. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=163942 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/163942: commit references a PR
Date: Sun, 29 Jan 2012 10:56:19 +0000 (UTC)

 avl         2012-01-29 10:56:06 UTC
 
   FreeBSD ports repository
 
   Modified files:
     dns/inadyn           Makefile 
   Log:
   - Fix broken binary caused by using INSTALL_SCRIPT on some architectures
   - Use INSTALL_MAN for the man files and respect NO_INSTALL_MANPAGES knob
   - Use INSTALL_DATA for PORTDOCS file
   - Hide post-extract and post-patch procedure
   - Bump PORTREVISION
   
   PR:             ports/163942 [1]
   Submitted by:   Garrett Cooper <yanegomi AT gmail.com> [1]
   Approved by:    maintainer via private mail
   
   Revision  Changes    Path
   1.10      +11 -10    ports/dns/inadyn/Makefile
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: <rick@sloservers.com>
To: <bug-followup@FreeBSD.org>, <yanegomi@gmail.com>, <samm@os2.kiev.ua>
Cc:  
Subject: Re: ports/163942: [patch] fix i386 build of dns/inadyn
Date: Wed, 24 Oct 2012 17:36:32 -0700

  Hi there,
 
  I don't think that this latest update has resolved the original issue 
  with TARGET_ARCH.  I ran into this same problem today when using the 
  FreeNAS build scripts and the latest version of the port.  You can 
  reproduce it like so:
 
  [root@ /usr/ports/dns/inadyn]# make TARGET_ARCH=amd64
  .
  .
  .
  [root@ /usr/ports/dns/inadyn]# make TARGET_ARCH=amd64 install
  ===>  Installing for inadyn-1.96.2_3
  ===>   Generating temporary packing list
  ===>  Checking if dns/inadyn already installed
  /bin/mkdir -p /usr/local/share/doc/inadyn
  install  -o root -g wheel -m 444 -p 
  /usr/ports/dns/inadyn/work/inadyn.v1.96.2/readme.html 
  /usr/local/share/doc/inadyn
  install  -s -o root -g wheel -m 555 
  /usr/ports/dns/inadyn/work/inadyn.v1.96.2/bin/linux/inadyn 
  /usr/local/bin
  strip: /usr/local/bin/inadyn: File format not recognized
  install: wait: No such file or directory
  *** Error code 70
 
  Stop in /usr/ports/dns/inadyn.
 
 
  This happens because inadyn puts the binary under 
  workdir/bin/${TARGET_ARCH} when TARGET_ARCH is set.  The Makefile, 
  however, installs out of workdir/bin/linux.
 
  [root@ /usr/ports/dns/inadyn]# find work/inadyn.v1.96.2/bin/ -type d
  work/inadyn.v1.96.2/bin/
  work/inadyn.v1.96.2/bin/win32
  work/inadyn.v1.96.2/bin/mac
  work/inadyn.v1.96.2/bin/amd64  <--- Here is the correct directory
  work/inadyn.v1.96.2/bin/linux
 
  Regards,
  Rick
>Unformatted:
