Bug 190667

Summary: [stage] german/bbbike: stage directory support
Product: Ports & Packages Reporter: Slaven Rezic <slaven>
Component: Individual Port(s)Assignee: John Marino <marino>
Status: Closed FIXED    
Severity: Affects Only Me CC: eserte12, marino, miwi, sbruno
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Here the patch also as an attachment.
none
New patch addressing the QA issues
none
2nd patch addressing the QA issues
none
using the ".ifdef exists PERL5" hack none

Description Slaven Rezic 2014-06-05 19:46:37 UTC

Fix:
diff -ruN /usr/ports/german/BBBike/Makefile ./Makefile
--- /usr/ports/german/BBBike/Makefile	2014-05-05 11:45:36.000000000 +0200
+++ ./Makefile	2014-06-05 20:51:34.000000000 +0200
@@ -18,14 +18,11 @@
 USES=		perl5
 POD2MAN=	pod2man
 
-MAN1=		bbbike.1
-
-MYDESTDIR=	${PREFIX}/BBBike
+MYDESTDIR=	${STAGEDIR}${PREFIX}/BBBike
 
 LOCAL_PERL_ARCH=	${PERL_ARCH}
 PLIST_SUB=		LOCAL_PERL_ARCH=${LOCAL_PERL_ARCH}
 
-NO_STAGE=	yes
 do-build:
 	cd ${WRKSRC}/ext && ${MAKE} PERL=${PERL5} all install
 	cd ${WRKSRC}/ext && ${MAKE} PERL=${PERL5} clean
@@ -46,14 +43,14 @@
 
 do-install:
 	-${RM} -rf ${MYDESTDIR}
-	${INSTALL_MAN} ${WRKSRC}/bbbike.1 ${PREFIX}/man/man1
-	${CP} -r ${WRKSRC} ${MYDESTDIR}
+	${INSTALL_MAN} ${WRKSRC}/bbbike.1 ${STAGEDIR}${PREFIX}/man/man1
+	${FIND} ${WRKSRC} | ${XARGS} ${CHMOD} ugo+r
+	${FIND} ${WRKSRC} -perm -u=x | ${XARGS} ${CHMOD} go+x
+	${CP} -rp ${WRKSRC} ${MYDESTDIR}
 	${RM} -f ${MYDESTDIR}/bbbike.1
-	${FIND} ${MYDESTDIR} | ${XARGS} ${CHMOD} ugo+r
-	${FIND} ${MYDESTDIR} -perm -u=x | ${XARGS} ${CHMOD} go+x
 .for f in ${BBBIKEEXE}
-	-${RM} -f ${PREFIX}/bin/$f
-	${LN} -s  ${MYDESTDIR}/$f ${PREFIX}/bin/$f
+	-${RM} -f ${STAGEDIR}${PREFIX}/bin/$f
+	${LN} -s  ../BBBike/$f ${STAGEDIR}${PREFIX}/bin/$f
 .endfor
 
 .include <bsd.port.mk>
diff -ruN /usr/ports/german/BBBike/pkg-plist.in ./pkg-plist.in
--- /usr/ports/german/BBBike/pkg-plist.in	2013-07-06 11:18:27.000000000 +0200
+++ ./pkg-plist.in	2014-06-05 20:51:34.000000000 +0200
@@ -209,19 +209,16 @@
 BBBike/Way/Metric.pm
 BBBike/Wizards.pm
 BBBike/bbbike
-@exec ln -fs %D/%F %D/bin/bbbike
-@unexec rm -f %D/bin/bbbike
+bin/bbbike
 BBBike/bbbike-activeperl.bat
 BBBike/bbbike-fast.bat
 BBBike/bbbike.bat
 BBBike/bbbike.pod
 BBBike/bbbikeapplet
 BBBike/bbbikeclient
-@exec ln -fs %D/%F %D/bin/bbbikeclient
-@unexec rm -f %D/bin/bbbikeclient
+bin/bbbikeclient
 BBBike/cbbbike
