more package submenus
[openwrt/svn-archive/archive.git] / libs / postgresql / Makefile
index 77f52382559fad8032ebcc633a0c475f37ce371a..804c510215d869d498b69716c2121e934bdb69b5 100644 (file)
@@ -9,7 +9,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=postgresql
-PKG_VERSION:=8.2.3
+PKG_VERSION:=8.2.5
 PKG_RELEASE:=1
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
@@ -17,8 +17,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=\
        ftp://ftp.us.postgresql.org/pub/mirrors/postgresql/source/v$(PKG_VERSION) \
        ftp://ftp-archives.postgresql.org/pub/source/v$(PKG_VERSION)
-PKG_MD5SUM:=cb47771004d53505200ffd00ac45bc32
-PKG_CAT:=bzcat
+PKG_MD5SUM:=bb1cd309ea72f070cb964736f5755847
 
 PKG_BUILD_DEPENDS:=libnotimpl
 
@@ -29,10 +28,14 @@ include $(INCLUDE_DIR)/package.mk
 define Package/libpq
   SECTION:=libs
   CATEGORY:=Libraries
-  DEPENDS:=+zlib
+  DEPENDS:=+zlib +libreadline +libncurses
   TITLE:=PostgreSQL client library
-  DESCRIPTION:=PostgreSQL client library.
   URL:=http://www.postgresql.org/
+  SUBMENU:=database
+endef
+
+define Package/libpq/description
+PostgreSQL client library.
 endef
 
 define Package/pgsql-cli
@@ -40,8 +43,12 @@ define Package/pgsql-cli
   CATEGORY:=Utilities
   DEPENDS:=+libpq
   TITLE:=Command Line Interface (CLI) to PostgreSQL databases
-  DESCRIPTION:=Command Line Interface (CLI) to PostgreSQL databases.
   URL:=http://www.postgresql.org/
+  SUBMENU:=database
+endef
+
+define Package/pgsql-cli/description
+Command Line Interface (CLI) to PostgreSQL databases.
 endef
 
 define Package/pgsql-server
@@ -49,11 +56,15 @@ define Package/pgsql-server
   CATEGORY:=Utilities
   DEPENDS:=+libpq
   TITLE:=PostgreSQL databases Server
-  DESCRIPTION:=PostgreSQL databases Server.
   URL:=http://www.postgresql.org/
+  SUBMENU:=database
 endef
 
-# Need a native ecpg and zic for build
+define Package/pgsql-server/description
+PostgreSQL databases Server.
+endef
+
+# Need a native ecpg ,pg_config, and zic for build
 define Build/Configure
        (cd $(PKG_BUILD_DIR); rm -f config.cache; \
                ./configure \
@@ -87,12 +98,16 @@ define Build/Configure
                        --without-tcl \
                        --without-tk \
                        --with-zlib="yes" \
+                       --enable-depend \
        );
-       $(MAKE) -C $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc CC="gcc" CFLAGS+="-I../../libpq"
+       $(MAKE) -C $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc CC="$(HOSTCC)" CFLAGS+="-I../../libpq"
        mv $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc/ecpg \
                $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc/ecpg.host
-       $(MAKE) -C $(PKG_BUILD_DIR)/src/timezone CC="gcc"
+       $(MAKE) -C $(PKG_BUILD_DIR)/src/timezone CC="$(HOSTCC)"
        mv $(PKG_BUILD_DIR)/src/timezone/zic $(PKG_BUILD_DIR)/src/timezone/zic.host
+       $(MAKE) -C $(PKG_BUILD_DIR)/src/bin/pg_config CC="$(HOSTCC)"
+       mv $(PKG_BUILD_DIR)/src/bin/pg_config/pg_config \
+               $(PKG_BUILD_DIR)/src/bin/pg_config/pg_config.host
        $(MAKE) -C $(PKG_BUILD_DIR) distclean
 
        (cd $(PKG_BUILD_DIR); rm -f config.cache; \
@@ -132,11 +147,11 @@ define Build/Configure
                        --without-pam \
                        --without-perl \
                        --without-python \
-                       --without-readline \
                        --without-rendezvous \
                        --without-tcl \
                        --without-tk \
                        --with-zlib="yes" \
+                       --enable-depend \
        );
        $(SED) 's@ECPG = ../../preproc/ecpg@ECPG = ../../preproc/ecpg.host@' $(PKG_BUILD_DIR)/src/interfaces/ecpg/test/Makefile.regress
        $(SED) 's@\./zic -d@./zic.host -d@' $(PKG_BUILD_DIR)/src/timezone/Makefile
@@ -236,18 +251,18 @@ fi
 endef
 
 define Build/InstallDev
-       mkdir -p $(STAGING_DIR)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/pg_config $(STAGING_DIR)/usr/bin/
-       mkdir -p $(STAGING_DIR)/usr/include
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/libpq $(STAGING_DIR)/usr/include/
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/libpq-fe.h $(STAGING_DIR)/usr/include/
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/pg_config.h $(STAGING_DIR)/usr/include/
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/postgres_ext.h $(STAGING_DIR)/usr/include/
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/postgresql $(STAGING_DIR)/usr/include/
-       mkdir -p $(STAGING_DIR)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpq.{a,so*} $(STAGING_DIR)/usr/lib/
-       $(CP) $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc/ecpg.host $(STAGING_DIR)/usr/bin/ecpg
-       $(CP) $(PKG_BUILD_DIR)/src/timezone/zic.host $(STAGING_DIR)/usr/bin/zic
+       mkdir -p $(1)/usr/bin
+       $(CP) $(PKG_BUILD_DIR)/src/bin/pg_config/pg_config.host $(1)/usr/bin/pg_config
+       mkdir -p $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libpq $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libpq-fe.h $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/pg_config.h $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/postgres_ext.h $(1)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/postgresql $(1)/usr/include/
+       mkdir -p $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpq.{a,so*} $(1)/usr/lib/
+       $(CP) $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc/ecpg.host $(1)/usr/bin/ecpg
+       $(CP) $(PKG_BUILD_DIR)/src/timezone/zic.host $(1)/usr/bin/zic
 endef
 
 define Build/UninstallDev