summaryrefslogtreecommitdiff
path: root/www/MT/Makefile
blob: 01ca5168f75f79845edd3120336238f650ad2199 (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
# New ports collection makefile for:	MT
# Date created:			Fri Jun 13 16:39:20 CST 2003
# Whom:				Foxfair Hu <foxfair@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=	MT
PORTVERSION=	2.661
PORTREVISION=	1
CATEGORIES=	www

MAINTAINER=	ports@FreeBSD.org
COMMENT=	A web-based personal publishing system like weblogs

DISTNAME=	${PORTNAME}-${PORTVERSION}-full-lib
DOWNLOAD_URL?=	http://www.movabletype.org/download.shtml

DATADIR=	www/data/mt
CGIDIR=		www/cgi-bin/mt

.if defined(WITH_MYSQL)
DB_DIR=		/var/db/mysql/blog
USE_MYSQL=	yes
.elif defined(WITH_POSTGRES)
DB_DIR=		${PREFIX}/pgsql/data/blog	# Or somewhere defined in $PGDATA
RUN_DEPENDS=	postgres:${PORTSDIR}/databases/postgresql7
.else
DB_DIR=		${PREFIX}/${CGIDIR}/db
WITH_DEFAULTDB=	yes
.endif

PLIST_SUB+=	DATADIR=${DATADIR} CGIDIR=${CGIDIR}

USE_PERL5_RUN=	yes
NO_BUILD=	yes
NO_PACKAGE=	"not yet"

.include <bsd.port.pre.mk>

.if !exists(${DISTDIR}/${DISTNAME}${EXTRACT_SUFX}) && !defined(PACKAGE_BUILDING)
ECHO_MSG=/usr/bin/printf
IGNORE=	:\n\
Because of licensing restrictions, you must fetch the source distribution\n\
manually.  Please access ${DOWNLOAD_URL}, follow\n\
the registration instructions, select \"full version, with libraries\" and\n\
\"gzipped tar\", download the file into ${DISTDIR}/, and then\n\
run make again.\n
.endif

do-install:
	@cd ${WRKSRC} && ${FIND} * -name "*.orig" -delete
	@${ECHO_MSG} "Installing cgi ${PREFIX}/${CGIDIR}"
	@${MKDIR} ${PREFIX}/${CGIDIR}
	@cd ${WRKSRC} && ${CP} -R *.cgi lib extlib plugins search_templates \
	  tmpl ${PREFIX}/${CGIDIR}
	@${SED} -e 's#WWW.YOUR-SITE.COM/PATH/TO/MT/#${HOST}/cgi-bin/mt/#g' \
	  -e 's/# StaticWebPath/StaticWebPath/g' \
	  -e 's#path/to/static-files#mt#g' \
	  -e 's/# NoHTMLEntities 1/NoHTMLEntities 1/g' \
	  ${WRKSRC}/mt.cfg > ${PREFIX}/${CGIDIR}/mt.cfg.dist
	[ -e ${PREFIX}/${CGIDIR}/mt.cfg ] || ${CP} ${PREFIX}/${CGIDIR}/mt.cfg.dist ${PREFIX}/${CGIDIR}/mt.cfg
	${SED} -e 's#$$MT_DIR, .schemas.#"${PREFIX}/${DATADIR}/schemas"#' \
	  ${WRKSRC}/mt-load.cgi > ${PREFIX}/${CGIDIR}/mt-load.cgi
	@${ECHO_MSG} "Installing data ${PREFIX}/${DATADIR}"
	@${MKDIR} ${PREFIX}/${DATADIR}
	@cd ${WRKSRC} && ${CP} -R LICENSE LICENSE-COMMERCIAL docs images \
	  index.html schemas styles.css \
	  ${PREFIX}/${DATADIR}
.if defined(WITH_DEFAULTDB)
	@${MKDIR} -m 755 ${DB_DIR}
	@${CHOWN} -R www:www ${DB_DIR}
.endif
	@${CHOWN} -R www:www ${PREFIX}/${CGIDIR} ${PREFIX}/${DATADIR}

post-install:
	@${CAT} ${PKGMESSAGE}
	@${ECHO_MSG} "Please read the docs to initialize a blog DB in ${DB_DIR}"

.include <bsd.port.post.mk>