-@exec ln -fs %D/%F %D/bin/cbbbike
-@unexec rm -f %D/bin/cbbbike
+bin/cbbbike
 BBBike/cbbbike.bat
 BBBike/cgi/README
 BBBike/cgi/bbbike-data.cgi
@@ -248,8 +245,7 @@
 BBBike/cgi/tinyhttpd.config
 BBBike/cgi/wapbbbike.cgi
 BBBike/cmdbbbike
-@exec ln -fs %D/%F %D/bin/cmdbbbike
-@unexec rm -f %D/bin/cmdbbbike
+bin/cmdbbbike
 BBBike/data/.modified
 BBBike/data/Berlin.coords.data
 BBBike/data/Potsdam.coords.data
@@ -1077,10 +1073,10 @@
 BBBike/plugins/MerkaartorPlugin.pm
 BBBike/plugins/MultiMap.pm
 BBBike/smsbbbike
-@exec ln -fs %D/%F %D/bin/smsbbbike
-@unexec rm -f %D/bin/smsbbbike
+bin/smsbbbike
 BBBike/tkbikepwr
 BBBike/tmp/.keep_me
+man/man1/bbbike.1.gz
 BBBike/lib/%%LOCAL_PERL_ARCH%%/BBBikeXS.pm
 BBBike/lib/%%LOCAL_PERL_ARCH%%/Strassen/Inline.pm
 BBBike/lib/%%LOCAL_PERL_ARCH%%/Strassen/Inline2.pm
Comment 1 Martin Wilke freebsd_committer freebsd_triage 2014-06-06 03:14:52 UTC
please attach a patch.

Thanks
Comment 2 eserte12 2014-06-06 06:00:20 UTC
Created attachment 143437 [details]
Here the patch also as an attachment.
Comment 3 Martin Wilke freebsd_committer freebsd_triage 2014-06-06 13:22:47 UTC
Hi,

Build fails, please have a look 

http://pkgdev.miwibox.org/data/92amd64-default/2014-06-06_13h05m50s/logs/errors/de-BBBike-3.18_1.log
Comment 4 eserte12 2014-06-06 19:17:33 UTC
Created attachment 143464 [details]
New patch addressing the QA issues
Comment 5 eserte12 2014-06-12 19:50:00 UTC
Created attachment 143721 [details]
2nd patch addressing the QA issues

The QA system seems to have problems with a computed pkg-plist, so this change gets rid of the pkg-plist.in.
Comment 6 eserte12 2014-07-21 16:59:09 UTC
Please, can you retry the latest patch?
Comment 7 John Marino freebsd_committer freebsd_triage 2014-08-05 13:37:04 UTC
let's cross our fingers that this is the one.
Comment 8 commit-hook freebsd_committer freebsd_triage 2014-08-06 23:28:48 UTC
A commit references this bug:

Author: marino
Date: Wed Aug  6 23:27:47 UTC 2014
New revision: 364231
URL: http://svnweb.freebsd.org/changeset/ports/364231

Log:
  Stage german/BBBike

  PR:		190667
  Submitted by:	maintainer (Slaven Rezic)

Changes:
  head/german/BBBike/Makefile
  head/german/BBBike/pkg-descr
  head/german/BBBike/pkg-plist
  head/german/BBBike/pkg-plist.in
Comment 9 John Marino freebsd_committer freebsd_triage 2014-08-06 23:32:20 UTC
Okay, the good news is that it passed all checks.

The bad news is that the pkg-desc was waaaay illegal, only 24 lines allowed.  To make it fit I removed unnecessary blank lines and the German translation (I know that probably irks you but putting non-english in the pkg-desc isn't conventional.  I don't know if it's actually illegal or not but I haven't run into that before).

The so-so news is that the use of != to figure out the perl version looks very sketchy to me.  I suspect there is a better way to figure this out.  "!=" operator actually flags checks, people want to avoid it's use as much as possible.

But for now your port is staged.
Comment 10 Sean Bruno freebsd_committer freebsd_triage 2014-08-10 17:06:27 UTC
This update seems to generate warning/errors when running from poudriere:

