use SUBST framework.

fix broken patch patch-aa.
This commit is contained in:
ISIHARA Takanori 2008-02-09 18:15:43 +00:00 committed by Thomas Klausner
parent 4680f52bc8
commit 843f19220f
4 changed files with 48 additions and 170 deletions

View file

@ -1,6 +1,6 @@
# $NetBSD: Makefile,v 1.6 2006/03/14 01:28:02 jlamwww Exp $
# $NetBSD: Makefile,v 1.7 2008/02/09 18:15:43 ishit Exp $
DISTNAME= mathopd-1.5p5
DISTNAME= mathopd-1.5p6
CATEGORIES= www
MASTER_SITES= http://www.mathopd.org/dist/
@ -8,18 +8,22 @@ MAINTAINER= ishit@users.sourceforge.jp
HOMEPAGE= http://www.mathopd.org/
COMMENT= Very small, yet very fast HTTP server
MATHOPD_GROUP= www
MATHOPD_USER= www
.include "../../mk/bsd.prefs.mk"
BUILD_DEFS= VARBASE EXTRA_OBJS MATHOPD_USER MATHOPD_GROUP
MATHOPD_USER?= mathopd
MATHOPD_GROUP?= mathopd
PKG_USERS_VARS+= MATHOPD_USER
PKG_GROUPS_VARS+= MATHOPD_GROUP
WRKSRC= ${WRKDIR}/${DISTNAME}/src
EGDIR= ${PREFIX}/share/examples/mathopd
DOCDIR= ${PREFIX}/share/doc/mathopd
CONF_FILES= ${EGDIR}/mathopd.conf ${PKG_SYSCONFDIR}/mathopd.conf
RCD_SCRIPTS= mathopd
MAKE_DIRS= ${PREFIX}/share/mathopd
MAKE_DIRS= ${VARBASE}/log/mathopd
OWN_DIRS_PERMS+= ${VARBASE}/log/mathopd ${MATHOPD_USER} ${MATHOPD_GROUP} 0755
PKG_GROUPS= ${MATHOPD_GROUP}
@ -27,6 +31,19 @@ PKG_USERS= ${MATHOPD_USER}:${MATHOPD_GROUP}::mathopd\ user
DOCS= CHANGES cgi.txt config.txt running.txt sample.cfg syntax.txt
SUBST_CLASSES+= fix-paths
SUBST_STAGE.fix-paths= pre-configure
SUBST_MESSAGE.fix-paths= Fixing absolute paths.
SUBST_FILES.fix-paths= Makefile
SUBST_FILES.fix-paths+= ../doc/sample.cfg
SUBST_SED.fix-paths= -e 's,/usr/local,${PREFIX},g'
SUBST_SED.fix-paths+= -e 's,/var/mathopd/pid,${VARBASE}/run/mathopd.pid,g'
SUBST_SED.fix-paths+= -e 's,/var/mathopd/log,${VARBASE}/log/mathopd/access_log,g'
SUBST_SED.fix-paths+= -e 's,/var/mathopd/errorlog,${VARBASE}/log/mathopd/error_log,g'
SUBST_SED.fix-paths+= -e 's,/var/mathopd/childlog,${VARBASE}/log/mathopd/child_log,g'
SUBST_SED.fix-paths+= -e 's,/home/boland/\*,${PREFIX}/share/httpd/htdocs/\*,g'
SUBST_SED.fix-paths+= -e 's,/home/boland/cgi-bin,${PREFIX}/libexec/cgi-bin,g'
.if ${OPSYS} == "NetBSD"
CPPFLAGS+= -DHAVE_VFORK
.endif
@ -34,27 +51,24 @@ CPPFLAGS+= -DHAVE_VFORK
.if ${OPSYS} == "Linux"
CPPFLAGS+= -DHAVE_CRYPT_H
CPPFLAGS+= -DLINUX_SENDFILE
CPPFLAGS+= -D_FILE_OFFSET_BITS=64
EXTRA_OBJS+= sendfile.o
.endif
.if ${OPSYS} == "FreeBSD"
CPPFLAGS+= -DFREEBSD_SENDFILE
EXTRA_OBJS+= sendfile.o
.endif
.if ${OPSYS} == "SunOS"
CPPFLAGS+= -DNEED_INET_ATON
CPPFLAGS+= -D_FILE_OFFSET_BITS=64
CPPFLAGS+= -DHAVE_CRYPT_H
.endif
pre-configure:
.if ${OPSYS} == "SunOS"
@${MV} ${WRKSRC}/Makefile ${WRKSRC}/Makefile.patched
@${SED} -e 's!LDADD= -lcrypt!LDADD= -lsocket -lnsl!' \
< ${WRKSRC}/Makefile.patched \
> ${WRKSRC}/Makefile
.endif
.if ${OPSYS} == "Linux" || ${OPSYS} == "FreeBSD"
@${MV} ${WRKSRC}/Makefile ${WRKSRC}/Makefile.patched
@${SED} -e 's!util.c stub.c!util.c sendfile.c stub.c!' \
${MV} ${WRKSRC}/Makefile ${WRKSRC}/Makefile.patched
${SED} -e 's!LIBS = -lcrypt!LIBS = -lsocket -lnsl -lresolv!' \
< ${WRKSRC}/Makefile.patched \
> ${WRKSRC}/Makefile
.endif

