211d96cf2a630ad4c59f0a0e5217369e435ffb9b
[packages.git] / libs / libdbi-drivers / Makefile
1 #
2 # Copyright (C) 2009-2014 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=libdbi-drivers
11 PKG_VERSION:=0.9.0
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@SF/libdbi-drivers
16 PKG_MD5SUM:=9f47b960e225eede2cdeaabf7d22f59f
17
18 PKG_FIXUP:=autoreconf
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/libdbi-drivers/default
23   SECTION:=libs
24   CATEGORY:=Libraries
25   TITLE:=libdbi-drivers
26   URL:=http://libdbi-drivers.sourceforge.net/
27 endef
28
29 define Package/libdbi-drivers/default/description
30        libdbi-drivers project provides the database-specific drivers
31 for the libdbi framework
32 endef
33
34 define Package/libdbi-drivers-mysql
35 $(call Package/libdbi-drivers/default)
36   DEPENDS:=libdbi +PACKAGE_libdbi-drivers-mysql:libmysqlclient
37   TITLE:= libdbi-drivers-mysql
38 endef
39
40 define Package/libdbi-drivers-mysql2/description
41        libdbi-driver for mysql
42 endef
43
44 define Package/libdbi-drivers-pgsql
45 $(call Package/libdbi-drivers/default)
46   DEPENDS:=libdbi +PACKAGE_libdbi-drivers-pgsql:libpq
47   TITLE:= libdbi-drivers-pgsql
48 endef
49
50 define Package/libdbi-drivers-pgsql/description
51        libdbi-driver for pgsql
52 endef
53
54 define Package/libdbi-drivers-sqlite2
55 $(call Package/libdbi-drivers/default)
56   DEPENDS:=libdbi +PACKAGE_libdbi-drivers-sqlite2:libsqlite2
57   TITLE:= libdbi-drivers-sqlite2
58 endef
59
60 define Package/libdbi-drivers-sqlite2/description
61        libdbi-driver for sqlite2
62 endef
63
64 define Package/libdbi-drivers-sqlite3
65 $(call Package/libdbi-drivers/default)
66   DEPENDS:=libdbi +PACKAGE_libdbi-drivers-sqlite3:libsqlite3
67   TITLE:= libdbi-drivers-sqlite3
68 endef
69
70 define Package/libdbi-drivers-sqlite3/description
71        libdbi-driver for sqlite3
72 endef
73
74 CONFIGURE_ARGS += \
75                   --enable-shared \
76                   --disable-static \
77                   --disable-rpath \
78                   --disable-docs \
79                   --with-dbi-incdir=$(STAGING_DIR)/usr/include \
80                   --with-dbi-libdir=$(STAGING_DIR)/usr/lib
81
82 ifneq ($(CONFIG_PACKAGE_libdbi-drivers-mysql),)
83 CONFIGURE_ARGS += \
84                   --with-mysql \
85                   --with-mysql-incdir=$(STAGING_DIR)/usr/include/mysql \
86                   --with-mysql-libdir=$(STAGING_DIR)/usr/lib/mysql
87 TARGET_LDFLAGS += \
88                   -L$(STAGING_DIR)/usr/lib/mysql/
89 endif
90
91 ifneq ($(SDK)$(CONFIG_PACKAGE_libdbi-drivers-pgsql),)
92 CONFIGURE_ARGS += \
93                   --with-pgsql \
94                   --with-pgsql-incdir=$(STAGING_DIR)/usr/include \
95                   --with-pgsql-libdir=$(STAGING_DIR)/usr/lib
96 endif
97
98 ifneq ($(SDK)$(CONFIG_PACKAGE_libdbi-drivers-sqlite2),)
99 CONFIGURE_ARGS += \
100                   --with-sqlite \
101                   --with-sqlite-incdir=$(STAGING_DIR)/usr/include \
102                   --with-sqlite-libdir=$(STAGING_DIR)/usr/lib
103 endif
104
105 ifneq ($(SDK)$(CONFIG_PACKAGE_libdbi-drivers-sqlite3),)
106 CONFIGURE_ARGS += \
107                   --with-sqlite3 \
108                   --with-sqlite3-incdir=$(STAGING_DIR)/usr/include \
109                   --with-sqlite3-libdir=$(STAGING_DIR)/usr/lib
110 endif
111
112 define Package/libdbi-drivers-mysql/install
113         $(INSTALL_DIR) $(1)/usr/lib/dbd
114         $(INSTALL_BIN) $(PKG_BUILD_DIR)/drivers/mysql/.libs/libdbdmysql.so $(1)/usr/lib/dbd
115 endef
116
117 define Package/libdbi-drivers-pgsql/install
118         $(INSTALL_DIR) $(1)/usr/lib/dbd
119         $(INSTALL_BIN) $(PKG_BUILD_DIR)/drivers/pgsql/.libs/libdbdpgsql.so $(1)/usr/lib/dbd
120 endef
121
122 define Package/libdbi-drivers-sqlite2/install
123         $(INSTALL_DIR) $(1)/usr/lib/dbd
124         $(INSTALL_BIN) $(PKG_BUILD_DIR)/drivers/sqlite/.libs/libdbdsqlite.so $(1)/usr/lib/dbd
125 endef
126
127 define Package/libdbi-drivers-sqlite3/install
128         $(INSTALL_DIR) $(1)/usr/lib/dbd
129         $(INSTALL_BIN) $(PKG_BUILD_DIR)/drivers/sqlite3/.libs/libdbdsqlite3.so $(1)/usr/lib/dbd
130 endef
131
132
133 #$(eval $(call BuildPackage,libdbi-drivers))
134 $(eval $(call BuildPackage,libdbi-drivers-mysql))
135 $(eval $(call BuildPackage,libdbi-drivers-pgsql))
136 $(eval $(call BuildPackage,libdbi-drivers-sqlite2))
137 $(eval $(call BuildPackage,libdbi-drivers-sqlite3))