Bug 68181 - [PATCH] mail/py-spambayes doesn't install due to using ${PORTDOCS}
Summary: [PATCH] mail/py-spambayes doesn't install due to using ${PORTDOCS}
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: Mario Sergio Fujikawa Ferreira
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-21 22:50 UTC by Danny Pansters
Modified: 2004-06-24 15:48 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 Danny Pansters 2004-06-21 22:50:20 UTC
When updating my mail/py-spambayes I noticed it fails to install:

...
install  -o root -g wheel -m 444 /usr/ports/mail/py-spambayes/work/spambayes-1.0rc1/WHAT_IS_NEW.txt /usr/local/share/doc/spambayes
install  -o root -g wheel -m 444 /usr/ports/mail/py-spambayes/work/spambayes-1.0rc1/contrib/ /usr/local/share/doc/spambayes
install: /usr/ports/mail/py-spambayes/work/spambayes-1.0rc1/contrib/: Inappropriate file type or format
*** Error code 71

Fix: The for loop in the Makefile causes ${INSTALL_DATA} to attempt to install a directory as if it were a file. From what I gather from bsd.port.mk, it seems that the interpretation of shell expansions and directories (adding subdirs if any) in ${PORTDOCS} works for +CONTENTS generation only. Perhaps someone can confirm this? 

Here's one possible workaround which still retains some advantage of defining ${PORTDOCS} in the sense that you can loop over it.

workstation# diff -u Makefile.orig Makefile


PORTNAME=      spambayes
 PORTVERSION=   1.0.rc.1
+PORTREVISION=  1
 CATEGORIES=    mail python
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=    ${PORTNAME}
@@ -34,12 +35,12 @@

 post-install:
 .ifndef(NOPORTDOCS)
-       @${MKDIR} ${DOCSDIR}
+       @${MKDIR} ${DOCSDIR} ${DOCSDIR}/contrib
 .for file in ${PORTDOCS}
-       ${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR}
+       if [ -d ${WRKSRC}/${file} ]; then \
+       ${INSTALL_DATA} ${WRKSRC}/${file}/* ${DOCSDIR}/contrib; else \
+       ${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR}; fi
 .endfor
-       @${MKDIR} ${DOCSDIR}/contrib
-       @${INSTALL_DATA} ${WRKSRC}/contrib/* ${DOCSDIR}/contrib
 .endif

 .include <bsd.port.mk>--BAtJTZIdoIMHWLl6tWBAJehx7qQ8vwuJuUcGE03km3mlZnrJ
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- Makefile.orig       Mon Jun 21 22:41:36 2004
+++ Makefile    Mon Jun 21 23:35:30 2004
@@ -7,6 +7,7 @@
How-To-Repeat: cd /usr/ports/mail/py-spambayes
[make deinstall]
make install
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2004-06-22 15:50:01 UTC
Responsible Changed
From-To: freebsd-ports-bugs->lioux

Over to maintainer.
Comment 2 Mario Sergio Fujikawa Ferreira freebsd_committer freebsd_triage 2004-06-24 15:47:37 UTC
State Changed
From-To: open->closed

Somewhat simpler fix committed, thanks! Forgot this in the previous 
update