Convert libpng to new packaging style
[openwrt.git] / 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 http://nthill.free.fr/openwrt/sources/$(PKG_NAME)/
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
17 PKG_CAT:=bzcat
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
20
21 IPKG_LIBPQ:=$(PACKAGE_DIR)/libpq_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
22 IDIR_LIBPQ:=$(PKG_BUILD_DIR)/ipkg
23 INFO_LIBPQ:=$(IPKG_STATE_DIR)/info/libpq.list
24
25 $(DL_DIR)/$(PKG_SOURCE):
26 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
27
28 $(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
29 $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
30 $(PATCH) $(PKG_BUILD_DIR) ./patches
31 touch $(PKG_BUILD_DIR)/.prepared
32
33 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
34 # ./configure advertise "--infodir", but does not support it, replaced with "--docdir"
35 (cd $(PKG_BUILD_DIR); rm -rf config.cache config.status; \
36 $(TARGET_CONFIGURE_OPTS) \
37 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
38 CPPFLAGS="$$CPPFLAGS -I$(STAGING_DIR)/usr/include" \
39 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
40 ./configure \
41 --target=$(GNU_TARGET_NAME) \
42 --host=$(GNU_TARGET_NAME) \
43 --build=$(GNU_HOST_NAME) \
44 --program-prefix="" \
45 --program-suffix="" \
46 --prefix=/usr \
47 --exec-prefix=/usr \
48 --bindir=/usr/bin \
49 --datadir=/usr/share \
50 --includedir=/usr/include \
51 --docdir=/usr/share/info \
52 --libdir=/usr/lib \
53 --libexecdir=/usr/lib \
54 --localstatedir=/var \
55 --mandir=/usr/share/man \
56 --sbindir=/usr/sbin \
57 --sysconfdir=/etc \
58 $(DISABLE_NLS) \
59 $(DISABLE_LARGEFILE) \
60 --enable-shared \
61 --enable-static \
62 --disable-integer-datetimes \
63 --disable-rpath \
64 --without-java \
65 --without-krb4 \
66 --without-krb5 \
67 --without-openssl \
68 --without-pam \
69 --without-perl \
70 --without-python \
71 --without-readline \
72 --without-rendezvous \
73 --without-tcl \
74 --without-tk \
75 --with-zlib="yes" \
76 );
77 touch $(PKG_BUILD_DIR)/.configured
78
79 $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
80 $(MAKE) -C "$(PKG_BUILD_DIR)/src" \
81 $(TARGET_CONFIGURE_OPTS) \
82 submake-libpq
83 touch $(PKG_BUILD_DIR)/.built
84
85 $(STAGING_DIR)/usr/lib/libpq.so: $(PKG_BUILD_DIR)/.built
86 $(MAKE) -C "$(PKG_BUILD_DIR)/src" \
87 DESTDIR="$(STAGING_DIR)" \
88 install-all-headers
89 $(MAKE) -C "$(PKG_BUILD_DIR)/src/include" \
90 DESTDIR="$(STAGING_DIR)" \
91 install
92 $(MAKE) -C "$(PKG_BUILD_DIR)/src/interfaces/libpq" \
93 DESTDIR="$(STAGING_DIR)" \
94 install
95 mkdir -p $(STAGING_DIR)/usr/lib
96 cp -a $(PKG_BUILD_DIR)/src/interfaces/libpq/libpq.so* $(STAGING_DIR)/usr/lib/
97 cp $(PKG_BUILD_DIR)/src/interfaces/libpq/libpq.a $(STAGING_DIR)/usr/lib/
98
99 $(IPKG_LIBPQ): $(STAGING_DIR)/usr/lib/libpq.so
100 $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_LIBPQ) ./ipkg/libpq.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
101 mkdir -p $(IDIR_LIBPQ)/usr/lib
102 cp -fpR $(STAGING_DIR)/usr/lib/libpq.so.* $(IDIR_LIBPQ)/usr/lib/
103 $(STRIP) $(IDIR_LIBPQ)/usr/lib/*.so*
104 mkdir -p $(PACKAGE_DIR)
105 $(IPKG_BUILD) $(IDIR_LIBPQ) $(PACKAGE_DIR)
106
107 $(INFO_LIBPQ): $(IPKG_LIBPQ)
108 $(IPKG) install $(IPKG_LIBPQ)
109
110 prepare: $(PKG_BUILD_DIR)/.prepared
111 compile: $(IPKG_LIBPQ)
112 install: $(INFO_LIBPQ)
113
114 clean:
115 -$(MAKE) -C "$(PKG_BUILD_DIR)" \
116 DESTDIR="$(STAGING_DIR)" \
117 uninstall
118 rm -rf $(PKG_BUILD_DIR) $(IPKG_LIBPQ)
This page took 0.044207 seconds and 5 git commands to generate.