Add files from parent branch HEAD:
[pkgsrcv2.git] / www / thttpd / Makefile
1 # $NetBSD: Makefile,v 1.42 2007/09/07 22:12:26 jlam Exp $
2
3 DISTNAME=       thttpd-2.25b
4 PKGREVISION=    5
5 CATEGORIES=     www
6 MASTER_SITES=   http://www.acme.com/software/thttpd/
7 DISTFILES=      ${DISTNAME}${EXTRACT_SUFX} \
8                 ${NETBSD_LOGO}
9 DIST_SUBDIR=    ${PKGNAME_NOREV}
10
11 MAINTAINER=     pkgsrc-users@NetBSD.org
12 HOMEPAGE=       http://www.acme.com/software/thttpd/
13 COMMENT=        Tiny/turbo/throttling HTTP server
14
15 EXTRACT_ONLY=   ${DISTNAME}${EXTRACT_SUFX}
16
17 NETBSD_LOGO=            sitedrivenby.gif
18 SITES.${NETBSD_LOGO}=   http://www.NetBSD.org/images/logos/
19
20 GNU_CONFIGURE=  yes
21
22 # Note: this pkg auto-detects IPv6.
23 BUILD_DEFS+=    IPV6_READY
24 # thttpd syslogs at level LOG_DAEMON by default
25 # change this to your preferred syslog level
26 THTTPD_LOG_FACILITY?=   LOG_DAEMON
27 BUILD_DEFS+=    THTTPD_LOG_FACILITY
28
29 EGDIR=          ${PREFIX}/share/examples
30 CONF_FILES=     ${EGDIR}/thttpd.conf ${PKG_SYSCONFDIR}/thttpd.conf
31 RCD_SCRIPTS=    thttpd
32
33 PKG_DESTDIR_SUPPORT=    user-destdir
34 INSTALLATION_DIRS=      $(PKGMANDIR)/man1 share/thttpd
35
36 SUBST_CLASSES+=         paths
37 SUBST_FILES.paths=      thttpd.conf
38 SUBST_SED.paths+=       -e 's,@PREFIX@,${PREFIX},g'
39 SUBST_STAGE.paths=      post-patch
40
41 MAKE_JOBS_SAFE= no
42
43 post-extract:
44         ${CP} ${FILESDIR}/thttpd.conf ${WRKSRC}
45
46 pre-configure:
47         ${MV} ${WRKSRC}/extras/htpasswd.1 ${WRKSRC}/extras/thtpasswd.1
48         ${MV} ${WRKSRC}/extras/htpasswd.c ${WRKSRC}/extras/thtpasswd.c
49         for FILE in thttpd.8 extras/Makefile.in extras/thtpasswd.c; do  \
50                 ${MV} -f ${WRKSRC}/$${FILE} ${WRKSRC}/$${FILE}.bak;     \
51                 ${SED}  -e "s,\.htpasswd,XXX,g;s,htpasswd,thtpasswd,g;s,XXX,.htpasswd,g" \
52                         ${WRKSRC}/$${FILE}.bak > ${WRKSRC}/$${FILE};    \
53         done
54         ${MV} -f ${WRKSRC}/config.h ${WRKSRC}/config.h.bak
55         ${SED} -e "s/LOG_DAEMON/${THTTPD_LOG_FACILITY}/" ${WRKSRC}/config.h.bak \
56                         > ${WRKSRC}/config.h
57
58 post-install:
59         ${INSTALL_DATA} ${WRKSRC}/thttpd.conf ${DESTDIR}${PREFIX}/share/examples
60         ${INSTALL_DATA} ${WRKSRC}/index.html ${DESTDIR}${PREFIX}/share/thttpd
61         ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/sitedrivenby.gif ${DESTDIR}${PREFIX}/share/thttpd
62
63 .include "../../mk/bsd.pkg.mk"