Update misc/metalink-editor to version 1.2.0_6
[dports.git] / misc / metalink-editor / Makefile
1 # Created by: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
2 # $FreeBSD$
3
4 PORTNAME=       metalink
5 PORTVERSION=    1.2.0
6 PORTREVISION=   6
7 CATEGORIES=     misc
8 MASTER_SITES=   SF/${PORTNAME}s/Metalink%20Editor/${PORTVERSION}
9 PKGNAMESUFFIX?= -editor
10 DISTNAME=       ${PORTNAME}editor-${PORTVERSION}
11
12 MAINTAINER=     ports@FreeBSD.org
13 COMMENT=        GUI editor to create and edit metalinks
14
15 LICENSE=        GPLv2
16 LICENSE_FILE=   ${WRKDIR}/license.txt
17
18 USES=           dos2unix zip
19 DOS2UNIX_REGEX= .*\.txt
20 NO_WRKSUBDIR=   yes
21 USE_PYTHON=     yes
22 USE_PYDISTUTILS=        yes
23 PYDISTUTILS_EGGINFO=    metalink_editor-${PORTVERSION}-py${PYTHON_VER}.egg-info
24 USE_WX=         2.6
25 WX_COMPS=       python
26
27 DATADIR=        ${PREFIX}/share/${PORTNAME}${PKGNAMESUFFIX}
28
29 DESKTOP_ENTRIES=        "Metalink editor" \
30                         "GUI editor to create and edit metalinks" \
31                         "${DATADIR}/metalink.png" \
32                         "metalink_editor.py" \
33                         "Network;FileTransfer;" \
34                         true
35
36 #
37 # Documents to install
38 #
39 DOC_FILES=      \
40                 readme.txt
41 #
42 .ifndef(NOPORTDOCS)
43 PORTDOCS=       *
44 .endif
45
46 NO_STAGE=       yes
47 post-extract:
48 # Create a package to avoid namespace pollution
49         @${MKDIR} ${WRKSRC}/Metalink_editor
50         @${TOUCH} ${WRKSRC}/Metalink_editor/__init__.py
51         @${MV} ${WRKSRC}/metalink.py ${WRKSRC}/Metalink_editor/
52
53 post-patch:
54 # Correct location of image files
55         @${REINPLACE_CMD} -E \
56                 -e 's|%%DATADIR%%|${DATADIR}|' \
57                 ${WRKSRC}/metalink_editor.py
58
59 pre-configure:
60 # Prepare new setup.py
61         @${SED} \
62                 -e 's|%%PYTHON_CMD%%|${PYTHON_CMD}|' \
63                 -e 's|%%VERSION%%|${PORTVERSION}|' \
64                 ${FILESDIR}/setup.py \
65                 > ${WRKSRC}/${PYSETUP}
66
67 post-install:
68 # docs
69 .ifndef(NOPORTDOCS)
70         @${MKDIR} ${DOCSDIR}
71 .for file in ${DOC_FILES}
72         @${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR}
73 .endfor
74 .endif
75 # fix installation permissions for restritive umask(1)
76         @${FIND} \
77                 ${DATADIR} \
78                 ${PYTHONPREFIX_SITELIBDIR}/Metalink_editor \
79                 -type f -exec \
80                 ${CHMOD} ${SHAREMODE} {} \;
81
82 .include <bsd.port.mk>