[00:00:02] ====>> Calculating ports order and dependencies
/usr/local/bin/perl5.16.3: not found
make: "/usr/ports/german/BBBike/Makefile" line 26: warning: "/usr/local/bin/perl5.16.3 -MConfig -e '$x = qq{$Config{version}/$Config{archname}}; $x =~ s{/}{\\\\/}g; print $x'" returned non-zero status
WARNING (german/BBBike): /usr/local/bin/perl5.16.3: not found 
WARNING (german/BBBike): make: "/usr/ports/german/BBBike/Makefile" line 26: warning: "/usr/local/bin/perl5.16.3 -MConfig -e '$x = qq{$Config{version}/$Config{archname}}; $x =~ s{/}{\\\\/}g; print $x'" returned non-zero status
Comment 11 eserte12 2014-08-10 17:12:36 UTC
(In reply to Sean Bruno from comment #10)
> This update seems to generate warning/errors when running from poudriere:
> 
> [00:00:02] ====>> Calculating ports order and dependencies
> /usr/local/bin/perl5.16.3: not found
> make: "/usr/ports/german/BBBike/Makefile" line 26: warning:
> "/usr/local/bin/perl5.16.3 -MConfig -e '$x =
> qq{$Config{version}/$Config{archname}}; $x =~ s{/}{\\\\/}g; print $x'"
> returned non-zero status
> WARNING (german/BBBike): /usr/local/bin/perl5.16.3: not found 
> WARNING (german/BBBike): make: "/usr/ports/german/BBBike/Makefile" line 26:
> warning: "/usr/local/bin/perl5.16.3 -MConfig -e '$x =
> qq{$Config{version}/$Config{archname}}; $x =~ s{/}{\\\\/}g; print $x'"
> returned non-zero status

Probably here the Makefile was called very early, before even perl was installed. Maybe the != hack could be extended to something like

     LOCAL_PERL_ARCH!=	[ -x ${PERL5} ] && ${PERL5} -MConfig -e '$$x = qq{$$Config{version}/$$Config{archname}}; $$x =~ s{/}{\\\\/}g; print $$x'

(to be checked, or I find a better way to get to the LOCAL_PERL_ARCH value)
Comment 12 John Marino freebsd_committer freebsd_triage 2014-08-10 17:16:05 UTC
other ports that use this terrible hack put a safeguard to avoid the evaluation if PERL5 is not defined, e.g.

.if defined(PERL5)
LOCAL_PERL_ARCH!= ....
.endif


That would probably solve whatever warnings you are getting
Comment 13 eserte12 2014-08-10 18:19:28 UTC
(In reply to John Marino from comment #12)
> other ports that use this terrible hack put a safeguard to avoid the
> evaluation if PERL5 is not defined, e.g.
> 
> .if defined(PERL5)
> LOCAL_PERL_ARCH!= ....
> .endif
> 
> 
> That would probably solve whatever warnings you are getting

PERL5 is probably defined here (the error message says "/usr/local/bin/perl5.16.3: not found"), but maybe we can use exists:

.if exists(${PERL5})
LOCAL_PERL_ARCH!= ....
.endif
Comment 14 John Marino freebsd_committer freebsd_triage 2014-08-11 08:50:21 UTC
sounds ok, does it work?
Comment 15 eserte12 2014-08-11 17:55:26 UTC
Created attachment 145675 [details]
using the ".ifdef exists PERL5" hack

Here's a patch with the "exists" hack.

(I also added a comment about the necessity for the !=, and a small identation fix)
Comment 16 commit-hook freebsd_committer freebsd_triage 2014-08-11 21:23:55 UTC
A commit references this bug:

Author: marino
Date: Mon Aug 11 21:23:18 UTC 2014
New revision: 364667
URL: http://svnweb.freebsd.org/changeset/ports/364667

Log:
  german/BBBike: Clear up build warnings caused by early shell command

  PR:		190667
  Reported by:	Sean Bruno
  Submitted by:	eserte12 (yahoo.de)
  Approved by:	Just Fix It

Changes:
  head/german/BBBike/Makefile
Comment 17 John Marino freebsd_committer freebsd_triage 2014-08-11 21:24:55 UTC
Hopefully all is well now..