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