From 9fca5611dd1edf0beb1fdd71db016f2dad89380f Mon Sep 17 00:00:00 2001 From: Alexey Dokuchaev Date: Fri, 8 Aug 2014 12:14:16 +0000 Subject: [PATCH] - Try to fix parallel builds (-jX) by using GNU make(1) - Convert sendfile(2) support into an OPTION (keep it on) - Rearrange things in Makefile a bit while I'm here --- www/thttpd/Makefile | 46 ++++++++++++++++-------------- www/thttpd/files/patch-Makefile.in | 43 +++++++++++++++++++++++++++- 2 files changed, 66 insertions(+), 23 deletions(-) diff --git a/www/thttpd/Makefile b/www/thttpd/Makefile index 65ab17b62d6c..a7d6f92b1fa0 100644 --- a/www/thttpd/Makefile +++ b/www/thttpd/Makefile @@ -12,38 +12,40 @@ MAINTAINER= danfe@FreeBSD.org COMMENT= Tiny/turbo/throttling HTTP server GNU_CONFIGURE= yes -MAKE_JOBS_UNSAFE= yes - +USES= gmake # parallel builds (-jX) are broken with BSD make(1) USE_RC_SUBR= thttpd SUB_FILES= pkg-message thttpd.conf.sample SUB_LIST= WWWOWN=${WWWOWN} +OPTIONS_DEFINE= SENDFILE +OPTIONS_DEFAULT= SENDFILE +SENDFILE_DESC= Use sendfile(2) to serve files + +SENDFILE_EXTRA_PATCHES= ${FILESDIR}/extra-patch-config.h + post-patch: .for f in extras/htpasswd.1 extras/htpasswd.c thttpd.8 extras/Makefile.in - @${REINPLACE_CMD} -e \ - 's|htpasswd|thttpdpasswd|g;s|\.thttpdpasswd|.htpasswd|g' ${WRKSRC}/${f} + @${REINPLACE_CMD} -e '/\.htpasswd/!s|htpasswd|thttpdpasswd|g' \ + ${WRKSRC}/${f} .endfor - ${MV} ${WRKSRC}/extras/htpasswd.1 ${WRKSRC}/extras/thttpdpasswd.1 - ${MV} ${WRKSRC}/extras/htpasswd.c ${WRKSRC}/extras/thttpdpasswd.c - -post-configure: - @(cd ${WRKSRC} && ${PATCH} < ${PATCHDIR}/extra-patch-config.h) + @${MV} ${WRKSRC}/extras/htpasswd.1 ${WRKSRC}/extras/thttpdpasswd.1 + @${MV} ${WRKSRC}/extras/htpasswd.c ${WRKSRC}/extras/thttpdpasswd.c do-install: ${INSTALL_PROGRAM} ${WRKSRC}/thttpd ${STAGEDIR}${PREFIX}/sbin - ${INSTALL_MAN} ${WRKSRC}/thttpd.8 ${STAGEDIR}${PREFIX}/man/man8 - @${MKDIR} ${STAGEDIR}${PREFIX}/www/data ${STAGEDIR}${PREFIX}/www/cgi-bin - ${INSTALL_PROGRAM} ${WRKSRC}/cgi-src/redirect ${STAGEDIR}${PREFIX}/www/cgi-bin - ${INSTALL_PROGRAM} ${WRKSRC}/cgi-src/ssi ${STAGEDIR}${PREFIX}/www/cgi-bin - ${INSTALL_PROGRAM} ${WRKSRC}/cgi-src/phf ${STAGEDIR}${PREFIX}/www/cgi-bin - ${INSTALL_MAN} ${WRKSRC}/cgi-src/redirect.8 ${STAGEDIR}${PREFIX}/man/man8 - ${INSTALL_MAN} ${WRKSRC}/cgi-src/ssi.8 ${STAGEDIR}${PREFIX}/man/man8 - ${INSTALL_PROGRAM} ${WRKSRC}/extras/makeweb ${STAGEDIR}${PREFIX}/bin - ${INSTALL_PROGRAM} ${WRKSRC}/extras/thttpdpasswd ${STAGEDIR}${PREFIX}/bin - ${INSTALL_SCRIPT} ${WRKSRC}/extras/syslogtocern ${STAGEDIR}${PREFIX}/bin - ${INSTALL_MAN} ${WRKSRC}/extras/makeweb.1 ${STAGEDIR}${PREFIX}/man/man1 - ${INSTALL_MAN} ${WRKSRC}/extras/thttpdpasswd.1 ${STAGEDIR}${PREFIX}/man/man1 - ${INSTALL_MAN} ${WRKSRC}/extras/syslogtocern.8 ${STAGEDIR}${PREFIX}/man/man8 + ${INSTALL_PROGRAM} ${WRKSRC}/extras/makeweb \ + ${WRKSRC}/extras/thttpdpasswd ${STAGEDIR}${PREFIX}/bin + ${INSTALL_SCRIPT} ${WRKSRC}/extras/syslogtocern \ + ${STAGEDIR}${PREFIX}/bin + @${MKDIR} ${STAGEDIR}${PREFIX}/www/data \ + ${STAGEDIR}${PREFIX}/www/cgi-bin + ${INSTALL_PROGRAM} ${WRKSRC}/cgi-src/redirect ${WRKSRC}/cgi-src/ssi \ + ${WRKSRC}/cgi-src/phf ${STAGEDIR}${PREFIX}/www/cgi-bin + ${INSTALL_MAN} ${WRKSRC}/extras/makeweb.1 \ + ${WRKSRC}/extras/thttpdpasswd.1 ${STAGEDIR}${PREFIX}/man/man1 + ${INSTALL_MAN} ${WRKSRC}/thttpd.8 ${WRKSRC}/cgi-src/redirect.8 \ + ${WRKSRC}/cgi-src/ssi.8 ${WRKSRC}/extras/syslogtocern.8 \ + ${STAGEDIR}${PREFIX}/man/man8 ${INSTALL_DATA} ${WRKDIR}/thttpd.conf.sample ${STAGEDIR}${PREFIX}/etc .include diff --git a/www/thttpd/files/patch-Makefile.in b/www/thttpd/files/patch-Makefile.in index a51144a82d33..9a6a89018812 100644 --- a/www/thttpd/files/patch-Makefile.in +++ b/www/thttpd/files/patch-Makefile.in @@ -1,6 +1,6 @@ --- Makefile.in.orig Tue Apr 24 19:21:06 2001 +++ Makefile.in Tue Apr 24 19:21:33 2001 -@@ -47,7 +47,7 @@ +@@ -47,7 +47,7 @@ CGIBINDIR = $(WEBDIR)/cgi-bin # You shouldn't need to edit anything below here. CC = @CC@ @@ -9,3 +9,44 @@ DEFS = @DEFS@ INCLS = -I. CFLAGS = $(CCOPT) $(DEFS) $(INCLS) +@@ -96,9 +96,7 @@ mime_types.h: mime_types.txt + + subdirs: + for i in $(SUBDIRS) ; do ( \ +- cd $$i ; \ +- pwd ; \ +- $(MAKE) $(MFLAGS) \ ++ $(MAKE) -C $$i $(MFLAGS) \ + WEBDIR=$(WEBDIR) \ + CGIBINDIR=$(CGIBINDIR) \ + MANDIR=$(MANDIR) \ +@@ -118,9 +116,7 @@ install-man: + + installsubdirs: + for i in $(SUBDIRS) ; do ( \ +- cd $$i ; \ +- pwd ; \ +- $(MAKE) $(MFLAGS) \ ++ $(MAKE) -C $$i $(MFLAGS) \ + WEBDIR=$(WEBDIR) \ + CGIBINDIR=$(CGIBINDIR) \ + MANDIR=$(MANDIR) \ +@@ -137,16 +133,12 @@ distclean: distcleansubdirs + + cleansubdirs: + for i in $(SUBDIRS) ; do ( \ +- cd $$i ; \ +- pwd ; \ +- $(MAKE) $(MFLAGS) clean \ ++ $(MAKE) -C $$i $(MFLAGS) clean \ + ) ; done + + distcleansubdirs: + for i in $(SUBDIRS) ; do ( \ +- cd $$i ; \ +- pwd ; \ +- $(MAKE) $(MFLAGS) distclean \ ++ $(MAKE) -C $$i $(MFLAGS) distclean \ + ) ; done + + tags: