1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-21 00:25:50 +00:00

- 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
This commit is contained in:
Jason E. Hale 2014-08-13 14:09:42 +00:00
parent 9d38b423d3
commit 23ead34a2c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=364786
2 changed files with 32 additions and 36 deletions

View File

@ -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>

View File

@ -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