update to postgresql 8.2.5 and refresh patches
[openwrt/svn-archive/archive.git] / libs / postgresql / Makefile
index 30103610eea444af8df71fab522fadb05fed707a..600cdd0eea0a44f5244354ca1b2e14ee32e1932f 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,9 +17,11 @@ 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_MD5SUM:=bb1cd309ea72f070cb964736f5755847
 PKG_CAT:=bzcat
 
+PKG_BUILD_DEPENDS:=libnotimpl
+
 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
 include $(INCLUDE_DIR)/package.mk
@@ -27,7 +29,7 @@ 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/
@@ -45,13 +47,13 @@ endef
 define Package/pgsql-server
   SECTION:=utils
   CATEGORY:=Utilities
-  DEPENDS:=+libpq @C99_MATH
+  DEPENDS:=+libpq
   TITLE:=PostgreSQL databases Server
   DESCRIPTION:=PostgreSQL databases Server.
   URL:=http://www.postgresql.org/
 endef
 
-# Need a native ecpg and zic for build
+# Need a native ecpg ,pg_config, and zic for build
 define Build/Configure
        (cd $(PKG_BUILD_DIR); rm -f config.cache; \
                ./configure \
@@ -85,19 +87,24 @@ 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; \
                $(TARGET_CONFIGURE_OPTS) \
                CFLAGS="$(TARGET_CFLAGS)" \
-               CPPFLAGS="$$$$CPPFLAGS $(EXTRA_CPPFLAGS)" \
-               LDFLAGS="$(EXTRA_LDFLAGS)" \
+               CPPFLAGS="$$$$CPPFLAGS $(TARGET_CPPFLAGS)" \
+               LDFLAGS="$(TARGET_LDFLAGS)" \
+               LIBS="-lnotimpl" \
                ./configure \
                        --target=$(GNU_TARGET_NAME) \
                        --host=$(GNU_TARGET_NAME) \
@@ -129,11 +136,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
@@ -234,7 +241,7 @@ endef
 
 define Build/InstallDev
        mkdir -p $(STAGING_DIR)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/pg_config $(STAGING_DIR)/usr/bin/
+       $(CP) $(PKG_BUILD_DIR)/src/bin/pg_config/pg_config.host $(STAGING_DIR)/usr/bin/pg_config
        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/