View file

@ -1,7 +1,7 @@
$NetBSD: distinfo,v 1.3 2005/04/17 16:53:58 ishit Exp $
$NetBSD: distinfo,v 1.4 2008/02/09 18:15:43 ishit Exp $
SHA1 (mathopd-1.5p5.tar.gz) = 427456dd46dbe065022ed23894612f6ed3994dc5
RMD160 (mathopd-1.5p5.tar.gz) = 6316f0734d7f02fdafc0fd854c723735b04efe7f
Size (mathopd-1.5p5.tar.gz) = 58519 bytes
SHA1 (patch-aa) = 19cc51ea9b7febd6b0b67dadadfe4df92b79262b
SHA1 (patch-ab) = de7144116c5ebf24ee62fdfc2489e345d5667b5b
SHA1 (mathopd-1.5p6.tar.gz) = 2dd3ca20f8745cc9dc01c20221caa8efea909762
RMD160 (mathopd-1.5p6.tar.gz) = 1790464ffd7c244e032afbdfb29e07bde28bccad
Size (mathopd-1.5p6.tar.gz) = 59578 bytes
SHA1 (patch-aa) = 39819119c06a926d5e4de1520109af3d01927262
SHA1 (patch-ab) = b877690a98423d554541e28d4b2e629c1de14153

View file

@ -1,61 +1,13 @@
$NetBSD: patch-aa,v 1.1.1.1 2005/01/13 06:45:33 ishit Exp $
$NetBSD: patch-aa,v 1.2 2008/02/09 18:15:43 ishit Exp $
--- Makefile.orig 2003-12-15 04:37:51.000000000 +0900
--- Makefile.orig 2007-07-21 19:54:44.000000000 +0900
+++ Makefile
@@ -1,49 +1,8 @@
-BIN = mathopd
@@ -1,6 +1,6 @@
BIN = mathopd
-CC = gcc
-CFLAGS = -O -Wall
-CPPFLAGS =
-LDFLAGS =
-LIBS = -lcrypt
-PREFIX = /usr/local
-SBINDIR = $(PREFIX)/sbin
+PROG= mathopd
+SRCS= base64.c cgi.c config.c core.c dump.c imap.c log.c \
+ main.c redirect.c request.c util.c stub.c
+BINDIR?=${PREFIX}/sbin
+NOMAN= yes
+LDADD= -lcrypt
-# On Solaris, uncomment the following
-# CPPFLAGS = -DNEED_INET_ATON -DHAVE_CRYPT_H
-# LIBS = -lsocket -lnsl
-
-# On Linux, uncomment the following
-# CPPFLAGS = -DHAVE_CRYPT_H
-
-OBJS = base64.o cgi.o config.o core.o dump.o imap.o log.o main.o \
- redirect.o request.o util.o stub.o
-DEPENDS = mathopd.h Makefile
-
-# Uncomment the following if your system does not support the poll() function
-# CPPFLAGS += -DPOLL_EMULATION
-# OBJS += poll-emul.o
-
-# Uncomment the following if your system does not have the socklen_t type
-# CPPFLAGS += -DNEED_SOCKLEN_T
-
-# Unomment the following if your system has a working vfork() function
-# CPPFLAGS += -DHAVE_VFORK
-
-# Currently, sendfile support is available in two flavours: Linux and FreeBSD
-# Uncomment one of the following two to enable sendfile() support
-# CPPFLAGS += -DLINUX_SENDFILE
-# CPPFLAGS += -DFREEBSD_SENDFILE
-# If you define any of the SENDFILE conditionals, make sure to uncomment
-# the next line as well.
-# OBJS += sendfile.o
-
-all: $(BIN)
-install: $(BIN)
- install -c $(BIN) $(SBINDIR)
-$(BIN): $(OBJS)
- $(CC) $(LDFLAGS) -o $(BIN) $(OBJS) $(LIBS)
-$(OBJS): $(DEPENDS)
-.c.o:
- $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
-clean:
- rm -f $(BIN) $(OBJS)
-.PHONY: install clean
+.include <bsd.prog.mk>
+# CC = gcc
+# CFLAGS = -O -Wall
CPPFLAGS =
LDFLAGS =
LIBS = -lcrypt

