Subject: pkg/28913: new package: www/mathopd
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <ishit@oak.dti.ne.jp>
List: pkgsrc-bugs
Date: 01/09/2005 00:15:00
>Number:         28913
>Category:       pkg
>Synopsis:       new package: www/mathopd
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 09 00:15:00 +0000 2005
>Originator:     ISIHARA Takanori
>Release:        NetBSD/i386 2.0
>Organization:
Nagoya *BSD Users' Group :-)
>Environment:
NetBSD ishitPc4.home 2.0 NetBSD 2.0 (GENERIC_LAPTOP) #0: Tue Dec 21 07:59:56 JST 2004  root@:/mnt/NetBSD/NetBSD-release-2-0/mybuild/i386/obj/sys/arch/i386/compile/GENERIC_LAPTOP i386

>Description:
I convert ports/www/mathopd to pkgsrc/www/mathopd.

I do not test Linux, FreeBSD and SunOS. Sorry.

>How-To-Repeat:

>Fix:
This is a new pkg shar file.

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	.
#	./files
#	./files/mathopd.sh
#	./PLIST
#	./Makefile
#	./patches
#	./patches/patch-ab
#	./patches/patch-aa
#	./DESCR
#	./distinfo
#
echo c - .
mkdir -p . > /dev/null 2>&1
echo c - ./files
mkdir -p ./files > /dev/null 2>&1
echo x - ./files/mathopd.sh
sed 's/^X//' >./files/mathopd.sh << 'END-of-./files/mathopd.sh'
X#!@RCD_SCRIPTS_SHELL@
X#
X# $NetBSD$
X#
X# PROVIDE: mathopd 
X# REQUIRE: DAEMON
X
Xif [ -f /etc/rc.subr ]; then
X	. /etc/rc.subr
Xfi
X
Xname="mathopd"
Xrcvar=$name
Xcommand="@PREFIX@/sbin/${name}"
Xcommand_args="-f @PKG_SYSCONFDIR@/${name}.conf"
Xrequired_files="@PKG_SYSCONFDIR@/${name}.conf"
X
Xif [ -f /etc/rc.subr ]; then
X	load_rc_config $name
X	run_rc_command "$1"
Xelse
X	@ECHO@ -n " ${name}"
X	${command} ${command_args}
Xfi
END-of-./files/mathopd.sh
echo x - ./PLIST
sed 's/^X//' >./PLIST << 'END-of-./PLIST'
X@comment $NetBSD$
Xsbin/mathopd
Xshare/doc/mathopd/CHANGES
Xshare/doc/mathopd/COPYING
Xshare/doc/mathopd/README
Xshare/doc/mathopd/cgi.txt
Xshare/doc/mathopd/config.txt
Xshare/doc/mathopd/running.txt
Xshare/doc/mathopd/sample.cfg
Xshare/doc/mathopd/syntax.txt
Xshare/examples/mathopd/mathopd.conf
X@dirrm share/examples/mathopd
X@dirrm share/doc/mathopd
END-of-./PLIST
echo x - ./Makefile
sed 's/^X//' >./Makefile << 'END-of-./Makefile'
X# $NetBSD$
X# FreeBSD Id: ports/www/mathopd/Makefile,v 1.16 2004/11/29 08:58:58 tobez Exp
X
XDISTNAME=	mathopd-1.5p4
XCATEGORIES=	www
XMASTER_SITES=	http://www.mathopd.org/dist/
X
XMAINTAINER=	tech-pkg@NetBSD.org
XHOMEPAGE=	http://www.mathopd.org/
XCOMMENT=	Very small, yet very fast HTTP server
X
XUSE_PKGINSTALL=	yes
X
XMATHOPD_GROUP=	www
XMATHOPD_USER=	www
X
X.include "../../mk/bsd.prefs.mk"
X
XWRKSRC=		${WRKDIR}/${DISTNAME}/src
XEGDIR=		${PREFIX}/share/examples/mathopd
XDOCDIR=		${PREFIX}/share/doc/mathopd
XCONF_FILES=	${EGDIR}/mathopd.conf ${PKG_SYSCONFDIR}/mathopd.conf
XRCD_SCRIPTS=	mathopd
X
XMAKE_DIRS=	${PREFIX}/share/mathopd
XOWN_DIRS_PERMS+=	${VARBASE}/log/mathopd ${MATHOPD_USER} ${MATHOPD_GROUP} 0755
X
XPKG_GROUPS=	${MATHOPD_GROUP}
XPKG_USERS=	${MATHOPD_USER}:${MATHOPD_GROUP}::mathopd\\ user
X
XDOCS=	CHANGES cgi.txt config.txt running.txt sample.cfg syntax.txt
X
X.if ${OPSYS} == "NetBSD"
XCPPFLAGS+=	-DHAVE_VFORK
X.endif
X
X.if ${OPSYS} == "Linux"
XCPPFLAGS+=	-DHAVE_CRYPT_H
XCPPFLAGS+=	-DLINUX_SENDFILE
X.endif
X
X.if ${OPSYS} == "FreeBSD"
XCPPFLAGS+=	-DFREEBSD_SENDFILE
X.endif
X
X.if ${OPSYS} == "SunOS"
XCPPFLAGS+=	-DNEED_INET_ATON
XCPPFLAGS+=	-DHAVE_CRYPT_H
X.endif
X
Xpre-configure:
X.if ${OPSYS} == "SunOS"
X	${MV} ${WRKSRC}/Makefile ${WRKSRC}/Makefile.patched
X	${SED} -e 's!LDADD=	-lcrypt!LDADD=	-lsocket -lnsl!' \
X	< ${WRKSRC}/Makefile.patched \
X	> ${WRKSRC}/Makefile
X.endif
X
Xpre-install:
X	${INSTALL_DATA_DIR} ${EGDIR}
X	${INSTALL_DATA_DIR} ${DOCDIR}
X
Xpost-install:
X	${INSTALL_DATA} ${WRKDIR}/${DISTNAME}/doc/sample.cfg ${EGDIR}/mathopd.conf
X
X	${INSTALL_DATA} ${WRKDIR}/${DISTNAME}/COPYING ${DOCDIR}
X	${INSTALL_DATA} ${WRKDIR}/${DISTNAME}/README  ${DOCDIR}
X	for df in ${DOCS}; do	\
X		${INSTALL_DATA} ${WRKDIR}/${DISTNAME}/doc/$${df}  ${DOCDIR};	\
X	done
X
X	${TOUCH} /var/run/mathopd.pid
X	${CHOWN} ${MATHOPD_USER}:${MATHOPD_GROUP} /var/run/mathopd.pid
X
X.include "../../mk/bsd.pkg.mk"
END-of-./Makefile
echo c - ./patches
mkdir -p ./patches > /dev/null 2>&1
echo x - ./patches/patch-ab
sed 's/^X//' >./patches/patch-ab << 'END-of-./patches/patch-ab'
X$NetBSD$
X
X+++ ../doc/sample.cfg
X@@ -1,3 +1,9 @@
X+#
X+# mathopd.conf - sample
X+#
X+# If you need more infomation for this file,
X+# see http://www.mathopd.org/config.txt
X+#
X Umask 026
X 
X Tuning {
X@@ -10,12 +16,12 @@ Tuning {
X 	ScriptTimeout 60
X }
X 
X-User daemon
X+User www
X StayRoot On
X 
X-PIDFile /var/mathopd/pid
X-Log /var/mathopd/log.%Y%m%d
X-ErrorLog /var/mathopd/errorlog
X+PIDFile /var/run/mathopd.pid
X+Log /var/log/mathopd/access_log.%Y%m%d
X+ErrorLog /var/log/mathopd/error_log
X 
X LogFormat {
X 	Ctime
X@@ -36,13 +42,15 @@ LogGMT On
X 
X Control {
X 	RunScriptsAsOwner On
X-	ChildLog /var/mathopd/childlog
X+#	ChildLog /var/log/mathopd/child_log
X 	Types {
X 		text/html { html }
X 		text/plain { txt }
X 		image/gif { gif }
X 		image/jpeg { jpg }
X+		image/png { png }
X 		text/css { css }
X+		application/pdf { pdf }
X 		application/octet-stream { * }
X 	}
X 	Specials {
X@@ -51,10 +59,10 @@ Control {
X 		Imagemap { map }
X 		Redirect { url }
X 	}
X-	External {
X-		/usr/local/bin/php { php }
X-	}
X-	IndexNames { index.html }
X+#	External {
X+#		/usr/pkg/bin/php { php php4 }
X+#	}
X+	IndexNames { index.html index.htm }
X }
X 
X Server {
X@@ -74,14 +82,14 @@ Server {
X #
X 		Control {
X 			Alias /
X-			Location /home/boland/*
X+			Location /usr/pkg/share/mathopd/*
X 		}
X #
X # Here is an example of an old-fashioned 'cgi-bin' directory.
X #
X 		Control {
X 			Alias /cgi-bin
X-			Location /home/boland/cgi-bin
X+			Location /usr/pkg/libexec/cgi-bin
X 			Specials {
X 				CGI { * }
X 			}
X@@ -115,15 +123,15 @@ Server {
X 		}
X 		Control {
X 			Alias /doc
X-			Location /usr/share/doc/handbook
X+			Location /usr/share/doc/html
X 		}
X #
X # Example of a redirect
X #
X-		Control {
X-			Alias /secure
X-		}
X+#		Control {
X+#			Alias /secure
X+#			Location https://an.example
X+#		}
X 	}
X }
X 
END-of-./patches/patch-ab
echo x - ./patches/patch-aa
sed 's/^X//' >./patches/patch-aa << 'END-of-./patches/patch-aa'
X$NetBSD$
X
X+++ Makefile
X@@ -1,49 +1,8 @@
X-BIN = mathopd
X-CC = gcc
X-CFLAGS = -O -Wall
X-CPPFLAGS = 
X-LDFLAGS = 
X-LIBS = -lcrypt
X-PREFIX = /usr/local
X-SBINDIR = $(PREFIX)/sbin
X+PROG=	mathopd
X+SRCS=	base64.c cgi.c config.c core.c dump.c imap.c log.c \
X+	main.c redirect.c request.c util.c stub.c
X+BINDIR?=${PREFIX}/sbin
X+NOMAN=	yes
X+LDADD=	-lcrypt
X 
X-# On Solaris, uncomment the following
X-# CPPFLAGS = -DNEED_INET_ATON -DHAVE_CRYPT_H
X-# LIBS = -lsocket -lnsl
X-
X-# On Linux, uncomment the following
X-# CPPFLAGS = -DHAVE_CRYPT_H
X-
X-OBJS = base64.o cgi.o config.o core.o dump.o imap.o log.o main.o \
X-	redirect.o request.o util.o stub.o
X-DEPENDS = mathopd.h Makefile
X-
X-# Uncomment the following if your system does not support the poll() function
X-# CPPFLAGS += -DPOLL_EMULATION
X-# OBJS += poll-emul.o
X-
X-# Uncomment the following if your system does not have the socklen_t type
X-# CPPFLAGS += -DNEED_SOCKLEN_T
X-
X-# Unomment the following if your system has a working vfork() function
X-# CPPFLAGS += -DHAVE_VFORK
X-
X-# Uncomment one of the following two to enable sendfile() support
X-# CPPFLAGS += -DLINUX_SENDFILE
X-# CPPFLAGS += -DFREEBSD_SENDFILE
X-# If you define any of the SENDFILE conditionals, make sure to uncomment
X-# the next line as well.
X-# OBJS += sendfile.o
X-
X-	install -c $(BIN) $(SBINDIR)
X-	$(CC) $(LDFLAGS) -o $(BIN) $(OBJS) $(LIBS)
X-	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
X-	rm -f $(BIN) $(OBJS)
X+.include <bsd.prog.mk>
END-of-./patches/patch-aa
echo x - ./DESCR
sed 's/^X//' >./DESCR << 'END-of-./DESCR'
XMathopd is a very small, yet very fast HTTP server for UN*X systems. 
X
XMathopd is designed specifically to handle a large number of connections
Xwith minimal fuss. It contains no unnecessary add-ons, but it does the
Xtrick for most things. 
X
XMathopd does not allocate any memory, once it has started up, and
Xdoes not fork any processes (except for CGI scripts of course.)
X
X- Anton
Xtobez@FreeBSD.org
END-of-./DESCR
echo x - ./distinfo
sed 's/^X//' >./distinfo << 'END-of-./distinfo'
X$NetBSD$
X
XSHA1 (mathopd-1.5p4.tar.gz) = d8ea3bc4e6c94f518bf3ce43a2bf5d55b38b0615
XSize (mathopd-1.5p4.tar.gz) = 58528 bytes
XSHA1 (patch-aa) = 19cc51ea9b7febd6b0b67dadadfe4df92b79262b
XSHA1 (patch-ab) = de7144116c5ebf24ee62fdfc2489e345d5667b5b
END-of-./distinfo
exit