aboutsummaryrefslogtreecommitdiffstats
path: root/www/tidy-devel/Makefile
blob: 067cf02de4083db4585e25632104f078a887c816 (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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# New ports collection makefile for:    tidy
# Date created:     27 Oct 1998
# Whom:         Abel Chow <achow@transoft.net>
#
# $FreeBSD$
#

PORTNAME?=  tidy
DISTVERSION=    070211-cvs
CATEGORIES= www
MASTER_SITES=   ${MASTER_SITE_LOCAL}
#MASTER_SITES=  http://tidy.sourceforge.net/src/%SUBDIR%/   \
#       http://tidy.sourceforge.net/docs/:docs
#MASTER_SITE_SUBDIR=    . old
MASTER_SITE_SUBDIR= thierry
PKGNAMESUFFIX?= -devel

MAINTAINER?=    thierry@FreeBSD.org
COMMENT?=   Utility to clean up and pretty print HTML/XHTML/XML

USE_BZIP2=  yes

SLAVEDIRS=  www/tidy-lib
WRKSRC=     ${WRKDIR}/${PORTNAME}

.if !defined(WITH_SHLIB)
USE_GMAKE=  yes
PLIST_SUB=  SHLIB="@comment " NSHLIB=""
.else
USE_AUTOTOOLS=  automake:15 autoconf:253 libtool:15
AUTOMAKE_ARGS+= -a -c --foreign
CONFIGURE_TARGET=    --target=${MACHINE_ARCH}-portbld-freebsd${OSREL}
USE_LDCONFIG=   yes
PLIST_SUB=  SHLIB="" NSHLIB="@comment "
.endif

DESCR=      ${.CURDIR}/pkg-descr

BIN2STRIP=  tidy tab2space

.if !defined(WITH_SHLIB)
MAN1=       tidy.1
.endif

.if !defined(NOPORTDOCS)
. if !defined(WITH_SHLIB)
BUILD_DEPENDS+= xsltproc:${PORTSDIR}/textproc/libxslt
ALL_TARGET= all doc
DOCFILES=   quickref.html
. endif
DOCFILES+=  Overview.html checked_by_tidy.gif faq.html grid.gif pending.html    \
        release-notes.html tidy.css tidy.gif
.endif

.if defined(MAINTAINER_MODE)

CVSROOT=    ":pserver:anonymous@tidy.cvs.sourceforge.net:/cvsroot/tidy"
CVS_PASSFILE=   ${WRKDIR}/temp-cvs-passfile

getcvs:
    ${MKDIR} ${WRKDIR}/cvs
    ${ECHO_CMD} ${CVSROOT} A > ${CVS_PASSFILE}
    cd ${WRKDIR}/cvs && \
    CVSROOT=${CVSROOT} CVS_PASSFILE=${CVS_PASSFILE} cvs -z3 co -P tidy

tarball:
    ${RM} -rf ${WRKDIR}/cvs/tidy/CVSROOT
    ${FIND} ${WRKDIR}/cvs -name CVS | ${XARGS} ${RM} -rf
    cd ${WRKDIR}/cvs && \
    ${TAR} cfj ${_DISTDIR}${DISTFILES} tidy

.endif

post-patch:
    ${CHMOD} a+x ${WRKSRC}/test/testxml.sh
.if !defined(WITH_SHLIB)
    ${CP} ${WRKSRC}/build/gmake/Makefile ${WRKSRC}
.else
    ${CP} -R -f ${WRKSRC}/build/gnuauto/* ${WRKSRC}
. for t in testone.sh testaccessone.sh
    ${REINPLACE_CMD} -e 's|../bin/tidy|../console/tidy|'    \
        ${WRKSRC}/test/${t}
. endfor
.endif

patch-autotools::
.if defined(WITH_SHLIB)
    (cd ${WRKSRC}               \
    && ${LIBTOOLIZE} --force --copy     \
    && ${ACLOCAL}               \
    && ${REINPLACE_CMD} -e '/^_LT_AC_SHELL_INIT/d' aclocal.m4)
    (cd ${PATCH_WRKSRC};            \
    for ltf in ${LIBTOOLFILES}; do      \
        ${CP} $$ltf $$ltf.tmp;  \
        ${SED} -e "s^\$$ac_aux_dir/ltconfig^${LTCONFIG}^g" \
            -e "/^ltmain=/!s^\$$ac_aux_dir/ltmain.sh^${LIBTOOLFLAGS} ${LTMAIN}^g" \
            $$ltf.tmp > $$ltf;  \
     done);
.endif

pre-install:
    @if [ -f ${LOCALBASE}/bin/tidy ]; then \
        ${ECHO_MSG} "" ; \
        ${ECHO_MSG} "Conflict: another tidy has been found; please deinstall it." ; \
        ${ECHO_MSG} "(`pkg_info -W ${LOCALBASE}/bin/tidy`)" ; \
        ${ECHO_MSG} "" ; \
        ${FALSE} ; \
    fi

post-install:
.for pgm in ${BIN2STRIP}
    ${STRIP_CMD} ${PREFIX}/bin/${pgm}
.endfor
.if defined(WITH_SHLIB)
    ${STRIP_CMD} ${PREFIX}/lib/libtidy-0.99.so.0
.endif
.if !defined(NOPORTDOCS)
    @${ECHO_MSG} "===>   Installing documentation for ${PKGNAME}"
    ${MKDIR} ${DOCSDIR}
    ${INSTALL_DATA} ${DOCFILES:S|^|${WRKSRC}/htmldoc/|} ${DOCSDIR}
    @${ECHO_MSG} "===>   Documentation installed in ${DOCSDIR}."
.endif

regression-test:
.for t in testaccess.sh testall.sh testxml.sh
    cd ${WRKSRC}/test && ./${t}
.endfor

.include <bsd.port.mk>