postgresql: update to 9.0.15
[openwrt/svn-archive/archive.git] / libs / postgresql / Makefile
index 7ef6aa78a06009301263c63b0143812fcf3c8d43..f9086bb1626c23a7b62261256f3d96d08766256e 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2010 OpenWrt.org
+# Copyright (C) 2006-2012 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,25 +8,24 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=postgresql
-PKG_VERSION:=9.0.0
+PKG_VERSION:=9.0.15
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=\
-       http://ftp7.us.postgresql.org/pub/postgresql/source/v$(PKG_VERSION) \
-       http://ftp8.us.postgresql.org/pub/postgresql/source/v$(PKG_VERSION) \
-       http://ftp9.us.postgresql.org/pub/postgresql/source/v$(PKG_VERSION) \
+       http://ftp9.us.postgresql.org/pub/mirrors/postgresql/source/v$(PKG_VERSION) \
        http://ftp.be.postgresql.org/postgresql/source/v$(PKG_VERSION) \
        ftp://ftp-archives.postgresql.org/pub/source/v$(PKG_VERSION)
-PKG_MD5SUM:=14c2122cc322e69ab2ab702ed7714bbe
+PKG_MD5SUM:=1bd7f659c4f68e5fc23511c6952b494b
 PKG_BUILD_PARALLEL:=1
+PKG_FIXUP:=autoreconf
 
 include $(INCLUDE_DIR)/package.mk
 
 define Package/libpq
   SECTION:=libs
   CATEGORY:=Libraries
-  DEPENDS:=+zlib +libreadline +libncurses +coreutils-su
+  DEPENDS:=+zlib +libreadline +libpthread +libncurses +shadow-su
   TITLE:=PostgreSQL client library
   URL:=http://www.postgresql.org/
   SUBMENU:=database
@@ -79,7 +78,6 @@ define Build/Configure
                        --sbindir=/usr/sbin \
                        --sysconfdir=/etc \
                        $(DISABLE_NLS) \
-                       $(DISABLE_LARGEFILE) \
                        --enable-shared \
                        --enable-static \
                        --disable-integer-datetimes \
@@ -103,7 +101,9 @@ define Build/Configure
        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="$(HOSTCC)"
-       mv $(PKG_BUILD_DIR)/src/timezone/zic $(STAGING_DIR)/host/bin/zic
+       mv $(PKG_BUILD_DIR)/src/timezone/zic $(PKG_BUILD_DIR)/host-zic
+       $(INSTALL_DIR) $(STAGING_DIR)/host/bin/
+       $(CP) $(PKG_BUILD_DIR)/host-zic $(STAGING_DIR)/host/bin/zic
        $(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
@@ -155,13 +155,16 @@ define Build/Configure
        $(SED) 's@ECPG = ../../preproc/ecpg@ECPG = ../../preproc/ecpg.host@' $(PKG_BUILD_DIR)/src/interfaces/ecpg/test/Makefile.regress
 endef
 
-TARGET_CFLAGS += $(FPIC)
+TARGET_CFLAGS += $(FPIC) -lpthread
+
+# because PROFILE means something else in the project Makefile
+unexport PROFILE
 
 define Build/Compile
-       $(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
+       +$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
                DESTDIR="$(PKG_INSTALL_DIR)" \
                all
-       $(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
+       +$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
                DESTDIR="$(PKG_INSTALL_DIR)" \
                install
 endef
@@ -197,6 +200,10 @@ define Package/pgsql-server/install
                $(1)/usr/lib
 endef
 
+define Package/pgsql-server/conffiles
+/etc/config/postgresql
+endef
+
 define Package/pgsql-server/postinst
 #!/bin/sh
 grep -q '^postgres:' /etc/passwd && exit 0
@@ -236,7 +243,7 @@ define Build/InstallDev
        $(INSTALL_DIR) $(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) $(STAGING_DIR)/host/bin/zic $(1)/usr/bin/zic
+       $(CP) $(PKG_BUILD_DIR)/host-zic $(1)/usr/bin/zic
 endef
 
 $(eval $(call BuildPackage,libpq))