Add cgilib

git-svn-id: svn://svn.openwrt.org/openwrt/packages@4103 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
florian 2006-07-01 10:25:37 +00:00
parent 444627e0cb
commit 6e29072bf6
3 changed files with 110 additions and 0 deletions

58
libs/cgilib/Makefile Normal file
View File

@ -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))

View File

@ -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

View File

@ -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 ("<html>\n<head><title>cgilib</title></title>\n\n<body bgcolor=\"#ffffff\">\n");
printf ("<h1><a href=\"%s\">cgilib</a></h1>\n", URL);
- printf ("<h3>Cookie "Library" set</h3>\n");
+ printf ("<h3>Cookie \"Library\" set</h3>\n");
printf ("<p><br><p><br><a href=\"/cgi-bin/cgitest\">Test</a><p>\n");
printf ("<p><br><p><br><a href=\"/cgi-bin/cgitest/redirect\">Redirect</a><p>\n");
printf ("<p><br><p><br><a href=\"/cgi-bin/cgitest/listall\">List Everything</a><p>\n");