From: Florian Fainelli Date: Sat, 1 Jul 2006 10:25:37 +0000 (+0000) Subject: Add cgilib X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=dcb4de89e6a3158a5b690fc99c03ca69ea8fb0f5;p=openwrt%2Fsvn-archive%2Farchive.git Add cgilib SVN-Revision: 4103 --- diff --git a/libs/cgilib/Makefile b/libs/cgilib/Makefile new file mode 100644 index 0000000000..cc6498b4dc --- /dev/null +++ b/libs/cgilib/Makefile @@ -0,0 +1,58 @@ +# $Id: Makefile 3843 2006-05-30 18:55:52Z nbd $ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=cgilib +PKG_VERSION:=0.5 +PKG_RELEASE:=1 +PKG_MD5SUM:=5187ba11b2ec165b6c5b6629087733b0 + +PKG_SOURCE_URL:=http://www.infodrom.org/projects/cgilib/download +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_CAT:=zcat + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install + +include $(INCLUDE_DIR)/package.mk + +define Package/cgilib +SECTION:=libs +CATEGORY:=Libraries +TITLE:=Simple CGI Library +DESCRIPTION:=Simple CGI Library. +URL:=http://www.infodrom.org/projects/cgilib/ +endef + +define Build/Configure +endef + +define Build/Compile + rm -rf $(PKG_INSTALL_DIR) + mkdir -p $(PKG_INSTALL_DIR) + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + OFLAGS="$(TARGET_CFLAGS)" \ + all +endef + +define Package/cgilib/install + install -m0755 -d $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libcgi.so.* $(1)/usr/lib/ +endef + +define Build/InstallDev + mkdir -p $(STAGING_DIR)/usr/include + $(CP) $(PKG_BUILD_DIR)/cgi.h $(STAGING_DIR)/usr/include/ + mkdir -p $(STAGING_DIR)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libcgi.{a,so*} $(STAGING_DIR)/usr/lib/ + touch $(STAGING_DIR)/usr/lib/libcgi.so +endef + +define Build/UninstallDev + rm -rf \ + $(STAGING_DIR)/usr/include/cgi.h \ + $(STAGING_DIR)/usr/lib/libcgi.{a,so*} +endef + +$(eval $(call BuildPackage,cgilib)) diff --git a/libs/cgilib/patches/100-shared_lib.patch b/libs/cgilib/patches/100-shared_lib.patch new file mode 100644 index 0000000000..5603340f9d --- /dev/null +++ b/libs/cgilib/patches/100-shared_lib.patch @@ -0,0 +1,41 @@ +diff -ruN cgilib-0.5-orig/Makefile cgilib-0.5-1/Makefile +--- cgilib-0.5-orig/Makefile 1999-08-20 23:14:07.000000000 +0200 ++++ cgilib-0.5-1/Makefile 2005-08-10 20:28:17.000000000 +0200 +@@ -14,14 +14,26 @@ + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + +-CFLAGS = -I. -Wall -O2 -g ++OFLAGS = -O2 -g ++CFLAGS = -I. -Wall $(OFLAGS) + LDFLAGS = -L. + LIBS = -lcgi + ++SOVER_MAJ := 0 ++SOVER_MIN := 0 ++SOVER_REV := 0 ++SONAME := libcgi.so.$(SOVER_MAJ) ++SOREAL := libcgi.so.$(SOVER_MAJ).$(SOVER_MIN).$(SOVER_REV) ++ + OBJS = cgi.o cookies.o + + libcgi.a: $(OBJS) +- ar rc $@ $^ ++ $(AR) rc $@ $^ ++ ++libcgi.so: $(OBJS) ++ $(CC) -shared -o $(SOREAL) $(LDFLAGS) -Wl,-soname,$(SONAME) $^ ++ ln -sf $(SOREAL) $(SONAME) ++ ln -sf $(SONAME) libcgi.so + + cgitest: cgitest.o libcgi.a + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) +@@ -29,7 +41,7 @@ + jumpto: jumpto.o libcgi.a + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) + +-all: libcgi.a cgitest jumpto ++all: libcgi.a libcgi.so cgitest jumpto + + install: cgitest + install -m 755 cgitest /usr/lib/cgi-bin diff --git a/libs/cgilib/patches/200-cgitest_bugfix.patch b/libs/cgilib/patches/200-cgitest_bugfix.patch new file mode 100644 index 0000000000..62a68e7391 --- /dev/null +++ b/libs/cgilib/patches/200-cgitest_bugfix.patch @@ -0,0 +1,11 @@ +--- cgilib-0.5/cgitest.c.orig 1999-08-17 15:21:20.000000000 +0200 ++++ cgilib-0.5/cgitest.c 2005-08-10 20:49:01.000000000 +0200 +@@ -113,7 +113,7 @@ + cgiHeader(); + printf ("\ncgilib\n\n\n"); + printf ("

cgilib

\n", URL); +- printf ("

Cookie "Library" set

\n"); ++ printf ("

Cookie \"Library\" set

\n"); + printf ("



Test

\n"); + printf ("



Redirect

\n"); + printf ("



List Everything

\n");