aboutsummaryrefslogtreecommitdiffstats
path: root/deskutils/gbirthday/Makefile
blob: 33f292fd89e47eef04a4eadfb5532a835f402811 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Created by: Alexander Logvinov <ports@logvinov.com>
# $FreeBSD$

PORTNAME=   gbirthday
PORTVERSION=    0.6.7
CATEGORIES= deskutils gnome
MASTER_SITES=   SF

MAINTAINER= rm@FreeBSD.org
COMMENT=    Birthday reminder for Evolution and some others

LICENSE=    GPLv2

OPTIONS_DEFINE= EVO THUNDER MYSQL NOTIFY
OPTIONS_DEFAULT=EVO
EVO_DESC=   Evolution support
THUNDER_DESC=   Thunderbird/Sunbird support

USE_XZ=     yes
USE_PYTHON_RUN= -2.7
USE_GNOME=  pygtk2 desktopfileutils

NO_STAGE=   yes
.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MNLS}
USES+=      gettext
USE_GNOME+= intltool
LANGUAGES=  de en es fr gl it pl pt ru sk
PLIST_SUB+= NLS=""
.else
PLIST_SUB+= NLS="@comment "
.endif

.if ${PORT_OPTIONS:MEVO}
RUN_DEPENDS+=   ${PYTHON_PKGNAMEPREFIX}bsddb>0:${PORTSDIR}/databases/py-bsddb
USE_GNOME+= evolutiondataserver
.endif

.if ${PORT_OPTIONS:MTHUNDER}
RUN_DEPENDS+=   ${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3
.endif

.if ${PORT_OPTIONS:MMYSQL}
RUN_DEPENDS+=   ${PYTHON_PKGNAMEPREFIX}MySQLdb>=0:${PORTSDIR}/databases/py-MySQLdb
.endif

.if ${PORT_OPTIONS:MNOTIFY}
RUN_DEPENDS+=   ${PYTHON_PKGNAMEPREFIX}notify>0:${PORTSDIR}/devel/py-notify
.endif

post-patch:
    @${REINPLACE_CMD} -e 's|.mozilla-thunderbird|.thunderbird|g' \
        ${WRKSRC}/src/${PORTNAME}/databases/lightning.py
    @${REINPLACE_CMD} -e 's|@VER@|${PORTVERSION}|g' \
        ${WRKSRC}/src/${PORTNAME}/__init__.py
    @${REINPLACE_CMD} -e 's|/usr/bin/python|${PYTHON_CMD}|g' \
        ${WRKSRC}/src/gb
.if ! ${PORT_OPTIONS:MNLS}
    @${REINPLACE_CMD} -e 's|_Comment|Comment|' ${WRKSRC}/${PORTNAME}.desktop.in
.endif

do-build:
.if ${PORT_OPTIONS:MNLS}
    @-intltool-merge -d ${WRKSRC}/po ${WRKSRC}/${PORTNAME}.desktop.in \
        ${WRKSRC}/${PORTNAME}.desktop
    @(for lang in ${LANGUAGES} ; do \
        cd ${WRKSRC}/po ; \
        ${LOCALBASE}/bin/msgfmt $$lang.po -o $$lang.mo ; \
    done)
.endif

do-install:
    ${INSTALL_DATA} ${WRKSRC}/pics/${PORTNAME}.png ${PREFIX}/share/pixmaps
    ${INSTALL_SCRIPT} ${WRKSRC}/src/gb ${PREFIX}/bin/${PORTNAME}
    @${MKDIR} ${PYTHONPREFIX_SITELIBDIR}/${PORTNAME}/databases
    @${MKDIR} ${PYTHONPREFIX_SITELIBDIR}/${PORTNAME}/pics
    ${INSTALL_DATA} ${WRKSRC}/src/${PORTNAME}/*.py ${PYTHONPREFIX_SITELIBDIR}/${PORTNAME}
    ${INSTALL_DATA} ${WRKSRC}/src/${PORTNAME}/databases/*.py ${PYTHONPREFIX_SITELIBDIR}/${PORTNAME}/databases
    ${INSTALL_DATA} ${WRKSRC}/src/${PORTNAME}/pics/*.png ${PYTHONPREFIX_SITELIBDIR}/${PORTNAME}/pics
    @${MKDIR} ${PREFIX}/share/applications
.if ${PORT_OPTIONS:MNLS}
    @(for lang in ${LANGUAGES} ; do \
        ${MKDIR} ${PREFIX}/share/locale/$$lang/LC_MESSAGES ; \
        ${INSTALL_DATA} ${WRKSRC}/po/$$lang.mo \
        ${PREFIX}/share/locale/$$lang/LC_MESSAGES/${PORTNAME}.mo ; \
    done)
    ${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.desktop ${PREFIX}/share/applications
.else
    ${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.desktop.in \
        ${PREFIX}/share/applications/${PORTNAME}.desktop
.endif

post-install:
    @-update-desktop-database

.include <bsd.port.mk>