[packages] postgresql (lib): install pg_config_manual.h into staging dir as well...
[openwrt/svn-archive/archive.git] / libs / postgresql / Makefile
index 12875c5161d43326d8b0da31a6ede9f91258f067..ef49b14ea1535cfc893f6ccaa6d06174b3ca14e6 100644 (file)
@@ -1,28 +1,24 @@
-# 
-# Copyright (C) 2006 OpenWrt.org
+#
+# Copyright (C) 2006-2009 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
-# $Id$
 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=postgresql
-PKG_VERSION:=8.2.3
+PKG_VERSION:=8.3.3
 PKG_RELEASE:=2
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=\
-       ftp://ftp.us.postgresql.org/pub/mirrors/postgresql/source/v$(PKG_VERSION) \
+       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://ftp.be.postgresql.org/postgresql/source/v$(PKG_VERSION) \
        ftp://ftp-archives.postgresql.org/pub/source/v$(PKG_VERSION)
-PKG_MD5SUM:=cb47771004d53505200ffd00ac45bc32
-PKG_CAT:=bzcat
-
-PKG_BUILD_DEPENDS:=libnotimpl
-
-PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
+PKG_MD5SUM:=0ae4bd9620e84d3e08dcf923808d14d0
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -31,8 +27,12 @@ define Package/libpq
   CATEGORY:=Libraries
   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 +40,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,8 +53,12 @@ define Package/pgsql-server
   CATEGORY:=Utilities
   DEPENDS:=+libpq
   TITLE:=PostgreSQL databases Server
-  DESCRIPTION:=PostgreSQL databases Server.
   URL:=http://www.postgresql.org/
+  SUBMENU:=database
+endef
+
+define Package/pgsql-server/description
+PostgreSQL databases Server.
 endef
 
 # Need a native ecpg ,pg_config, and zic for build
@@ -104,7 +112,6 @@ define Build/Configure
                CFLAGS="$(TARGET_CFLAGS)" \
                CPPFLAGS="$$$$CPPFLAGS $(TARGET_CPPFLAGS)" \
                LDFLAGS="$(TARGET_LDFLAGS)" \
-               LIBS="-lnotimpl" \
                ./configure \
                        --target=$(GNU_TARGET_NAME) \
                        --host=$(GNU_TARGET_NAME) \
@@ -141,11 +148,16 @@ define Build/Configure
                        --without-tk \
                        --with-zlib="yes" \
                        --enable-depend \
+                       $(if $(CONFIG_TARGET_avr32),--disable-spinlocks) \
        );
        $(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
+       # note: unclear if this is needed yet, commenting out for the moment
+       #$(SED) 's@US/Eastern@America/New_York@' $(PKG_BUILD_DIR)/src/timezone/Makefile
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
        $(MAKE) -C "$(PKG_BUILD_DIR)" \
                DESTDIR="$(PKG_INSTALL_DIR)" \
@@ -159,7 +171,7 @@ endef
 
 define Package/pgsql-cli/install
        $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/psql $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/psql $(1)/usr/bin/
 endef
 
 define Package/pgsql-server/install
@@ -171,18 +183,25 @@ define Package/pgsql-server/install
        $(INSTALL_BIN) \
                $(PKG_INSTALL_DIR)/usr/bin/postgres \
                $(PKG_INSTALL_DIR)/usr/bin/dropdb \
+               $(PKG_INSTALL_DIR)/usr/bin/clusterdb \
                $(PKG_INSTALL_DIR)/usr/bin/createdb \
+               $(PKG_INSTALL_DIR)/usr/bin/createlang \
                $(PKG_INSTALL_DIR)/usr/bin/createuser \
+               $(PKG_INSTALL_DIR)/usr/bin/droplang \
                $(PKG_INSTALL_DIR)/usr/bin/dropuser \
                $(PKG_INSTALL_DIR)/usr/bin/initdb \
+               $(PKG_INSTALL_DIR)/usr/bin/ipcclean \
                $(PKG_INSTALL_DIR)/usr/bin/pg_config \
                $(PKG_INSTALL_DIR)/usr/bin/pg_controldata \
                $(PKG_INSTALL_DIR)/usr/bin/pg_ctl \
                $(PKG_INSTALL_DIR)/usr/bin/pg_dump \
                $(PKG_INSTALL_DIR)/usr/bin/pg_dumpall \
                $(PKG_INSTALL_DIR)/usr/bin/pg_restore \
+               $(PKG_INSTALL_DIR)/usr/bin/pg_resetxlog \
+               $(PKG_INSTALL_DIR)/usr/bin/reindexdb \
                $(PKG_INSTALL_DIR)/usr/bin/vacuumdb \
                $(1)/usr/bin
+       ln -sf postgres $(1)/usr/bin/postmaster
 
        $(INSTALL_BIN) ./files/postgresql.init $(1)/etc/init.d/postgresql
 
@@ -200,6 +219,7 @@ define Package/pgsql-server/install
                $(PKG_INSTALL_DIR)/usr/share/postgresql/psqlrc.sample \
                $(PKG_INSTALL_DIR)/usr/share/postgresql/recovery.conf.sample \
                $(PKG_INSTALL_DIR)/usr/share/postgresql/system_views.sql \
+               $(PKG_INSTALL_DIR)/usr/share/postgresql/snowball_create.sql \
                $(1)/usr/share/postgresql
 
                $(INSTALL_DATA) ./files/postgresql.config $(1)/etc/config/postgresql
@@ -230,7 +250,7 @@ fi
 
 if [ -z "$${RG}" -o -z "$${RU}" ]; then
   echo "Could not find user utils, you will need to create the postgres user by hand"
-  exit 
+  exit
 fi
 
 if [ "$${RG}" != "0" -o "$${RU}" != "0" ]; then
@@ -240,31 +260,19 @@ fi
 endef
 
 define Build/InstallDev
-       mkdir -p $(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/
-       $(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
-endef
-
-define Build/UninstallDev
-       rm -rf \
-               $(STAGING_DIR)/usr/bin/pg_config \
-               $(STAGING_DIR)/usr/include/libpq \
-               $(STAGING_DIR)/usr/include/libpq-fe.h \
-               $(STAGING_DIR)/usr/include/pg_config.h \
-               $(STAGING_DIR)/usr/include/postgres_ext.h \
-               $(STAGING_DIR)/usr/include/postgresql \
-               $(STAGING_DIR)/usr/lib/libpq.{a,so*} \
-               $(STAGING_DIR)/usr/bin/ecpg \
-               $(STAGING_DIR)/usr/bin/zic
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/bin/pg_config/pg_config.host $(1)/usr/bin/pg_config
+       $(INSTALL_DIR) $(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/pg_config_manual.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/
+       $(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) $(PKG_BUILD_DIR)/src/timezone/zic.host $(1)/usr/bin/zic
 endef
 
 $(eval $(call BuildPackage,libpq))