Bug 182997 - Package creation failure - stagedir startup script missing
Summary: Package creation failure - stagedir startup script missing
Status: Closed Unable to Reproduce
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: John Marino
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-15 14:00 UTC by Dewayne
Modified: 2014-06-10 13:44 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dewayne 2013-10-15 14:00:03 UTC
The following ports can not find their respective startup script for inclusion in the package tar file:
net/samba36 net/samba4 net/dante net/isc-dhcp42-server (& client)  
mail/mailscanner net-mgmt/arpwatch mail/p5-Mail-SpamAssassin 

The common failing is reported as
# make -DBATCH package
===>  Building package for dante-1.3.2
tar: etc/rc.d/sockd: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors.
pkg_create: make_dist: tar command failed with code 256
*** [do-package] Error code 1

Stop in /usr/ports/net/dante.

The working environment uses pkg_* and portmaster.

The above is by no means exhaustive, only representative of those ports needed.

Fix: 

The ugly and grossly inadequate workaround is to edit each Makefile and include something like:
@${CP} -p ${STAGEDIR}${PREFIX}/etc/rc.d/${USE_RC_SUBR} ${PREFIX}/etc/rc.d/
as part of the "post-install:" actions.  

Specific examples to demonstrate that there is clearly a pattern.  When the copy line is added the package(s) is successfully built, even if it did leave crap lying around in $STAGEDIR:

For net/samba36 insert at the end of the "post-install:" block
	@${CP} -p ${STAGEDIR}${RC_DIR}/samba ${RC_DIR}/

For net/samba4,
	@${CP} -p ${STAGEDIR}${PREFIX}/etc/rc.d/samba4 ${PREFIX}/etc/rc.d/

Similarly for net/isc-dhcp42-server (for net/isc-dhcp42-relay & net/isc-dhcp42-client), arpwatch
post-install:
	# The client instance has no rc.d/SCRIPT
        if [ -f ${STAGEDIR}${PREFIX}/etc/rc.d/${USE_RC_SUBR} ]; then \
                @${CP} -p ${STAGEDIR}${PREFIX}/etc/rc.d/${USE_RC_SUBR} ${PREFIX}/etc/rc.d/
        fi

mailscanner
	@${CP} -p ${STAGEDIR}${PREFIX}/etc/rc.d/mailscanner ${PREFIX}/etc/rc.d/
	@${CP} -p ${STAGEDIR}${PREFIX}/etc/rc.d/mta ${PREFIX}/etc/rc.d/
	
mail/p5-Mail-SpamAssassin
        @${CP} -p ${STAGEDIR}${PREFIX}/etc/rc.d/sa-spamd ${PREFIX}/etc/rc.d/
AND remove the extra colon at the end of post-install:

It seems that quite a few ports use a double-colon, but this is for another day.
How-To-Repeat: cd /usr/ports/net/dante && make -DBATCH package
Comment 1 John Marino freebsd_committer freebsd_triage 2014-06-08 09:42:59 UTC
I believe this bug report is obsolete.  I can't verify if it was ever valid.

I used poudriere bulk with the -t option on all 8 of these ports.  Only net/dante failed to build[1].  

Dewayne, are you still seeing this?  If poudriere doesn't show an error during installation, then the port is normally considered good.

John



[1] unrelated, no such /usr/local/lib/libdsocks.so found during installation.
Comment 2 dewayne 2014-06-10 13:39:05 UTC
Thank-you for looking into this.  It was definitely the case at the time
of logging the error.  Fortunately the folks looking after /usr/ports/Mk
fixed whatever was causing the problem.

Please close the PR, it is obsolete, net/dante is being successfully built. 

Regards, Dewayne.
Comment 3 John Marino freebsd_committer freebsd_triage 2014-06-10 13:44:22 UTC
Ok, thanks, closing.

P.S. Try building dante with stage-qa or check-orphans.  The failure I was seeing is minor but real.  It will install without complaint if you skip QA checks though.