[BACK]Return to Makefile CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / sysutils / webmin

File: [cvs.NetBSD.org] / pkgsrc / sysutils / webmin / Makefile (download)

Revision 1.12, Tue Mar 14 01:14:34 2006 UTC (18 years, 1 month ago) by jlam
Branch: MAIN
Changes since 1.11: +1 -2 lines

Modify the pkginstall framework so that it manages all aspects of
INSTALL/DEINSTALL script creation within pkgsrc.

If an INSTALL or DEINSTALL script is found in the package directory,
it is automatically used as a template for the pkginstall-generated
scripts.  If instead, they should be used simply as the full scripts,
then the package Makefile should set INSTALL_SRC or DEINSTALL_SRC
explicitly, e.g.:

	INSTALL_SRC=	${PKGDIR}/INSTALL
	DEINSTALL_SRC=	# emtpy

As part of the restructuring of the pkginstall framework internals,
we now *always* generate temporary INSTALL or DEINSTALL scripts.  By
comparing these temporary scripts with minimal INSTALL/DEINSTALL
scripts formed from only the base templates, we determine whether or
not the INSTALL/DEINSTALL scripts are actually needed by the package
(see the generate-install-scripts target in bsd.pkginstall.mk).

In addition, more variables in the framework have been made private.
The *_EXTRA_TMPL variables have been renamed to *_TEMPLATE, which are
more sensible names given the very few exported variables in this
framework.  The only public variables relating to the templates are:

	INSTALL_SRC		INSTALL_TEMPLATE
	DEINSTALL_SRC		DEINSTALL_TEMPLATE
				HEADER_TEMPLATE

The packages in pkgsrc have been modified to reflect the changes in
the pkginstall framework.

# $NetBSD: Makefile,v 1.12 2006/03/14 01:14:34 jlam Exp $

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

MAINTAINER=	jlam@pkgsrc.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

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

USE_TOOLS+=	perl:run
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:Q}
FILES_SUBST+=		WEBMIN_ETCDIR=${WEBMIN_ETCDIR:Q}
FILES_SUBST+=		WEBMIN_LOGDIR=${WEBMIN_LOGDIR:Q}
MESSAGE_SUBST+=		WEBMIN_DIR=${WEBMIN_DIR:Q}

RCD_SCRIPTS=		webmin
OWN_DIRS=		${WEBMIN_LOGDIR}

# Dynamically generate the Webmin PLIST from the installed files.
WEBMIN_PLIST_FILES_CMD= \
	( cd ${PREFIX}; ${FIND} ${WEBMIN_SUBDIR} \! -type d -print )	\
	| ${SORT} -u
WEBMIN_PLIST_DIRS_CMD= \
	( 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_CMD}; ${WEBMIN_PLIST_DIRS_CMD};

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
	case "${USE_BUILTIN.openssl}" in				\
	[nN][oO])							\
		for file in ${WRKSRC}/acl/config ${WRKSRC}/acl/config-*; do \
			${SED}	-e "s|^ssleay=.*|ssleay=${SSLBASE}/bin/openssl|" \
				$$file > $$file.new;			\
			${MV} -f $$file.new $$file;			\
		done;							\
		;;							\
	esac

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

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

.include "../../security/openssl/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"