Bug 162397 - [patch] Mk/bsd.port.mk: add new target add-plist-buildinfo for package build details
Summary: [patch] Mk/bsd.port.mk: add new target add-plist-buildinfo for package build ...
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: Mark Linimon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-09 06:30 UTC by Jason Helfman
Modified: 2012-09-07 00:10 UTC (History)
0 users

See Also:


Attachments
file.diff (1.42 KB, patch)
2011-11-09 06:30 UTC, Jason Helfman
no flags Details | Diff
0001-Fix-add-plist-buildinfo-definition.patch (823 bytes, patch)
2012-09-07 00:02 UTC, Mike Kelly
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Helfman 2011-11-09 06:30:11 UTC
In working more and more with FreeBSD, ports, packages and the Operating System,
itself, I am finding the more background I have the better. One item I have
always found to be curious is no details of any sort for a given built package
are bound to a package that are distributed by FreeBSD. I think this would be
a great addition to consider.

I would think this would be very helpful, and thought that it could be great
for the pointyhat buildcluster in respect to either resolving issues, or at
the very least have details recorded in the package of it's build origin.

The included patch is configurable, however a prePortBuild hook would be
required, at the minimum, to get the correct information into the build cycle,
unless it is supplied another way.

Below is an example of my hook, and the resulting package information from the
package I had built. In addition, there are links to the package, and log of the
build.

How-To-Repeat: * tinderbox prePortBuild hook:

#!/bin/sh
host=`uname -n`
date=`date`

echo "BUILDHOST=$host" >> ${CHROOT}/etc/make.conf
echo "BUILDDATE=$date" >> ${CHROOT}/etc/make.conf
echo "BUILD=$BUILD" >> ${CHROOT}/etc/make.conf
echo "JAIL=$JAIL" >> ${CHROOT}/etc/make.conf
echo "PORTSTREE=$PORTSTREE" >> ${CHROOT}/etc/make.conf

* pkg_info -f xjobs-20110730.tbz
Information for xjobs-20110730.tbz:

Packing list:
	Comment: PKG_FORMAT_REVISION:1.1
	Package name: xjobs-20110730
	Package origin: sysutils/xjobs
	CWD to /usr/local
File: bin/xjobs
	Comment: MD5:149c40759e9cf35d71691f5412d5057e
File: man/man1/xjobs.1.gz
	Comment: MD5:aefe511b9eab2187add56e82ccd08b1b
	UNEXEC 'rm -f %D/man/cat1/xjobs.1.gz %D/man/cat1/xjobs.1 %D/man/cat1/xjobs.1.gz %D/man/cat1/xjobs.1.gz.gz %D/man/cat1/xjobs.1.gz.bz2'
	Comment: Build details:  walrus.experts-exchange.com|8.2|8.2-dev|current-dev|Tue Nov  8 21:23:41 PST 2011

* The resulting +CONTENTS file from the installed package:
[jhelfman@dormouse /var/db/pkg]$ cd xjobs-20110730/
[jhelfman@dormouse /var/db/pkg/xjobs-20110730]$ cat ./+CONTENTS 
@comment PKG_FORMAT_REVISION:1.1
@name xjobs-20110730
@comment ORIGIN:sysutils/xjobs
@cwd /usr/local
bin/xjobs
@comment MD5:149c40759e9cf35d71691f5412d5057e
man/man1/xjobs.1.gz
@comment MD5:aefe511b9eab2187add56e82ccd08b1b
@unexec rm -f %D/man/cat1/xjobs.1.gz %D/man/cat1/xjobs.1 %D/man/cat1/xjobs.1.gz %D/man/cat1/xjobs.1.gz.gz %D/man/cat1/xjobs.1.gz.bz2
@comment Build details:  walrus.experts-exchange.com|8.2|8.2-dev|current-dev|Tue Nov  8 21:23:41 PST 2011

* Tinderbox package: http://jgh.devio.us/files/logs/xjobs-20110730.tbz
* Tinderbox log: http://jgh.devio.us/files/logs/xjobs-20110730.log
Comment 1 Edwin Groothuis freebsd_committer 2011-11-09 06:30:23 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

bsd.port.mk is portmgr territory (via the GNATS Auto Assign Tool)
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2012-03-19 23:53:33 UTC
State Changed
From-To: open->analyzed

take for -exp. 


Comment 3 Mark Linimon freebsd_committer freebsd_triage 2012-03-19 23:53:33 UTC
Responsible Changed
From-To: portmgr->linimon
Comment 4 dfilter service freebsd_committer 2012-09-06 21:59:42 UTC
Author: linimon
Date: Thu Sep  6 20:59:27 2012
New Revision: 303789
URL: http://svn.freebsd.org/changeset/ports/303789

Log:
   - Remove obsolete USE_XLIB and MACHINE_ARCH definitions [1], [4]
  
   - Include top-level Makefile.inc from correct directory [2]
  
   - Add new target add-plist-buildinfo for package build details [3]
  
  PR:		ports/152871 [1]
  PR:		ports/164207 [2]
  PR:		ports/162397 [3]
  PR:		ports/167677 [4]
  
  Submitted by:	eadler [1], [4]; glarkin [2]; jhelfman@experts-exchange.com [3]

