Always use -R flag with cp (to preserve symlinks)
[openwrt.git] / openwrt / package / postgresql / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=postgresql
6 PKG_VERSION:=7.4.7
7 PKG_RELEASE:=3
8 PKG_MD5SUM:=32dac2916d16287d95e0c958a75161fa
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 PKG_CAT:=bzcat
17
18 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
19 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
20
21 include $(TOPDIR)/package/rules.mk
22
23 $(eval $(call PKG_template,LIBPQ,libpq,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
24
25 $(PKG_BUILD_DIR)/.configured:
26 # ./configure advertise "--infodir", but does not support it, replaced with "--docdir"
27 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
28 $(TARGET_CONFIGURE_OPTS) \
29 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
30 CPPFLAGS="$$CPPFLAGS -I$(STAGING_DIR)/usr/include" \
31 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
32 ./configure \
33 --target=$(GNU_TARGET_NAME) \
34 --host=$(GNU_TARGET_NAME) \
35 --build=$(GNU_HOST_NAME) \
36 --program-prefix="" \
37 --program-suffix="" \
38 --prefix=/usr \
39 --exec-prefix=/usr \
40 --bindir=/usr/bin \
41 --datadir=/usr/share \
42 --includedir=/usr/include \
43 --docdir=/usr/share/info \
44 --libdir=/usr/lib \
45 --libexecdir=/usr/lib \
46 --localstatedir=/var \
47 --mandir=/usr/share/man \
48 --sbindir=/usr/sbin \
49 --sysconfdir=/etc \
50 $(DISABLE_NLS) \
51 $(DISABLE_LARGEFILE) \
52 --enable-shared \
53 --enable-static \
54 --disable-integer-datetimes \
55 --disable-rpath \
56 --without-java \
57 --without-krb4 \
58 --without-krb5 \
59 --without-openssl \
60 --without-pam \
61 --without-perl \
62 --without-python \
63 --without-readline \
64 --without-rendezvous \
65 --without-tcl \
66 --without-tk \
67 --with-zlib="yes" \
68 );
69 touch $@
70
71 $(PKG_BUILD_DIR)/.built:
72 $(MAKE) -C "$(PKG_BUILD_DIR)/src/include" \
73 DESTDIR="$(PKG_INSTALL_DIR)" \
74 all install
75 $(MAKE) -C "$(PKG_BUILD_DIR)/src/interfaces/libpq" \
76 DESTDIR="$(PKG_INSTALL_DIR)" \
77 all install
78 touch $@
79
80 $(IPKG_LIBPQ): $(STAGING_DIR)/usr/lib/libpq.so
81 install -d -m0755 $(IDIR_LIBPQ)/usr/lib
82 cp -fpR $(STAGING_DIR)/usr/lib/libpq.so.* $(IDIR_LIBPQ)/usr/lib/
83 $(RSTRIP) $(IDIR_LIBPQ)
84 $(IPKG_BUILD) $(IDIR_LIBPQ) $(PACKAGE_DIR)
85
86 $(STAGING_DIR)/usr/lib/libpq.so: $(PKG_BUILD_DIR)/.built
87 mkdir -p $(STAGING_DIR)/usr/include
88 cp -fpR $(PKG_INSTALL_DIR)/usr/include/libpq-fe.h $(STAGING_DIR)/usr/include/
89 cp -fpR $(PKG_INSTALL_DIR)/usr/include/postgres_ext.h $(STAGING_DIR)/usr/include/
90 cp -fpR $(PKG_INSTALL_DIR)/usr/include/postgresql $(STAGING_DIR)/usr/include/
91 mkdir -p $(STAGING_DIR)/usr/lib
92 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libpq.{a,so*} $(STAGING_DIR)/usr/lib/
93 touch $(STAGING_DIR)/usr/lib/libpq.so
94
95 install-dev: $(STAGING_DIR)/usr/lib/libpq.so
96
97 uninstall-dev:
98 rm -rf \
99 $(STAGING_DIR)/usr/include/libpq-fe.h \
100 $(STAGING_DIR)/usr/include/postgres_ext.h \
101 $(STAGING_DIR)/usr/include/postgresql \
102 $(STAGING_DIR)/usr/lib/libpq.{a,so*} \
103
104 compile: install-dev
105 clean: uninstall-dev
This page took 0.053268 seconds and 5 git commands to generate.