summaryrefslogtreecommitdiff
path: root/www/lighttpd/Makefile
blob: cb5b743eab0485730dd10b57e28d5d1c7b072372 (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
# $NetBSD: Makefile,v 1.100 2021/09/29 19:01:27 adam Exp $

DISTNAME=	lighttpd-1.4.59
PKGREVISION=	4
CATEGORIES=	www
MASTER_SITES=	https://download.lighttpd.net/lighttpd/releases-1.4.x/
EXTRACT_SUFX=	.tar.xz

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	https://www.lighttpd.net/
COMMENT=	Fast, light-footprint HTTP server
LICENSE=	modified-bsd

USE_LIBTOOL=			yes
SHLIBTOOL_OVERRIDE=		# empty
USE_TOOLS+=			pkg-config
GNU_CONFIGURE=			yes
GNU_CONFIGURE_LIBSUBDIR=	${PKGBASE}
CONFIGURE_ARGS+=		--with-pcre
# used for digest auth when no SSL library is available
CONFIGURE_ARGS+=		--without-nettle
TEST_TARGET=			check

DOCDIR=			${PREFIX}/share/doc/${PKGBASE}
EGDIR=			${PREFIX}/share/examples/${PKGBASE}
PKG_SYSCONFSUBDIR=	${PKGBASE}
RCD_SCRIPTS=		lighttpd

.include "options.mk"

CNFS_cmd=		${SED} -ne "s,^share/examples/lighttpd/,,p" PLIST
CNFS=			${CNFS_cmd:sh}
.for file in ${CNFS}
CONF_FILES+=		${EGDIR}/${file:Q} ${PKG_SYSCONFDIR}/${file:Q}
.endfor

BUILD_DEFS+=		VARBASE LIGHTTPD_LOGDIR LIGHTTPD_STATEDIR
BUILD_DEFS+=		LIGHTTPD_CACHEDIR LIGHTTPD_HOMEDIR
BUILD_DEFS+=		LIGHTTPD_USER LIGHTTPD_GROUP

.include "../../mk/bsd.prefs.mk"

LIGHTTPD_CACHEDIR?=	${VARBASE}/cache/lighttpd
LIGHTTPD_HOMEDIR?=	${VARBASE}/lib/lighttpd
LIGHTTPD_LOGDIR?=	${VARBASE}/log/lighttpd
LIGHTTPD_STATEDIR?=	${VARBASE}/run
LIGHTTPD_USER?=		lighttpd
LIGHTTPD_GROUP?=	lighttpd
PKG_GROUPS+=		${LIGHTTPD_GROUP}
PKG_USERS+=		${LIGHTTPD_USER}:${LIGHTTPD_GROUP}
PKG_GROUPS_VARS+=	LIGHTTPD_GROUP
PKG_USERS_VARS+=	LIGHTTPD_USER

INSTALLATION_DIRS+=	${DOCDIR} ${EGDIR} ${EGDIR}/conf.d ${EGDIR}/vhosts.d
OWN_DIRS=		${PKG_SYSCONFDIR}/conf.d
OWN_DIRS+=		${PKG_SYSCONFDIR}/vhosts.d
OWN_DIRS_PERMS=		${LIGHTTPD_LOGDIR} ${LIGHTTPD_USER} ${LIGHTTPD_GROUP} 0755
OWN_DIRS+=		${LIGHTTPD_STATEDIR}

SUBST_CLASSES+=		path
SUBST_MESSAGE.path=	Fixing config file paths
SUBST_STAGE.path=	pre-configure
SUBST_FILES.path=	doc/config/lighttpd.conf doc/lighttpd.8
SUBST_VARS.path=	LIGHTTPD_LOGDIR LIGHTTPD_STATEDIR LIGHTTPD_USER \
			LIGHTTPD_CACHEDIR LIGHTTPD_HOMEDIR              \
			LIGHTTPD_GROUP PKG_SYSCONFDIR VARBASE

post-install:
	set -e; cd ${WRKSRC}/doc;				\
	for f in *.css outdated/*.dot outdated/*.txt; do	\
		${INSTALL_DATA} $$f ${DESTDIR}${DOCDIR};	\
	done;							\
	for f in config/*.conf scripts/*.sh; do			\
		${INSTALL_DATA} $$f ${DESTDIR}${EGDIR};		\
	done;							\
	for f in config/conf.d/*.conf config/conf.d/mod.*; do	\
		${INSTALL_DATA} $$f ${DESTDIR}${EGDIR}/conf.d;	\
	done;							\
	${INSTALL_DATA} config/vhosts.d/*.template ${DESTDIR}${EGDIR}/vhosts.d

.include "../../devel/pcre/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../mk/dlopen.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"