summaryrefslogtreecommitdiff
path: root/mail/anomy-sanitizer/Makefile
blob: 144d917cb73fa48b2be4a6c09086642ee123119e (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.19 2005/09/28 20:52:23 rillig Exp $
#

DISTNAME=	anomy-sanitizer-1.69
CATEGORIES=	mail
MASTER_SITES=	http://mailtools.anomy.net/dist/

MAINTAINER=	kim@tac.nyc.ny.us
HOMEPAGE=	http://mailtools.anomy.net/
COMMENT=	Mail message filter and sanitizer

DEPENDS+=	p5-MIME-Base64-[0-9]*:../../converters/p5-MIME-Base64
DEPENDS+=	p5-Digest-MD5-[0-9]*:../../security/p5-Digest-MD5

PKG_INSTALLATION_TYPES=	overwrite pkgviews

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

WRKSRC=		${WRKDIR}/anomy
NO_CONFIGURE=	yes
USE_TOOLS+=	perl:run

ANOMYLIB=	${PREFIX}/lib/anomy-sanitizer
ANOMYDOC=	${PREFIX}/share/doc/anomy-sanitizer

INSTALLATION_DIRS=	sbin

do-build:
	cd ${WRKSRC} && ( \
	    for i in sanitizer simplify; do \
		( \
		    cd bin && ${MV} -f $$i.pl $$i.pl.orig && \
		    ${SED} 's;/usr/bin/perl;${PERL5};' $$i.pl.orig > $$i.pl; \
		); \
		( \
		    ${ECHO} '#!${SH}'; \
		    ${ECHO} 'export ANOMY'; \
		    ${ECHO} 'ANOMY=${ANOMYLIB}'; \
		    ${ECHO} 'exec $${ANOMY}/bin/'$$i'.pl "$$@"'; \
		) > $$i; \
	    done; \
	)

do-install:
	${INSTALL_SCRIPT_DIR} ${PREFIX}/sbin
	${INSTALL_SCRIPT} ${WRKSRC}/sanitizer ${PREFIX}/sbin
	${INSTALL_SCRIPT} ${WRKSRC}/simplify ${PREFIX}/sbin
	${INSTALL_DATA_DIR} ${ANOMYDOC}
	cd ${WRKSRC} && ${PAX} -rw -s',.*\.orig$$,,' -s',^\..*$$,,' \
	    CHANGELOG.sanitizer \
	    CREDITS \
	    README.sanitizer \
	    UNICODE.TXT \
	    contrib \
	    sanitizer.html \
	    ${ANOMYDOC}
	${CHMOD} -R u=rw,go=r ${ANOMYDOC}
	${CHMOD} -R a+X ${ANOMYDOC}
	${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${ANOMYDOC}
	${INSTALL_DATA_DIR} ${ANOMYLIB}
	${INSTALL_DATA_DIR} ${ANOMYLIB}/bin
	${INSTALL_SCRIPT} ${WRKSRC}/bin/sanitizer.pl ${ANOMYLIB}/bin
	${INSTALL_SCRIPT} ${WRKSRC}/bin/simplify.pl ${ANOMYLIB}/bin
	cd ${WRKSRC}/bin && ${PAX} -rw -s',.*\.orig$$,,' Anomy ${ANOMYLIB}/bin
	${CHMOD} -R u=rw,go=r ${ANOMYLIB}/bin/Anomy
	${CHMOD} -R a+X ${ANOMYLIB}/bin/Anomy
	${CHOWN} -R ${LIBOWN}:${LIBGRP} ${ANOMYLIB}

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