summaryrefslogtreecommitdiff
path: root/www/geeklog/Makefile
blob: b64ceabaa508974c2414bb15b86576eb2d36b648 (plain)
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
# $NetBSD: Makefile,v 1.16 2007/07/04 20:55:04 jlam Exp $
#

DISTNAME=	geeklog-${VER}
PKGNAME=	geeklog-${VER:C/(sr|-)/./g}
CATEGORIES=	www
MASTER_SITES=	http://www.geeklog.net/filemgmt/upload_dir/

MAINTAINER=	taca@NetBSD.org
HOMEPAGE=	http://www.geeklog.net/
COMMENT=	PHP/MySQL based application for managing dynamic web content

DEPENDS+=	${APACHE_PKG_PREFIX}-${PHP_PKG_PREFIX}>=4.3.3:../../www/ap-php
DEPENDS+=	${PHP_PKG_PREFIX}-mysql>=4.3.0:../../databases/php-mysql

VER=		1.4.1
NO_BUILD=	YES

PKG_GROUPS_VARS+=	APACHE_GROUP
BUILD_DEFS+=		GEEKLOG_SITEBASE

GEEKLOG_SYS=		emailgeeklogstories language plugins readme sql system
GEEKLOG_TMPL_SUB=	backend images/articles images/library \
			images/topics images/userphotos

GEEKLOG_CONF_FILES=	config.php plugins/calendar/config.php \
			plugins/links/config.php plugins/polls/config.php \
			plugins/spamx/config.php \
			plugins/staticpages/config.php \
			system/lib-custom.php

CONF_FILES+=		${GEEKLOG_EXAMPLESDIR}/geeklog.conf \
			${PKG_SYSCONFDIR}/geeklog.conf

.for f in ${GEEKLOG_CONF_FILES}
CONF_FILES_PERMS+=	${GEEKLOG_EXAMPLESDIR}/${f} \
			${GEEKLOG_DIR}/${f} \
			${BINOWN} ${APACHE_GROUP} 0640
.endfor

OWN_DIRS_PERMS+=	${GEEKLOG_DIR}/backups ${BINOWN} ${APACHE_GROUP} 0770 \
			${GEEKLOG_DIR}/data ${BINOWN} ${APACHE_GROUP} 0770 \
			${GEEKLOG_DIR}/logs ${BINOWN} ${APACHE_GROUP} 0775
OWN_DIRS+=		${GEEKLOG_PUB}

FILES_SUBST+=		APACHE_GROUP=${APACHE_GROUP:Q} \
			GEEKLOG_DIR=${GEEKLOG_DIR:Q} \
			GEEKLOG_EXAMPLESDIR=${GEEKLOG_EXAMPLESDIR:Q} \
			GEEKLOG_PUBDIR=${GEEKLOG_PUBDIR:Q} \
			GEEKLOG_ADMIN_DIR=${GEEKLOG_ADMIN_DIR:Q} \
			GEEKLOG_TMPL_SUB=${GEEKLOG_TMPL_SUB:Q} \
			GEEKLOG_TMPL_DIR=${GEEKLOG_TMPL_DIR:Q} \
			PAX=${PAX:Q}

PLIST_SUBST+=		GEEKLOG_BASE=${GEEKLOG_BASE:Q} \
			GEEKLOG_PUB=${GEEKLOG_PUB:Q} \
			GEEKLOG_ADMIN=${GEEKLOG_ADMIN:Q} \
			GEEKLOG_TMPL=${GEEKLOG_TMPL:Q}

.include "../../www/geeklog/Makefile.common"

PKG_SYSCONFSUBDIR?=	geeklog

