aboutsummaryrefslogtreecommitdiffstats
path: root/devel/cscout/Makefile
blob: 7fcfa19faf8ee444bfc6079dcb9bf7acc5a37bdf (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
# New ports collection makefile for:    cscout
# Date created:         07. Jul 2003
# Whom:             netchild@FreeBSD.org
#
# $FreeBSD$
#

PORTNAME=   cscout
PORTVERSION=    2.2
CATEGORIES= devel
MASTER_SITES=   http://www.spinellis.gr/cscout/ \
        http://www.dmst.aueb.gr/dds/cscout/
DISTFILES=  ${PORTNAME}-${PORTVERSION}-neutral${EXTRACT_SUFX} \
        ${PORTNAME}-${PORTVERSION}-fbsd-${ARCH}${EXTRACT_SUFX}

MAINTAINER= dds@FreeBSD.org
COMMENT=    Source code analyzer and refactoring browser for C program collections

WRKSRC=     ${WRKDIR}/${PORTNAME}-${PORTVERSION}
NO_BUILD=   yes
ONLY_FOR_ARCHS= i386 amd64 sparc64
ONLY_FOR_ARCHS_REASON=  The port fetches and installs precompiled binaries

MAN1=   cscout.1 cswc.1

.include <bsd.port.pre.mk>

.if ${OSVERSION} < 600000
IGNORE=     fails to work on versions of FreeBSD before 6.0 (it installs FreeBSD 6.x binaries)
.endif

post-patch:
.if exists(/usr/include/g++/)
    ${REINPLACE_CMD} -i "" -e 's:g++-3:g++:g' \
        ${WRKSRC}/etc/cscout_incs.FBSD_GCC
.endif
    (${SED} -n '1,/Platform defines begin/p' \
        ${WRKSRC}/etc/cscout_defs.FBSD_GCC && \
        ${CPP} -O -dM /dev/null | ${SORT} && \
        ${SED} -n '/Platform defines end/,$$p' \
            ${WRKSRC}/etc/cscout_defs.FBSD_GCC ) \
            > ${WRKDIR}/cscout_defs.h
    ${CP} ${WRKDIR}/cscout_defs.h ${WRKSRC}/etc/cscout_defs.FBSD_GCC

do-install:
    ${INSTALL_PROGRAM} ${WRKSRC}/bin/cscout ${PREFIX}/bin
    ${INSTALL_SCRIPT} ${WRKSRC}/bin/cswc ${PREFIX}/bin
    ${INSTALL_SCRIPT} ${WRKSRC}/bin/csmake ${PREFIX}/bin
    cd ${WRKSRC}/etc && ${FIND} . -print | \
       ${CPIO} -pdu -R ${BINOWN}:${BINGRP} --quiet ${PREFIX}/etc/${PORTNAME}
# don't overwrite an existing config
.if !exists(${PREFIX}/etc/${PORTNAME}/cscout_incs.h)
    ${INSTALL_DATA} ${WRKSRC}/etc/cscout_incs.FBSD_GCC ${PREFIX}/etc/${PORTNAME}/cscout_incs.h
.endif
.if !exists(${PREFIX}/etc/${PORTNAME}/cscout_defs.h)
    ${INSTALL_DATA} ${WRKDIR}/cscout_defs.h ${PREFIX}/etc/${PORTNAME}/cscout_defs.h
.endif
.if !defined(NOPORTDOCS)
    cd ${WRKSRC}/example && ${FIND} . -print | \
        ${CPIO} -pdu -R ${BINOWN}:${BINGRP} --quiet ${EXAMPLESDIR}
    cd ${WRKSRC}/doc && ${FIND} . -print | \
        ${CPIO} -pdu -R ${BINOWN}:${BINGRP} --quiet ${DOCSDIR}
.endif
.if !defined(NO_INSTALL_MANPAGES)
.for i in ${MAN1}
    ${INSTALL_MAN} ${WRKSRC}/man/${i} ${PREFIX}/man/man1
.endfor
.endif

.include <bsd.port.post.mk>