Bug 143933 - textproc/flex: INSTALL_AS_USER errors out
Summary: textproc/flex: INSTALL_AS_USER errors out
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: Johan van Selst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-14 16:40 UTC by Gerald Pfeifer
Modified: 2010-02-26 08:20 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gerald Pfeifer freebsd_committer freebsd_triage 2010-02-14 16:40:01 UTC
	For some tests I needed to build and install ports as a regular
	user, leveraging 'make INSTALL_AS_USER=1 install'.  Sadly,
	textproc/flex errors out as follows:

:
  install  -s  -m 555 'flex' '/home/gerald/8-i386/bin/flex'
test -z "/home/gerald/8-i386/lib" || /bin/sh ./mkinstalldirs "/home/gerald/8-i386/lib"
 install   -m 444 'libfl.a' '/home/gerald/8-i386/lib/libfl.a'
 install   -m 444 'libfl_pic.a' '/home/gerald/8-i386/lib/libfl_pic.a'
 ranlib '/home/gerald/8-i386/lib/libfl.a'
ranlib: fatal: Failed to open '/home/gerald/8-i386/lib/libfl.a'
 ranlib '/home/gerald/8-i386/lib/libfl_pic.a'
ranlib: fatal: Failed to open '/home/gerald/8-i386/lib/libfl_pic.a'
gmake[3]: *** [install-libLIBRARIES] Error 70
gmake[3]: Leaving directory `/scratch/tmp/gerald/dumpster/home/gerald/ports/flex/work/flex-2.5.35'
gmake[2]: *** [install-am] Error 2
gmake[2]: Leaving directory `/scratch/tmp/gerald/dumpster/home/gerald/ports/flex/work/flex-2.5.35'
gmake[1]: *** [install-recursive] Error 1
gmake[1]: Leaving directory `/scratch/tmp/gerald/dumpster/home/gerald/ports/flex/work/flex-2.5.35'
gmake: *** [install] Error 2
*** Error code 2

Fix: 

I believe the problem may be running ranlib on the two .a files
	which have permissions r--r--r--.
How-To-Repeat: 	env PREFIX=$HOME/...; make INSTALL_AS_USER=1 install
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2010-02-14 16:40:12 UTC
Responsible Changed
From-To: freebsd-ports-bugs->johans

johans@stack.nl => johans@ (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2010-02-14 16:40:14 UTC
Maintainer of textproc/flex,

Please note that PR ports/143933 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/143933

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Edwin Groothuis freebsd_committer freebsd_triage 2010-02-14 16:40:17 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 4 Johan van Selst 2010-02-14 17:40:31 UTC
Gerald Pfeifer wrote:
> I believe the problem may be running ranlib on the two .a files
> which have permissions r--r--r--

This is indeed the problem, if you run make with an additional 
	INSTALL_DATA="install -m 644"
it should install flex just fine. However I'm not sure how to fix this
for the flex port. Adding said option to the general case seems
inappropriate. Besides, there are quite a number of other ports that
use $(INSTALL_DATA) to install libraries as well, and thus will suffer
the same problem. I'll probably add a hack to chown the two library
files before running ranlib.

Suggestions for a better fix are welcome.


Johan
Comment 5 gerald 2010-02-15 22:50:47 UTC
On Sun, 14 Feb 2010, Johan van Selst wrote:
> Suggestions for a better fix are welcome.

I cannot think of any, but if you have a patch you are happy about I
will be glad to commit it for you.

Gerald
Comment 6 Johan van Selst 2010-02-16 09:01:54 UTC
Hi Gerald,

Please try replacing the post-patch section with this and let me know
if this does the trick.

post-patch:	.SILENT
	${REINPLACE_CMD} -Ee 's/tests//' \
		-e 's/^([[:space:]]*)\$$\(RANLIB\) ([^ ]*)/\1chmod u+w \2;&/' \
		${WRKSRC}/Makefile.in
	${REINPLACE_CMD} -e 's/@MAKEINFO@/& --no-split/g' \
		${WRKSRC}/doc/Makefile.in
	${RM} -f ${WRKSRC}/doc/*.info*


The same as a diff for patch(1):

--- flex/Makefile	2009-12-28 08:31:06.000000000 +0100
+++ flex/Makefile	2010-02-16 09:50:28.000000000 +0100
@@ -36,7 +36,9 @@
 .endif
 
 post-patch:	.SILENT
-	${REINPLACE_CMD} -e 's/tests//' ${WRKSRC}/Makefile.in
+	${REINPLACE_CMD} -Ee 's/tests//' \
+		-e 's/^([[:space:]]*)\$$\(RANLIB\) ([^ ]*)/\1chmod u+w \2;&/' \
+		${WRKSRC}/Makefile.in
 	${REINPLACE_CMD} -e 's/@MAKEINFO@/& --no-split/g' \
 		${WRKSRC}/doc/Makefile.in
 	${RM} -f ${WRKSRC}/doc/*.info*
Comment 7 dfilter service freebsd_committer freebsd_triage 2010-02-26 08:12:52 UTC
johans      2010-02-26 08:12:39 UTC

  FreeBSD ports repository

  Modified files:
    textproc/flex        Makefile 
  Log:
  Fix port installation for the INSTALL_AS_USER case.
  This doesn't affect regular (root) installs.
  
  PR:             ports/143933
  Submitted by:   gerald
  Feature safe:   yes
  
  Revision  Changes    Path
  1.11      +3 -1      ports/textproc/flex/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"
Comment 8 Johan van Selst freebsd_committer freebsd_triage 2010-02-26 08:13:18 UTC
State Changed
From-To: feedback->closed

Committed the patch that has been tested by gerald.