| 1 | # $Id: Makefile 3112 2006-02-01 23:53:19Z mbm $
|
|---|
| 2 |
|
|---|
| 3 | include $(TOPDIR)/rules.mk
|
|---|
| 4 |
|
|---|
| 5 | PKG_NAME:=postgresql
|
|---|
| 6 | PKG_VERSION:=7.4.9
|
|---|
| 7 | PKG_RELEASE:=1
|
|---|
| 8 | PKG_MD5SUM:=d7cf0f0a0e1dda19268f55cb1e124c77
|
|---|
| 9 |
|
|---|
| 10 | PKG_SOURCE_URL:=\
|
|---|
| 11 | ftp://ftp3.us.postgresql.org/pub/postgresql/source/v$(PKG_VERSION)/ \
|
|---|
| 12 | ftp://ftp.br.postgresql.org/pub/PostgreSQL/source/v$(PKG_VERSION)/ \
|
|---|
| 13 | ftp://ftp.au.postgresql.org/pub/postgresql/source/v$(PKG_VERSION)/ \
|
|---|
| 14 | ftp://ftp.tw.postgresql.org/pub/postgresql/source/v$(PKG_VERSION)/
|
|---|
| 15 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 | include $(TOPDIR)/package/rules.mk
|
|---|
| 19 |
|
|---|
| 20 | $(eval $(call PKG_template,LIBPQ,libpq,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 21 | $(eval $(call PKG_template,PGSQL_CLI,pgsql-cli,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 22 |
|
|---|
| 23 | # ./configure advertise "--infodir", but does not support it, replaced with "--docdir"
|
|---|
| 24 | $(WRKBUILD)/.configured:
|
|---|
| 25 | (cd $(WRKBUILD); rm -rf config.{cache,status} ; \
|
|---|
| 26 | $(TARGET_CONFIGURE_OPTS) \
|
|---|
| 27 | CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
|
|---|
| 28 | CPPFLAGS="$$CPPFLAGS -I$(STAGING_DIR)/usr/include" \
|
|---|
| 29 | LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
|
|---|
| 30 | ./configure \
|
|---|
| 31 | --target=$(GNU_TARGET_NAME) \
|
|---|
| 32 | --host=$(GNU_TARGET_NAME) \
|
|---|
| 33 | --build=$(GNU_HOST_NAME) \
|
|---|
| 34 | --program-prefix="" \
|
|---|
| 35 | --program-suffix="" \
|
|---|
| 36 | --prefix=/usr \
|
|---|
| 37 | --exec-prefix=/usr \
|
|---|
| 38 | --bindir=/usr/bin \
|
|---|
| 39 | --datadir=/usr/share \
|
|---|
| 40 | --includedir=/usr/include \
|
|---|
| 41 | --docdir=/usr/share/info \
|
|---|
| 42 | --libdir=/usr/lib \
|
|---|
| 43 | --libexecdir=/usr/lib \
|
|---|
| 44 | --localstatedir=/var \
|
|---|
| 45 | --mandir=/usr/share/man \
|
|---|
| 46 | --sbindir=/usr/sbin \
|
|---|
| 47 | --sysconfdir=/etc \
|
|---|
| 48 | --disable-nls \
|
|---|
| 49 | --enable-largefile \
|
|---|
| 50 | --enable-shared \
|
|---|
| 51 | --enable-static \
|
|---|
| 52 | --disable-integer-datetimes \
|
|---|
| 53 | --disable-rpath \
|
|---|
| 54 | --without-java \
|
|---|
| 55 | --without-krb4 \
|
|---|
| 56 | --without-krb5 \
|
|---|
| 57 | --without-openssl \
|
|---|
| 58 | --without-pam \
|
|---|
| 59 | --without-perl \
|
|---|
| 60 | --without-python \
|
|---|
| 61 | --without-readline \
|
|---|
| 62 | --without-rendezvous \
|
|---|
| 63 | --without-tcl \
|
|---|
| 64 | --without-tk \
|
|---|
| 65 | --with-zlib="yes" \
|
|---|
| 66 | );
|
|---|
| 67 | touch $@
|
|---|
| 68 |
|
|---|
| 69 | $(WRKBUILD)/.built:
|
|---|
| 70 | $(MAKE) -C "$(WRKBUILD)/src/include" \
|
|---|
| 71 | DESTDIR="$(WRKINST)" \
|
|---|
| 72 | all install
|
|---|
| 73 | $(MAKE) -C "$(WRKBUILD)/src/interfaces/libpq" \
|
|---|
| 74 | DESTDIR="$(WRKINST)" \
|
|---|
| 75 | all install
|
|---|
| 76 | $(MAKE) -C "$(WRKBUILD)/src/bin/pg_config" \
|
|---|
| 77 | DESTDIR="$(WRKINST)" \
|
|---|
| 78 | includedir="$(STAGING_DIR)/usr/include" \
|
|---|
| 79 | libdir="$(STAGING_DIR)/usr/lib" \
|
|---|
| 80 | all install
|
|---|
| 81 | $(MAKE) -C "$(WRKBUILD)/src/bin/psql" \
|
|---|
| 82 | DESTDIR="$(WRKINST)" \
|
|---|
| 83 | all install
|
|---|
| 84 | touch $@
|
|---|
| 85 |
|
|---|
| 86 | $(IPKG_LIBPQ):
|
|---|
| 87 | install -d -m0755 $(IDIR_LIBPQ)/usr/lib
|
|---|
| 88 | $(CP) $(WRKINST)/usr/lib/libpq.so.* $(IDIR_LIBPQ)/usr/lib/
|
|---|
| 89 | $(RSTRIP) $(IDIR_LIBPQ)
|
|---|
| 90 | $(IPKG_BUILD) $(IDIR_LIBPQ) $(PACKAGE_DIR)
|
|---|
| 91 |
|
|---|
| 92 | $(IPKG_PGSQL_CLI):
|
|---|
| 93 | install -d -m0755 $(IDIR_PGSQL_CLI)/usr/bin
|
|---|
| 94 | $(CP) $(WRKINST)/usr/bin/psql $(IDIR_PGSQL_CLI)/usr/bin/
|
|---|
| 95 | $(RSTRIP) $(IDIR_PGSQL_CLI)
|
|---|
| 96 | $(IPKG_BUILD) $(IDIR_PGSQL_CLI) $(PACKAGE_DIR)
|
|---|
| 97 |
|
|---|
| 98 | $(STAGING_DIR)/usr/lib/libpq.so: $(WRKBUILD)/.built
|
|---|
| 99 | mkdir -p $(STAGING_DIR)/usr/bin
|
|---|
| 100 | $(CP) $(WRKINST)/usr/bin/pg_config $(STAGING_DIR)/usr/bin/
|
|---|
| 101 | mkdir -p $(STAGING_DIR)/usr/include
|
|---|
| 102 | $(CP) $(WRKINST)/usr/include/libpq $(STAGING_DIR)/usr/include/
|
|---|
| 103 | $(CP) $(WRKINST)/usr/include/libpq-fe.h $(STAGING_DIR)/usr/include/
|
|---|
| 104 | $(CP) $(WRKINST)/usr/include/pg_config.h $(STAGING_DIR)/usr/include/
|
|---|
| 105 | $(CP) $(WRKINST)/usr/include/postgres_ext.h $(STAGING_DIR)/usr/include/
|
|---|
| 106 | $(CP) $(WRKINST)/usr/include/postgresql $(STAGING_DIR)/usr/include/
|
|---|
| 107 | mkdir -p $(STAGING_DIR)/usr/lib
|
|---|
| 108 | $(CP) $(WRKINST)/usr/lib/libpq.{a,so*} $(STAGING_DIR)/usr/lib/
|
|---|
| 109 | touch $@
|
|---|
| 110 |
|
|---|
| 111 | install-dev: $(STAGING_DIR)/usr/lib/libpq.so
|
|---|
| 112 |
|
|---|
| 113 | uninstall-dev:
|
|---|
| 114 | rm -rf \
|
|---|
| 115 | $(STAGING_DIR)/usr/bin/pg_config \
|
|---|
| 116 | $(STAGING_DIR)/usr/include/libpq \
|
|---|
| 117 | $(STAGING_DIR)/usr/include/libpq-fe.h \
|
|---|
| 118 | $(STAGING_DIR)/usr/include/pg_config.h \
|
|---|
| 119 | $(STAGING_DIR)/usr/include/postgres_ext.h \
|
|---|
| 120 | $(STAGING_DIR)/usr/include/postgresql \
|
|---|
| 121 | $(STAGING_DIR)/usr/lib/libpq.{a,so*} \
|
|---|
| 122 |
|
|---|
| 123 | compile-targets: install-dev
|
|---|
| 124 | clean-targets: uninstall-dev
|
|---|