summaryrefslogtreecommitdiff
path: root/sysutils/webmin/Makefile
blob: 9cdb092bb5ae2ef758e61a19cdda6423dfbe42b1 (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
# $NetBSD: Makefile,v 1.4 2005/01/23 04:36:27 jlam Exp $

DISTNAME=	webmin-1.170-minimal
PKGNAME=	${DISTNAME:S/-minimal$//}
CATEGORIES=	sysutils www
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:=webadmin/}

MAINTAINER=	jlam@NetBSD.org
HOMEPAGE=	http://www.webmin.com/
COMMENT=	Perl web server and CGI for Unix system administration

DEPENDS+=	p5-Net-SSLeay-[0-9]*:../../security/p5-Net-SSLeay
DEPENDS+=	openssl-[0-9]*:../../security/openssl

USE_LANGUAGES=	# empty
WRKSRC=		${WRKDIR}/${PKGNAME_NOREV}
NO_BUILDLINK=	yes
NO_BUILD=	yes

USE_PERL5=	yes
REPLACE_PERL=	*.cgi */*.cgi *.pl */*.pl

WEBMIN_DIR=		${PREFIX}/${WEBMIN_SUBDIR}
WEBMIN_SUBDIR=		share/webmin
WEBMIN_ETCDIR?=		${PKG_SYSCONFDIR}/webmin
WEBMIN_LOGDIR?=		${VARBASE}/log/webmin
FILES_SUBST+=		WEBMIN_DIR=${WEBMIN_DIR}
FILES_SUBST+=		WEBMIN_ETCDIR=${WEBMIN_ETCDIR}
FILES_SUBST+=		WEBMIN_LOGDIR=${WEBMIN_LOGDIR}
MESSAGE_SUBST+=		WEBMIN_DIR=${WEBMIN_DIR}

USE_PKGINSTALL=		yes
DEINSTALL_EXTRA_TMPL=	${.CURDIR}/DEINSTALL
RCD_SCRIPTS=		webmin
OWN_DIRS=		${WEBMIN_LOGDIR}

# Dynamically generate the Webmin PLIST from the installed files.
WEBMIN_PLIST_FILES= \
	( cd ${PREFIX}; ${FIND} ${WEBMIN_SUBDIR} \! -type d -print )	\
	| ${SORT} -u
WEBMIN_PLIST_DIRS= \
	( cd ${PREFIX}; ${FIND} ${WEBMIN_SUBDIR} -type d -print )	\
	| ${SED} -e "s,^,@unexec ${RMDIR} -p %D/,"			\
		 -e "s,$$, 2>/dev/null || ${TRUE},"			\
	| ${SORT} -ur
GENERATE_PLIST+=	${WEBMIN_PLIST_FILES}; ${WEBMIN_PLIST_DIRS};

do-configure:
	for file in ${WRKSRC}/setup.sh; do				\
		${SED}	-e "s|/etc/webmin|${WEBMIN_ETCDIR}|g"		\
			-e "s|/var/webmin|${WEBMIN_LOGDIR}|g"		\
			-e "s|/usr/bin/perl|${PERL5}|g"			\
			-e "/chown.*root/s|root|${ROOT_USER}|g"		\
			-e "/chgrp.*bin/s|bin|${ROOT_GROUP}|g"		\
			$$file > $$file.new;				\
		if [ -x $$file ]; then					\
			${CHMOD} +x $$file.new;				\
		fi;							\
		${MV} -f $$file.new $$file;				\
	done

pre-install:
	${FIND} ${WRKSRC} -name "*.orig" -print | ${XARGS} ${RM} -f

do-install:
	${INSTALL_DATA_DIR} ${WEBMIN_DIR}
	${CP} -R ${WRKSRC}/* ${WEBMIN_DIR}

.include "../../mk/bsd.pkg.mk"