Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Aug 2014 14:09:42 +0000 (UTC)
From:      "Jason E. Hale" <jhale@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r364786 - head/misc/cuecat
Message-ID:  <201408131409.s7DE9gut049344@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhale
Date: Wed Aug 13 14:09:42 2014
New Revision: 364786
URL: http://svnweb.freebsd.org/changeset/ports/364786
QAT: https://qat.redports.org/buildarchive/r364786/

Log:
  - Support staging
  - WITHOUT_X11 -> X11 option
  - Compile python code in do-build target
  - USE_PYTHON -> USES=python
  - Use USES=shebangfix instead of pre-install sed(1) commands
  - Use plist subbing instead of weird post-install hack
  - Bump PORTREVISION

Modified:
  head/misc/cuecat/Makefile
  head/misc/cuecat/pkg-plist

Modified: head/misc/cuecat/Makefile
==============================================================================
--- head/misc/cuecat/Makefile	Wed Aug 13 12:57:29 2014	(r364785)
+++ head/misc/cuecat/Makefile	Wed Aug 13 14:09:42 2014	(r364786)
@@ -3,52 +3,44 @@
 
 PORTNAME=	cuecat
 PORTVERSION=	1.1
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	misc python
 MASTER_SITES=	http://www.mired.org/downloads/
 
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Tools for decoding and using the output of a :Cue:Cat(TM) wand scanner
 
-.if !defined(WITHOUT_X11)
-RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}tkinter>0:${PORTSDIR}/x11-toolkits/py-tkinter \
-		${PYTHON_SITELIBDIR}/Pmw/__init__.py:${PORTSDIR}/x11-toolkits/py-Pmw
-.endif
+USES=		python shebangfix
+
+SHEBANG_FILES=	*.py
+python_OLD_CMD=	/usr/opt/bin/python
 
-NO_BUILD=	yes
-MAN1=		cuecat.1
-.if !defined(WITHOUT_X11)
-MAN1+=		xcuecat.1
-.endif
-USE_PYTHON=	yes
 WRKSRC=		${WRKDIR}/cuecat
 
-NO_STAGE=	yes
-pre-install:
-	@${MV} ${WRKSRC}/cuecat.py ${WRKSRC}/cuecat.py-orig
-	@${SED} 's;/usr/opt/bin/python;${PYTHON_CMD};' ${WRKSRC}/cuecat.py-orig >${WRKSRC}/cuecat.py
-	@${MV} ${WRKSRC}/barcode.py ${WRKSRC}/barcode.py-orig
-	@${SED} 's;/usr/opt/bin/python;${PYTHON_CMD};' ${WRKSRC}/barcode.py-orig >${WRKSRC}/barcode.py
-.if !defined(WITHOUT_X11)
-	@${MV} ${WRKSRC}/xcuecat.py ${WRKSRC}/xcuecat.py-orig
-	@${SED} 's;/usr/opt/bin/python;${PYTHON_CMD};' ${WRKSRC}/xcuecat.py-orig >${WRKSRC}/xcuecat.py
-.endif
+OPTIONS_DEFINE=	X11
+OPTIONS_DEFAULT=X11
+OPTIONS_SUB=	yes
+
+X11_RUN_DEPENDS=${PYTHON_PKGNAMEPREFIX}tkinter>0:${PORTSDIR}/x11-toolkits/py-tkinter \
+		${PYTHON_PKGNAMEPREFIX}Pmw>0:${PORTSDIR}/x11-toolkits/py-Pmw
+
+.include <bsd.port.options.mk>
+
+do-build:
+	${PYTHON_CMD} -m compileall ${WRKSRC}
+	${PYTHON_CMD} -O -m compileall ${WRKSRC}
 
 do-install:
-	${INSTALL_SCRIPT} ${WRKSRC}/cuecat.py ${PYTHON_SITELIBDIR}
-	${INSTALL_SCRIPT} ${WRKSRC}/barcode.py ${PYTHON_SITELIBDIR}
-	${PYTHON_CMD} -O -c "import barcode, cuecat"
-	${LN} -sf ${PYTHON_SITELIBDIR}/cuecat.py ${PREFIX}/bin/cuecat
-	${INSTALL_MAN} ${WRKSRC}/cuecat.1 ${PREFIX}/man/man1
-.if !defined(WITHOUT_X11)
-	${INSTALL_SCRIPT} ${WRKSRC}/xcuecat.py ${PREFIX}/bin/xcuecat
-	${INSTALL_MAN} ${WRKSRC}/xcuecat.1 ${PREFIX}/man/man1
-.endif
-
-.if defined(WITHOUT_X11)
-post-install:
-	$(MV) ${TMPPLIST} ${TMPPLIST}.orig
-	${GREP} -v xcuecat ${TMPPLIST}.orig > ${TMPPLIST}
+	@${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}
+.for i in barcode cuecat
+	${INSTALL_SCRIPT} ${WRKSRC}/${i}.py ${STAGEDIR}${PYTHON_SITELIBDIR}
+	${INSTALL_DATA} ${WRKSRC}/${i}.py[co] ${STAGEDIR}${PYTHON_SITELIBDIR}
+.endfor
+	${LN} -sf ${PYTHON_SITELIBDIR}/cuecat.py ${STAGEDIR}${PREFIX}/bin/cuecat
+	${INSTALL_MAN} ${WRKSRC}/cuecat.1 ${STAGEDIR}${PREFIX}/man/man1
+.if ${PORT_OPTIONS:MX11}
+	${INSTALL_SCRIPT} ${WRKSRC}/xcuecat.py ${STAGEDIR}${PREFIX}/bin/xcuecat
+	${INSTALL_MAN} ${WRKSRC}/xcuecat.1 ${STAGEDIR}${PREFIX}/man/man1
 .endif
 
 .include <bsd.port.mk>

Modified: head/misc/cuecat/pkg-plist
==============================================================================
--- head/misc/cuecat/pkg-plist	Wed Aug 13 12:57:29 2014	(r364785)
+++ head/misc/cuecat/pkg-plist	Wed Aug 13 14:09:42 2014	(r364786)
@@ -1,6 +1,10 @@
 bin/cuecat
-bin/xcuecat
+%%X11%%bin/xcuecat
+man/man1/cuecat.1.gz
+%%X11%%man/man1/xcuecat.1.gz
 %%PYTHON_SITELIBDIR%%/barcode.py
+%%PYTHON_SITELIBDIR%%/barcode.pyc
 %%PYTHON_SITELIBDIR%%/barcode.pyo
 %%PYTHON_SITELIBDIR%%/cuecat.py
+%%PYTHON_SITELIBDIR%%/cuecat.pyc
 %%PYTHON_SITELIBDIR%%/cuecat.pyo



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408131409.s7DE9gut049344>