summaryrefslogtreecommitdiffstats
path: root/security/portaudit/Makefile
blob: d62f2072749405b1c595fe74cd88b40ea45fd7de (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
# New ports collection makefile for:	portaudit
# Date created:				25 Jan 2004
# Whom:					Oliver Eikemeier
#
# $FreeBSD$
#

PORTNAME=	portaudit
PORTVERSION=	0.3.2
CATEGORIES=	security
DISTFILES=

MAINTAINER=	eik@FreeBSD.org
COMMENT=	Checks installed ports against a list of security vulnerabilities

MAN1=		portaudit.1

PERIODICDIR?=	${PREFIX}/etc/periodic
DATABASEDIR?=	/var/db/portaudit

PKGINSTALL=	${WRKDIR}/pkg-install
PKGDEINSTALL=	${WRKDIR}/pkg-deinstall

PLIST_SUB+=	PERIODICDIR="${PERIODICDIR:S,^${PREFIX}/,,}" \
		DATABASEDIR="${DATABASEDIR}"

SED_SCRIPT=	-e 's,%%PREFIX%%,${PREFIX},g' \
		-e 's,%%DATABASEDIR%%,${DATABASEDIR},g'

PKG_INFO_BASE?=	/usr/sbin/pkg_info
BASEPKGVER!=	${PKG_INFO_BASE} -qP 2>/dev/null || ${TRUE}

.if ${BASEPKGVER} < 20040125
RUN_DEPENDS=	${LOCALBASE}/sbin/pkg_info:${PORTSDIR}/sysutils/pkg_install-devel
.endif

.include <bsd.port.pre.mk>

.if defined(BZIP2DEPENDS)
RUN_DEPENDS+=	bzip2:${PORTSDIR}/archivers/bzip2
.endif

do-build:
.for f in portaudit-cmd.sh portaudit.sh fetchaudit.sh portaudit.functions portaudit.1 portaudit.conf
	@${SED} -e "s|%%DATADIR%%|${DATADIR}|g" \
		-e "s|%%DATABASEDIR%%|${DATABASEDIR}|g" \
		-e "s|%%PREFIX%%|${PREFIX}|g" \
		-e "s|%%LOCALBASE%%|${LOCALBASE}|g" \
		-e "s|%%PORTVERSION%%|${PORTVERSION}|g" \
		-e "s|%%BZIP2_CMD%%|${BZIP2_CMD}|g" \
		${FILESDIR}/${f} > ${WRKDIR}/${f}
.endfor

post-build:
.for text in pkg-install pkg-deinstall
	@if [ -f ${PKGDIR}/${text} ]; then \
		${SED} ${SED_SCRIPT} ${PKGDIR}/${text} >${WRKDIR}/${text}; \
	fi
.endfor

do-install:
	@${INSTALL_SCRIPT} ${WRKDIR}/portaudit-cmd.sh ${PREFIX}/bin/portaudit
	@${INSTALL_MAN} ${WRKDIR}/portaudit.1 ${MAN1PREFIX}/man/man1
	@${MKDIR} ${PERIODICDIR}/security
	@${INSTALL_SCRIPT} ${WRKDIR}/portaudit.sh ${PERIODICDIR}/security/910.portaudit
	@${MKDIR} ${PERIODICDIR}/daily
	@${INSTALL_SCRIPT} ${WRKDIR}/fetchaudit.sh ${PERIODICDIR}/daily/330.fetchaudit
	@${MKDIR} ${DATADIR}
	@${INSTALL_DATA} ${WRKDIR}/portaudit.functions ${DATADIR}
	@${INSTALL_DATA} ${WRKDIR}/portaudit.conf ${PREFIX}/etc/portaudit.conf.sample
	@${MKDIR} ${DATABASEDIR}

post-install:
	@if [ -f ${PKGINSTALL} ]; then \
		${SETENV} "PKG_PREFIX=${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL; \
	fi

.include <bsd.port.post.mk>
OpenPOWER on IntegriCloud