pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
(www/cgic) import cgic-2.08, (Revived for updating to 2.08)
Module Name: pkgsrc-wip
Committed By: Makoto Fujiwara <makoto%if.t.u-tokyo.ac.jp@localhost>
Pushed By: mef
Date: Sat Feb 22 17:12:44 2025 +0900
Changeset: 08472e360a4dec76ff14bde9cc4ca88128646ecb
Added Files:
cgic/DESCR
cgic/Makefile
cgic/PLIST
cgic/buildlink3.mk
cgic/distinfo
cgic/patches/patch-aa
cgic/patches/patch-ab
cgic/patches/patch-ac
cgic/patches/patch-ad
cgic/patches/patch-ae
cgic/patches/patch-af
Log Message:
(www/cgic) import cgic-2.08, (Revived for updating to 2.08)
This is the code written to accompany Thomas Boutell's book "CGI
Programming in C & Perl". It provides a library of routines for use
in CGI programming, and unlike cgilib-0.5, this library handles the
"multipart/form-data" encoding required to use the FILE input control
type as defined in the HTML specification.
NOTE: It should be aware that there were a few developer visible changes
made from Thomas Boutell's original distribution when integrating it
with the NetBSD packages environment. They are:
1) Instead of being yet another source file which is used in building
the application, the package have been converted totally into a
library format. This library is linked using "-lcgic".
2) As a result of the first item, the developer no longer writes their
entry point under the function name of cgiMain(). Instead, the
user will provide their own main(), and will need to call cgiInit()
before any other cgic function is called.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=08472e360a4dec76ff14bde9cc4ca88128646ecb
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
cgic/DESCR | 17 ++++++++++++
cgic/Makefile | 17 ++++++++++++
cgic/PLIST | 8 ++++++
cgic/buildlink3.mk | 12 +++++++++
cgic/distinfo | 11 ++++++++
cgic/patches/patch-aa | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++
cgic/patches/patch-ab | 13 ++++++++++
cgic/patches/patch-ac | 54 ++++++++++++++++++++++++++++++++++++++
cgic/patches/patch-ad | 13 ++++++++++
cgic/patches/patch-ae | 34 ++++++++++++++++++++++++
cgic/patches/patch-af | 19 ++++++++++++++
11 files changed, 270 insertions(+)
diffs:
diff --git a/cgic/DESCR b/cgic/DESCR
new file mode 100644
index 0000000000..263da45c7f
--- /dev/null
+++ b/cgic/DESCR
@@ -0,0 +1,17 @@
+This is the code written to accompany Thomas Boutell's book "CGI
+Programming in C & Perl". It provides a library of routines for use
+in CGI programming, and unlike cgilib-0.5, this library handles the
+"multipart/form-data" encoding required to use the FILE input control
+type as defined in the HTML specification.
+
+NOTE: It should be aware that there were a few developer visible changes
+made from Thomas Boutell's original distribution when integrating it
+with the NetBSD packages environment. They are:
+
+1) Instead of being yet another source file which is used in building
+ the application, the package have been converted totally into a
+ library format. This library is linked using "-lcgic".
+2) As a result of the first item, the developer no longer writes their
+ entry point under the function name of cgiMain(). Instead, the
+ user will provide their own main(), and will need to call cgiInit()
+ before any other cgic function is called.
diff --git a/cgic/Makefile b/cgic/Makefile
new file mode 100644
index 0000000000..bcddcc48db
--- /dev/null
+++ b/cgic/Makefile
@@ -0,0 +1,17 @@
+# $NetBSD: Makefile,v 1.10 2014/04/07 15:01:44 adam Exp $
+
+DISTNAME= cgic-2.08
+CATEGORIES= www
+MASTER_SITES= ${MASTER_SITE_GITHUB:=boutell/}
+GITHUB_TAG= 724a845f1b1699dee167d741b9b33cd5ec2310c2
+LICENSE= mit
+
+MAINTAINER= pkgsrc%ka8zrt.com@localhost
+HOMEPAGE= https://github.com/boutell/cgic
+COMMENT= Thomas Boutell's ANSI C library for CGI Programming
+
+INSTALLATION_DIRS= include lib
+USE_LIBTOOL= yes
+MAKE_ENV+= INSTALL=${TOOLS_PATH.install:Q}
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/cgic/PLIST b/cgic/PLIST
new file mode 100644
index 0000000000..68a8ee6b1a
--- /dev/null
+++ b/cgic/PLIST
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST,v 1.4 2014/04/07 15:01:44 adam Exp $
+include/cgic.h
+lib/libcgic.la
+libexec/cgi-bin/capture
+libexec/cgi-bin/cgictest
+share/doc/cgiclib/cgic.html
+share/examples/cgiclib/capture.c
+share/examples/cgiclib/cgictest.c
diff --git a/cgic/buildlink3.mk b/cgic/buildlink3.mk
new file mode 100644
index 0000000000..864a87c4eb
--- /dev/null
+++ b/cgic/buildlink3.mk
@@ -0,0 +1,12 @@
+# $NetBSD: buildlink3.mk,v 1.6 2009/03/20 19:25:36 joerg Exp $
+
+BUILDLINK_TREE+= cgic
+
+.if !defined(CGIC_BUILDLINK3_MK)
+CGIC_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.cgic+= cgic>=2.02nb1
+BUILDLINK_PKGSRCDIR.cgic?= ../../www/cgic
+.endif # CGIC_BUILDLINK3_MK
+
+BUILDLINK_TREE+= -cgic
diff --git a/cgic/distinfo b/cgic/distinfo
new file mode 100644
index 0000000000..31b28c36f8
--- /dev/null
+++ b/cgic/distinfo
@@ -0,0 +1,11 @@
+$NetBSD: distinfo,v 1.8 2021/10/26 11:29:22 nia Exp $
+
+BLAKE2s (cgic-2.08-724a845f1b1699dee167d741b9b33cd5ec2310c2.tar.gz) = 9f8a6bd046b762e70092a3a515cd9ab8e9d742e39ea973b2c0caf013685f8d70
+SHA512 (cgic-2.08-724a845f1b1699dee167d741b9b33cd5ec2310c2.tar.gz) = 2ed4c97f015a58d0fefd1dfd98bf5c28a34e1787e5166872c8e2b13b207dbc380f199bb6381d44b8c4ca342189c5e5ce722b89517897f7ea7bd1e630d250a16e
+Size (cgic-2.08-724a845f1b1699dee167d741b9b33cd5ec2310c2.tar.gz) = 77344 bytes
+SHA1 (patch-aa) = 456cd3c8cd0f1356927b54b609670dfb71562966
+SHA1 (patch-ab) = 42e8ee71eeb363e702dfab66344811a8967d382d
+SHA1 (patch-ac) = d3f4d57fb02fcddf7863fc6fa268643ab4fe6cb0
+SHA1 (patch-ad) = 6ef230a6cc265121dbcbaef392bc1d9c43d167b0
+SHA1 (patch-ae) = 0cbf0e7ceaa69adef326672cf4087a266e1c9512
+SHA1 (patch-af) = 04c73e07a32c7df1b659f181528066d93ed684e5
diff --git a/cgic/patches/patch-aa b/cgic/patches/patch-aa
new file mode 100644
index 0000000000..b788a8b807
--- /dev/null
+++ b/cgic/patches/patch-aa
@@ -0,0 +1,72 @@
+$NetBSD: patch-aa,v 1.4 2014/04/07 15:01:44 adam Exp $
+
+--- Makefile.orig 2024-10-01 02:56:24.000000000 +0000
++++ Makefile
+@@ -1,31 +1,40 @@
+-CFLAGS=-g -Wall
+-CC=gcc
+-AR=ar
+-RANLIB=ranlib
+-LIBS=-L./ -lcgic
+-
+-all: libcgic.a cgictest.cgi capture
+-
+-install: libcgic.a
+- cp libcgic.a /usr/local/lib
+- cp cgic.h /usr/local/include
+- @echo libcgic.a is in /usr/local/lib. cgic.h is in /usr/local/include.
+-
+-libcgic.a: cgic.o cgic.h
+- rm -f libcgic.a
+- $(AR) rc libcgic.a cgic.o
+- $(RANLIB) libcgic.a
+-
+-#mingw32 and cygwin users: replace .cgi with .exe
+-
+-cgictest.cgi: cgictest.o libcgic.a
+- gcc cgictest.o -o cgictest.cgi ${LIBS}
+-
+-capture: capture.o libcgic.a
+- gcc capture.o -o capture ${LIBS}
+-
++CFLAGS+= -Wall
++LIBS= libcgic.la
++OBJS= cgic.o
++
++all: libcgic.la cgictest capture
++
++.SUFFIXES: .lo
++
++.c.lo:
++ ${LIBTOOL} --mode=compile ${CC} ${CFLAGS} -o $@ -c $<
++
++libcgic.la: $(OBJS:.o=.lo)
++
++ ${LIBTOOL} --mode=link ${CC} -o $@ ${OBJS:.o=.lo} \
++ -rpath ${PREFIX}/lib -version-info 0:0
++
++cgictest: cgictest.lo libcgic.la
++ ${LIBTOOL} --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ cgictest.lo $(LIBS)
++
++capture: capture.lo libcgic.la
++ ${LIBTOOL} --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ cgictest.lo $(LIBS)
++
++install: libcgic.la cgictest
++ mkdir -p ${DESTDIR}${PREFIX}/libexec/cgi-bin
++ mkdir -p ${DESTDIR}${PREFIX}/share/examples/cgiclib
++ ${INSTALL} -c -m 444 capture.c ${DESTDIR}${PREFIX}/share/examples/cgiclib
++ ${INSTALL} -c -m 444 cgictest.c ${DESTDIR}${PREFIX}/share/examples/cgiclib
++ ${LIBTOOL} --mode=install ${BSD_INSTALL_LIB} libcgic.la ${DESTDIR}${PREFIX}/lib
++ ${LIBTOOL} --mode=install ${BSD_INSTALL_PROGRAM} capture ${DESTDIR}${PREFIX}/libexec/cgi-bin
++ ${LIBTOOL} --mode=install ${BSD_INSTALL_PROGRAM} cgictest ${DESTDIR}${PREFIX}/libexec/cgi-bin
++ ${INSTALL} -c -m 444 cgic.h ${DESTDIR}${PREFIX}/include
++ mkdir -p ${DESTDIR}${PREFIX}/share/doc/cgiclib
++ for i in *.html; do \
++ ${INSTALL} -c -m 444 $$i ${DESTDIR}${PREFIX}/share/doc/cgiclib ; \
++ done
+ clean:
+- rm -f *.o *.a cgictest.cgi capture cgicunittest
++ rm -f *.o *.la cgictest.cgi capture cgicunittest
+
+ test:
+ gcc -D UNIT_TEST=1 cgic.c -o cgicunittest
diff --git a/cgic/patches/patch-ab b/cgic/patches/patch-ab
new file mode 100644
index 0000000000..8b78237658
--- /dev/null
+++ b/cgic/patches/patch-ab
@@ -0,0 +1,13 @@
+$NetBSD: patch-ab,v 1.1.1.1 2004/07/20 21:44:29 jmmv Exp $
+
+--- capture.c.orig Sun Jan 12 13:59:43 2003
++++ capture.c
+@@ -1,6 +1,7 @@
+ #include "cgic.h"
+
+-int cgiMain() {
++int main() {
++ cgiInit();
+ cgiWriteEnvironment("/CHANGE/THIS/PATH/capcgi.dat");
+ cgiHeaderContentType("text/html");
+ fprintf(cgiOut, "<title>Captured</title>\n");
diff --git a/cgic/patches/patch-ac b/cgic/patches/patch-ac
new file mode 100644
index 0000000000..3a4fc61405
--- /dev/null
+++ b/cgic/patches/patch-ac
@@ -0,0 +1,54 @@
+$NetBSD: patch-ac,v 1.2 2006/01/06 22:46:51 adam Exp $
+
+--- cgic.c.orig 2024-10-01 02:56:24.000000000 +0000
++++ cgic.c
+@@ -124,8 +124,9 @@ static int cgiStrBeginsNc(char *s1, char
+ static int unitTest();
+ #endif
+
+-int main(int argc, char *argv[]) {
+- int result;
++int
++cgiInit(void)
++{
+ char *cgiContentLengthString;
+ char *e;
+ cgiSetupConstants();
+@@ -211,17 +212,6 @@ int main(int argc, char *argv[]) {
+ cgiOut = stdout;
+ cgiRestored = 0;
+
+-
+- /* These five lines keep compilers from
+- producing warnings that argc and argv
+- are unused. They have no actual function. */
+- if (argc) {
+- if (argv[0]) {
+- cgiRestored = 0;
+- }
+- }
+-
+-
+ if (cgiStrEqNc(cgiRequestMethod, "post")) {
+ #ifdef CGICDEBUG
+ CGICDEBUGSTART
+@@ -297,8 +287,8 @@ int main(int argc, char *argv[]) {
+ cgiFreeResources();
+ return 0;
+ #else
+- result = cgiMain();
+- return result;
++ atexit(cgiFreeResources);
++ return 0;
+ #endif
+ }
+
+@@ -2559,7 +2549,7 @@ static int unitTest() {
+ e = e->next;
+ unitTestAssert(!!e, "Test failed: fifth entry missing");
+ unitTestAssert(!strcmp(e->attr, "empty2"), "fifth entry name is not empty2");
+- unitTestAssert(!strcmp(e->value, ""), "fifth entry value is not empty string");
++ unitTestAssert(!stcrmp(e->value, ""), "fifth entry value is not empty string");
+ unitTestAssert(!e->next, "unexpected entry at end of list");
+ return 0;
+ }
diff --git a/cgic/patches/patch-ad b/cgic/patches/patch-ad
new file mode 100644
index 0000000000..8b516985c9
--- /dev/null
+++ b/cgic/patches/patch-ad
@@ -0,0 +1,13 @@
+$NetBSD: patch-ad,v 1.1.1.1 2004/07/20 21:44:29 jmmv Exp $
+
+--- cgic.h.orig Sun Jan 12 13:59:43 2003
++++ cgic.h
+@@ -90,6 +90,8 @@ typedef enum {
+ /* These functions are used to retrieve form data. See
+ cgic.html for documentation. */
+
++extern int cgiInit(void);
++
+ extern cgiFormResultType cgiFormString(
+ char *name, char *result, int max);
+
diff --git a/cgic/patches/patch-ae b/cgic/patches/patch-ae
new file mode 100644
index 0000000000..003ad48a4b
--- /dev/null
+++ b/cgic/patches/patch-ae
@@ -0,0 +1,34 @@
+$NetBSD: patch-ae,v 1.2 2006/01/06 22:46:51 adam Exp $
+
+--- cgic.html.orig 2004-11-15 17:59:19.000000000 +0100
++++ cgic.html
+@@ -378,6 +378,29 @@ cgic.c to your project?</strong>
+ If none of the above proves effective, please see the
+ section regarding <a href="#support">support</a>.
+ <h3><a name="howto">How to write a cgic application</a></h3>
++
++<strong><em>Important Note for NetBSD packages users from the package maintainer: </em>
++<p>
++This section does not work for users of cgic who have it installed via
++a NetBSD package. While mostly true, there are several very important
++differences which were created during the port to the NetBSD pkgsrc
++environment:
++
++<ul>
++<li> Linking is now done against libcgic instead of cgic.c itself. This
++ is done by adding a "-lcgic" and other command line options as needed
++ when linking.
++<li> The application must now provide its own main() function, which calls the
++ cgiInit() function before any of the other functions are called. This
++ function returns 0 upon success, and -1 upon failure. It also registers
++ a function, cgiFreeResources(), via atexit() to be called at exit time.
++</ul>
++
++While this removes the ability to compile cgic with DEBUG defined, it
++aligns the cgic library with the model followed by other libraries.
++</strong>
++<p>
++
+ <em>Note: </em> All cgic applications must be linked to the cgic.c module
+ itself. How to do this depends on your operating system; under Unix,
+ just use the provided Makefile as an example.
diff --git a/cgic/patches/patch-af b/cgic/patches/patch-af
new file mode 100644
index 0000000000..d4e7415ebb
--- /dev/null
+++ b/cgic/patches/patch-af
@@ -0,0 +1,19 @@
+$NetBSD: patch-af,v 1.2 2006/01/06 22:46:51 adam Exp $
+
+--- cgictest.c.orig 2004-04-22 22:49:47.000000000 +0200
++++ cgictest.c
+@@ -42,7 +42,13 @@ void Cookies();
+ void LoadEnvironment();
+ void SaveEnvironment();
+
+-int cgiMain() {
++int main() {
++
++ /*
++ * Initialize the library environment.
++ */
++ cgiInit();
++
+ #ifdef DEBUG
+ LoadEnvironment();
+ #endif /* DEBUG */
Home |
Main Index |
Thread Index |
Old Index