diff options
author | jhale <jhale@FreeBSD.org> | 2014-08-13 14:09:42 +0000 |
---|---|---|
committer | jhale <jhale@FreeBSD.org> | 2014-08-13 14:09:42 +0000 |
commit | a9fcfb6d1e470dac5ad5827fc37735df5195fefb (patch) | |
tree | 9e05fa19891f43fc77948f271922ec8056399528 | |
parent | 90ba17bc2923ea375ce9bc541c83b6a0cd211a61 (diff) | |
download | FreeBSD-ports-a9fcfb6d1e470dac5ad5827fc37735df5195fefb.zip FreeBSD-ports-a9fcfb6d1e470dac5ad5827fc37735df5195fefb.tar.gz |
- 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
-rw-r--r-- | misc/cuecat/Makefile | 62 | ||||
-rw-r--r-- | misc/cuecat/pkg-plist | 6 |
2 files changed, 32 insertions, 36 deletions
diff --git a/misc/cuecat/Makefile b/misc/cuecat/Makefile index a7dafcc..3cbacbc 100644 --- a/misc/cuecat/Makefile +++ b/misc/cuecat/Makefile @@ -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 -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 +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> -.if defined(WITHOUT_X11) -post-install: - $(MV) ${TMPPLIST} ${TMPPLIST}.orig - ${GREP} -v xcuecat ${TMPPLIST}.orig > ${TMPPLIST} +do-build: + ${PYTHON_CMD} -m compileall ${WRKSRC} + ${PYTHON_CMD} -O -m compileall ${WRKSRC} + +do-install: + @${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> diff --git a/misc/cuecat/pkg-plist b/misc/cuecat/pkg-plist index e1ae1e0..9b95876 100644 --- a/misc/cuecat/pkg-plist +++ b/misc/cuecat/pkg-plist @@ -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 |