SUBST_CLASSES+=		paths
SUBST_FILES.paths+=	${WRKDIR}/README ${WRKDIR}/createdb.php
SUBST_FILES.paths+=	${WRKSRC}/config.php ${WRKSRC}/emailgeeklogstories
SUBST_FILES.paths+=	${WRKSRC}/public_html/lib-common.php
SUBST_SED.paths+=	-e 's,@GEEKLOG_DIR@,${GEEKLOG_DIR:Q},g'
SUBST_SED.paths+=	-e 's,@GEEKLOG_EXAMPLESDIR@,${GEEKLOG_EXAMPLESDIR:Q},g'
SUBST_SED.paths+=	-e 's,@GEEKLOG_PUBDIR@,${GEEKLOG_PUBDIR:Q},g'
SUBST_SED.paths+=	-e 's,@GEEKLOG_SITESUBDIR@,${GEEKLOG_SITESUBDIR:Q},g'
SUBST_SED.paths+=	-e 's,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR:Q},g'
SUBST_SED.paths+=	-e 's,@PREFIX@,${PREFIX:Q},g'
SUBST_STAGE.paths=	post-configure

SUBST_CLASSES+=		conf
SUBST_FILES.conf+=	${WRKDIR}/geeklog.conf
SUBST_SED.conf+=	-e 's,@GEEKLOG_DIR@,${GEEKLOG_DIR:Q},g'
SUBST_SED.conf+=	-e 's,@GEEKLOG_PUBDIR@,${GEEKLOG_PUBDIR:Q},g'
.if empty(GEEKLOG_SITEBASE)
SUBST_SED.conf+=	-e '/^Alias/s,^,\#,'
.endif
SUBST_STAGE.conf=	post-configure

INSTALLATION_DIRS=	${GEEKLOG_BASE} ${GEEKLOG_PUB} ${GEEKLOG_TMPL}/images \
			share/examples/geeklog

post-extract:
	${CP} ${FILESDIR}/README ${FILESDIR}/createdb.php \
		${FILESDIR}/geeklog.conf ${WRKDIR}

pre-install:
	${FIND} ${WRKSRC:Q} -name "*.orig*" -exec ${RM} -f {} \;
	cd ${WRKSRC}/public_html; \
		${FIND} ${GEEKLOG_TMPL_SUB} -type f -exec ${CHMOD} -x {} \;
	${CHMOD} 0664 ${WRKSRC}/public_html/backend/geeklog.rss
	cd ${WRKSRC}/system; \
		${FIND} pear -type f -exec ${CHMOD} 0644 {} \;

do-install:
	${INSTALL_DATA_DIR} ${GEEKLOG_DOCDIR}
	${INSTALL_DATA} ${WRKDIR}/README ${GEEKLOG_DOCDIR}
.for f in ${GEEKLOG_CONF_FILES}
	${INSTALL_DATA_DIR} ${GEEKLOG_EXAMPLESDIR}/${f:H}
	${INSTALL_DATA} ${WRKSRC}/${f} ${GEEKLOG_EXAMPLESDIR}/${f}
	${RM} ${WRKSRC}/${f}
.endfor
	${INSTALL_SCRIPT} ${WRKDIR}/createdb.php ${GEEKLOG_DIR}
	${INSTALL_DATA} ${WRKDIR}/geeklog.conf ${GEEKLOG_EXAMPLESDIR}
.for f in ${GEEKLOG_SYS}
	cd ${WRKSRC}; ${PAX} -rw ${f} ${GEEKLOG_DIR}
.endfor
	cd ${WRKSRC}/public_html; \
		${PAX} -rw admin ${GEEKLOG_DIR}; \
		${RM} -rf admin
.for d in ${GEEKLOG_TMPL_SUB}
	cd ${WRKSRC}/public_html; \
		if [ -d ${d} ]; then \
			${PAX} -rw ${d} ${GEEKLOG_TMPL_DIR}; \
			${RM} -rf ${d}; \
		fi
.endfor
	cd ${WRKSRC}/public_html; ${PAX} -rw . ${GEEKLOG_PUBDIR}

.include "../../mk/apache.mk"
.include "../../lang/php/phpversion.mk"
.include "../../mk/bsd.pkg.mk"