Modified:
  head/Mk/bsd.port.mk

Modified: head/Mk/bsd.port.mk
==============================================================================
--- head/Mk/bsd.port.mk	Thu Sep  6 20:16:47 2012	(r303788)
+++ head/Mk/bsd.port.mk	Thu Sep  6 20:59:27 2012	(r303789)
@@ -38,9 +38,7 @@ FreeBSD_MAINTAINER=	portmgr@FreeBSD.org
 # different actions for different values.
 #
 # ARCH			- The architecture of the target machine, such as would be
-#				  returned by "uname -p".  (Note: Ports should test against
-#				  ARCH, and not the host machine's architecture which is
-#				  MACHINE_ARCH, to enable ports to be cross-built.)
+#				  returned by "uname -p".
 # OPSYS			- Portability clause.  This is the operating system the
 #				  makefile is being used on.  Automatically set to
 #				  "FreeBSD," "NetBSD," or "OpenBSD" as appropriate.
@@ -359,8 +357,6 @@ FreeBSD_MAINTAINER=	portmgr@FreeBSD.org
 # USE_IMAKE		- If set, this port uses imake.
 # XMKMF			- Set to path of `xmkmf' if not in $PATH
 #				  Default: xmkmf -a
-# USE_XLIB		- If set, this port uses the X libraries. In the USE_LINUX
-#				  case the linux X libraries are referenced.
 # USE_DISPLAY	- If set, this ports requires a (virtual) X11 environment
 #				  setup. If the environment variable DISPLAY Is not set,
 #				  then an extra build dependency on Xvfb is added. Further,
@@ -1192,9 +1188,6 @@ MAINTAINER?=	ports@FreeBSD.org
 ARCH!=	${UNAME} -p
 .endif
 
-# Kludge for pre-3.0 systems
-MACHINE_ARCH?=	i386
-
 # Get the operating system type
 .if !defined(OPSYS)
 OPSYS!=	${UNAME} -s
@@ -2105,21 +2098,12 @@ IGNORE=	uses unknown USE_BISON construct
 .include "${PORTSDIR}/Mk/bsd.cmake.mk"
 .endif
 
-.if exists(${PORTSDIR}/../Makefile.inc)
-.include "${PORTSDIR}/../Makefile.inc"
+.if exists(${PORTSDIR}/Makefile.inc)
+.include "${PORTSDIR}/Makefile.inc"
 USE_SUBMAKE=	yes
 .endif
 
-.if defined(USE_XLIB)
-.	if defined(USE_LINUX)
-RUN_DEPENDS+=	${LINUXBASE}/usr/X11R6/lib/libXrender.so.1:${PORTSDIR}/x11/linux-xorg-libs
-.	else
-BUILD_DEPENDS+=	${LOCALBASE}/libdata/xorg/libraries:${X_LIBRARIES_PORT}
-RUN_DEPENDS+=	${LOCALBASE}/libdata/xorg/libraries:${X_LIBRARIES_PORT}
-.	endif
-.endif
-
-.if defined(USE_XLIB) || defined(USE_XORG)
+.if defined(USE_XORG)
 # Add explicit X options to avoid problems with false positives in configure
 .if defined(GNU_CONFIGURE)
 CONFIGURE_ARGS+=--x-libraries=${LOCALBASE}/lib --x-includes=${LOCALBASE}/include
@@ -4333,10 +4317,10 @@ _INSTALL_SEQ=	install-message check-inst
 _INSTALL_SUSEQ= check-umask install-mtree pre-su-install \
 				pre-su-install-script create-users-groups do-install \
 				install-desktop-entries install-license install-rc-script \
-				post-install post-install-script add-plist-info \
-				add-plist-docs add-plist-examples add-plist-data \
-				add-plist-post fix-plist-sequence compress-man \
-				install-ldconfig-file fake-pkg security-check
+				post-install post-install-script add-plist-buildinfo \
+				add-plist-info add-plist-docs add-plist-examples \
+				add-plist-data add-plist-post fix-plist-sequence \
+				compress-man install-ldconfig-file fake-pkg security-check
 _PACKAGE_DEP=	install
 _PACKAGE_SEQ=	package-message pre-package pre-package-script \
 				do-package post-package-script
@@ -5814,6 +5798,13 @@ add-plist-data:
 .endif
 .endif
 
+.if defined(PACKAGE_BUILDING)
+.if !target(add-plist-buildinfo)
+add-plist-buildinfo:
+	@${ECHO_CMD} "@comment Build details:  ${BUILDHOST}|${JAIL}|${BUILD}|${PORTSTREE}|${BUILDDATE}" >> ${TMPPLIST}
+.endif
+.endif
+
 .if !target(add-plist-info)
 add-plist-info:
 # Process GNU INFO files at package install/deinstall time
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2012-09-06 22:02:20 UTC
State Changed
From-To: analyzed->closed

Committed, thanks.
Comment 6 Mike Kelly 2012-09-07 00:02:32 UTC
This patch seems to break any port upgrades I've tried with
`portupgrade`, with this error:

  make: don't know how to make add-plist-buildinfo. Stop

The attached patch seems to fix it.

-- 
Mike Kelly