aboutsummaryrefslogtreecommitdiffstats
path: root/misc/lingoteach/Makefile
blob: ab50cdef598ac9088b871b061929eaca29e5716d (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
# New ports collection makefile for:   lingoteach
# Date created:        01 September 2002
# Whom:                Marcus von Appen
#
# $FreeBSD$
#

PORTNAME=   lingoteach
PORTVERSION=    0.3.9
PORTREVISION=   13
CATEGORIES= misc
MASTER_SITES=   SF/${PORTNAME}/OldFiles
DISTFILES=  ${PORTNAME}-ui-${PORTVERSION}.tar.gz
.if defined(WITH_SOUND)
DISTFILES+= ${PORTNAME}-sound-${SOUNDV}.tar.gz
.endif

MAINTAINER= mva@FreeBSD.org
COMMENT=    A language teaching program with sound

LIB_DEPENDS=    lingoteach.3:${PORTSDIR}/textproc/liblingoteach

WRKSRC=     ${WRKDIR}/${PORTNAME}-ui-${PORTVERSION}

USE_GNOME=  gtk20
GNU_CONFIGURE=  yes
USE_GMAKE=  yes

CONFIGURE_ENV=  LIBS="-L${LOCALBASE}/lib"
CPPFLAGS+=  -I${LOCALBASE}/include

# sound version
SOUNDV=         0.3.9

.if defined(WITH_DEBUG)
CONFIGURE_ARGS+=    --enable-debug
.endif

.if defined(WITH_SOUND)
PLIST=      ${WRKDIR}/plist
.endif

.include <bsd.port.pre.mk>

pre-everything::
    @${ECHO_CMD} ""
    @${ECHO_CMD} "  Available options for lingoteach:"
    @${ECHO_CMD} ""
    @${ECHO_CMD} "       WITH_SOUND download additional sounds"
    @${ECHO_CMD} "              for lingoteach"
    @${ECHO_CMD} "       WITH_DEBUG enable debugging"
    @${ECHO_CMD} ""

post-patch::
.if defined(NOPORTDOCS)
    @${REINPLACE_CMD} -e 's|^SUBDIRS = intl src po data doc|SUBDIRS = src po data|g' \
        ${WRKSRC}/Makefile.in
.else
    @${REINPLACE_CMD} -e 's|^SUBDIRS = intl src po data doc|SUBDIRS = src po data doc|g' \
        ${WRKSRC}/Makefile.in
.endif

.if defined(WITH_SOUND)
pre-install::
    @${CAT} pkg-plist | ${SED} '/@dirrm/d' > ${PLIST}; \
    cd ${WRKDIR}/${PORTNAME}-sound-${SOUNDV}/data; \
    ${FIND} . -type f \! -name "Make*" | ${CUT} -c2- | \
    ${SED} 's|^|${DATADIR:S,${PREFIX}/,,}/data|' \
    | ${SORT} >> ${PLIST}; \
    ${CAT} ${.CURDIR}/pkg-plist | ${SED} '/%%PORTDOCS%%@dirrm/!d' >> ${PLIST}; \
    cd ${WRKDIR}/${PORTNAME}-sound-${SOUNDV}/data; \
    ${FIND} . -type d | ${CUT} -c2- | ${SED} \
    's|^|@dirrm ${DATADIR:S,${PREFIX}/,,}/data|' | ${SORT} -r >> ${PLIST}; \
    ${ECHO_CMD} "@dirrm ${DATADIR:S,${PREFIX}/,,}" >> ${PLIST};
.endif

.if defined(WITH_SOUND)
post-install::
    cd ${WRKDIR}/${PORTNAME}-sound-${SOUNDV}/data; \
    ${RM} -f Make*; \
    ${CP} -R ${WRKDIR}/${PORTNAME}-sound-${SOUNDV}/data \
    ${DATADIR};
.endif

.include <bsd.port.post.mk>