View file

@ -1,101 +1,13 @@
$NetBSD: patch-ab,v 1.1.1.1 2005/01/13 06:45:32 ishit Exp $
$NetBSD: patch-ab,v 1.2 2008/02/09 18:15:43 ishit Exp $
--- ../doc/sample.cfg.orig 2003-11-18 08:07:12.000000000 +0900
+++ ../doc/sample.cfg
@@ -1,3 +1,9 @@
+#
+# mathopd.conf - sample
+#
+# If you need more infomation for this file,
+# see http://www.mathopd.org/config.txt
+#
Umask 026
Tuning {
@@ -10,12 +16,12 @@ Tuning {
@@ -10,7 +10,7 @@ Tuning {
ScriptTimeout 60
}
-User daemon
+User www
+User mathopd
StayRoot On
-PIDFile /var/mathopd/pid
-Log /var/mathopd/log.%Y%m%d
-ErrorLog /var/mathopd/errorlog
+PIDFile /var/run/mathopd.pid
+Log /var/log/mathopd/access_log.%Y%m%d
+ErrorLog /var/log/mathopd/error_log
LogFormat {
Ctime
@@ -36,13 +42,15 @@ LogGMT On
Control {
RunScriptsAsOwner On
- ChildLog /var/mathopd/childlog
+# ChildLog /var/log/mathopd/child_log
Types {
text/html { html }
text/plain { txt }
image/gif { gif }
image/jpeg { jpg }
+ image/png { png }
text/css { css }
+ application/pdf { pdf }
application/octet-stream { * }
}
Specials {
@@ -51,10 +59,10 @@ Control {
Imagemap { map }
Redirect { url }
}
- External {
- /usr/local/bin/php { php }
- }
- IndexNames { index.html }
+# External {
+# /usr/pkg/bin/php { php php4 }
+# }
+ IndexNames { index.html index.htm }
}
Server {
@@ -74,14 +82,14 @@ Server {
#
Control {
Alias /
- Location /home/boland/*
+ Location /usr/pkg/share/mathopd/*
}
#
# Here is an example of an old-fashioned 'cgi-bin' directory.
#
Control {
Alias /cgi-bin
- Location /home/boland/cgi-bin
+ Location /usr/pkg/libexec/cgi-bin
Specials {
CGI { * }
}
@@ -115,15 +123,15 @@ Server {
}
Control {
Alias /doc
- Location /usr/share/doc/handbook
+ Location /usr/share/doc/html
}
#
# Example of a redirect
#
- Control {
- Alias /secure
- Location https://an.example
- }
+# Control {
+# Alias /secure
+# Location https://an.example
+# }
}
}
PIDFile /var/mathopd/pid