remove unused sflash
[openwrt.git] / openwrt / package / postgresql / ipkg / rules
1 #!/usr/bin/make -f
2
3 ifneq ($(strip ${IPKG_RULES_INC}),)
4 include $(IPKG_RULES_INC)
5 endif
6
7 ##
8
9 PKG_VERSION := $(shell cat ./ipkg/version)
10 CURRENT_DIR := $(shell pwd)
11 INSTALL_DIR ?= $(CURRENT_DIR)/ipkg-install
12
13 unexport INSTALL_DIR
14
15 I_LIBPQ := ipkg/libpq
16 I_LIBPQ_DEV := ipkg/libpq-dev
17 I_PGSQL_UTILS := ipkg/pgsql-utils
18
19 BUILD_DEPS := \
20 # $(STAGING_DIR)/usr/include/zlib.h \
21
22 CONFIGURE_OPTS = \
23 --enable-shared \
24 --enable-static \
25 --disable-integer-datetimes \
26 --disable-rpath \
27 --without-tcl \
28 --without-tk \
29 --without-perl \
30 --without-python \
31 --without-java \
32 --without-krb4 \
33 --without-krb5 \
34 --without-pam \
35 --without-openssl \
36 --without-rendezvous \
37 --without-readline \
38 --with-zlib \
39
40 ##
41
42 all: package
43
44
45 .stamp-configured: $(BUILD_DEPS)
46
47 rm -rf config.cache
48 $(TARGET_CONFIGURE_OPTS) \
49 CFLAGS="$(TARGET_CFLAGS)" \
50 ./configure \
51 --target=$(GNU_TARGET_NAME) \
52 --host=$(GNU_TARGET_NAME) \
53 --build=$(GNU_HOST_NAME) \
54 --prefix=/usr \
55 --exec-prefix=/usr \
56 --bindir=/usr/bin \
57 --datadir=/usr/share \
58 --includedir=/usr/include \
59 --libdir=/usr/lib \
60 --libexecdir=/usr/lib \
61 --localstatedir=/var \
62 --mandir=/usr/share/man \
63 --sbindir=/usr/sbin \
64 --sysconfdir=/etc \
65 $(DISABLE_LARGEFILE) \
66 $(DISABLE_NLS) \
67 $(CONFIGURE_OPTS) \
68
69 touch .stamp-configured
70
71
72 .stamp-built: .stamp-configured
73
74 $(MAKE)
75
76 touch .stamp-built
77
78
79 $(INSTALL_DIR)/usr/bin/psql: .stamp-built
80
81 mkdir -p $(INSTALL_DIR)
82
83 $(MAKE) \
84 DESTDIR="$(INSTALL_DIR)" \
85 install
86
87
88 configure: .stamp-configured
89
90
91 build: .stamp-built
92
93
94 install: $(INSTALL_DIR)/usr/bin/psql
95
96
97 package: $(INSTALL_DIR)/usr/bin/psql
98
99 mkdir -p $(I_LIBPQ)/usr/lib/
100 cp -fpR $(INSTALL_DIR)/usr/lib/libpq*.so.* $(I_LIBPQ)/usr/lib/
101 $(STRIP) $(I_LIBPQ)/usr/lib/lib*.so.*
102
103 mkdir -p $(I_LIBPQ_DEV)/usr/bin
104 cp -fpR $(INSTALL_DIR)/usr/bin/pg_config $(I_LIBPQ_DEV)/usr/bin/
105 mkdir -p $(I_LIBPQ_DEV)/usr/include
106 cp -fpR $(INSTALL_DIR)/usr/include/* $(I_LIBPQ_DEV)/usr/include/
107 mkdir -p $(I_LIBPQ_DEV)/usr/lib/
108 cp -fpR $(INSTALL_DIR)/usr/lib/lib*.a $(I_LIBPQ_DEV)/usr/lib/
109 cp -fpR $(INSTALL_DIR)/usr/lib/lib*.so* $(I_LIBPQ_DEV)/usr/lib/
110
111 mkdir -p $(I_PGSQL_UTILS)/usr/bin
112 cp -fpR $(INSTALL_DIR)/usr/bin/psql $(I_PGSQL_UTILS)/usr/bin/
113 $(STRIP) $(I_PGSQL_UTILS)/usr/bin/*
114
115 chmod 0755 ipkg/*/CONTROL/
116 chmod 0644 ipkg/*/CONTROL/control
117
118 perl -pi -e "s/^Arch.*:.*/Architecture: $(ARCH)/g" ipkg/*/CONTROL/control
119 ifneq ($(strip $(PKG_VERSION)),)
120 perl -pi -e "s/^Vers.*:.*/Version: $(PKG_VERSION)/g" ipkg/*/CONTROL/control
121 endif
122
123 $(IPKG_BUILD) $(I_LIBPQ) $(IPKG_TARGET_DIR)
124 $(IPKG_BUILD) $(I_LIBPQ_DEV) $(IPKG_TARGET_DIR)
125 $(IPKG_BUILD) $(I_PGSQL_UTILS) $(IPKG_TARGET_DIR)
126
127
128 clean:
129
130 $(MAKE) \
131 DESTDIR="$(INSTALL_DIR)" \
132 uninstall clean
133
134 rm -rf .stamp-* \
135 $(I_LIBPQ)/usr \
136 $(I_LIBPQ_DEV)/usr \
137 $(I_PGSQL_UTILS)/usr \
138
139
140 control:
141
142 @cat $(I_LIBPQ)/CONTROL/control
143 @echo
144 @cat $(I_LIBPQ_DEV)/CONTROL/control
145 @echo
146 @cat $(I_PGSQL_UTILS)/CONTROL/control
147 @echo
148
149
150 .PHONY: configure build install package clean control
This page took 0.047784 seconds and 5 git commands to generate.