aboutsummaryrefslogtreecommitdiffstats
path: root/misc/xdg-menu/Makefile
blob: 1c213597d4e0476d4e8a228fb1c93484fab4403e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Created by: nemysis <nemysis@gmx.ch>
# $FreeBSD$

PORTNAME=   xdg-menu
PORTVERSION=    1.5
PORTREVISION=   2
CATEGORIES= misc
MASTER_SITES=   SF/${PORTNAME}/${PORTNAME}/${PORTVERSION} \
        SF/nemysisfreebsdp/${CATEGORIES}/:icons
DISTFILES=  XDG-Menu-${DISTVERSION}.tgz \
        ${PORTNAME}.png:icons
DIST_SUBDIR=    python
EXTRACT_ONLY=   XDG-Menu-${DISTVERSION}.tgz

MAINTAINER= nemysis@FreeBSD.org
COMMENT=    ROX panel applet that displays an applications menu button

LICENSE=    GPLv2

RUN_DEPENDS=    ${LOCALBASE}/bin/rox:${PORTSDIR}/x11-fm/rox-filer \
        ${PYTHON_PKGNAMEPREFIX}xdg>=0:${PORTSDIR}/devel/py-xdg \
        ${PYTHON_PKGNAMEPREFIX}dbus>=0:${PORTSDIR}/devel/py-dbus

WRKSRC=     ${WRKDIR}/XDG-Menu
DATADIR=    ${PREFIX}/apps/XDG-Menu

USE_PYTHON= yes
INSTALLS_ICONS= yes

PORTDOCS=   *

DESKTOP_ENTRIES="XDG-Menu" "${COMMENT}" ${PORTNAME} \
        "${PORTNAME}" "Application;System;" false

OPTIONS_DEFINE= ROX
ROX_DESC=   Enable ROX panel applet support

SUB_FILES=  ${PORTNAME}

.include <bsd.port.options.mk>

post-patch:
    @${REINPLACE_CMD} -i '' 's|/usr/lib|../../lib|' ${WRKSRC}/findrox.py

.if ! ${PORT_OPTIONS:MROX}
    @${REINPLACE_CMD} -i '' '/if not rox.confirm/,/sys.exit/s/^/#/' ${WRKSRC}/AppRun
    @${ECHO_MSG}
    @${ECHO_MSG} "You have not enabled ROX panel applet support"
    @${ECHO_MSG}
    @${FIND} ${WRKSRC} -name "*.bak" -delete
.endif

do-build:
    @${PYTHON_CMD} -m compileall ${WRKSRC}
    @${PYTHON_CMD} -O -m compileall ${WRKSRC}

do-install:
    ${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/

    @${MKDIR} ${STAGEDIR}${DATADIR}
    (cd ${WRKSRC} && ${CP} -r Messages .DirIcon AppInfo.xml AppRun AppletRun \
        Options.xml Messages python *.py *.pyc *.pyo ${STAGEDIR}${DATADIR})

    ${INSTALL_DATA} ${_DISTDIR}/${PORTNAME}.png ${STAGEDIR}${PREFIX}/share/pixmaps/

    @${MKDIR} ${STAGEDIR}${DOCSDIR}
    ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/Help/|} ${STAGEDIR}${DOCSDIR}

.include <bsd.port.mk>