AA: rrdtool-1.0.x: merge r38944 (#14554)
[12.09/packages.git] / libs / wt / Makefile
1 #
2 # Copyright (C) 2007-2011 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:=wt
11 PKG_VERSION:=3.1.9
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://downloads.sourceforge.net/project/witty/wt/$(PKG_VERSION)
16 PKG_MD5SUM:=ee9490d5f24a47766e54f630ba0da2bb
17
18 include $(INCLUDE_DIR)/package.mk
19 include $(INCLUDE_DIR)/cmake.mk
20
21 PKG_INSTALL:=1
22
23 define Package/wt/Default
24   SECTION:=libs
25   CATEGORY:=Libraries
26   URL:=http://www.webtoolkit.eu/wt
27 endef
28
29 define Package/wt
30   $(call Package/wt/Default)
31   MENU:=1
32   DEPENDS:= +libstdcpp +boost-date_time +boost-system +boost-filesystem +boost-thread +boost-program_options +boost-signals +boost-regex +libpthread
33   TITLE:=C++ Web Toolkit
34 endef
35
36 define Package/wt-resources
37   $(call Package/wt/Default)
38   DEPENDS:=wt
39   TITLE:=Optional Resource Files
40 endef
41
42 define Package/wt-fcgi
43   $(call Package/wt/Default)
44   DEPENDS:=wt +fcgixx
45   TITLE:=FastCGI Connector
46 endef
47
48 define Package/wt-http
49   $(call Package/wt/Default)
50   DEPENDS:=wt +PACKAGE_wt_http_zlib:zlib +PACKAGE_wt_http_ssl:libopenssl
51   TITLE:=Built in HTTP Server
52 endef
53
54 define Package/wt-http/config
55 config PACKAGE_wt_http_zlib
56     bool "Enable zlib compression option"
57     depends on PACKAGE_wt-http
58     default n
59 config PACKAGE_wt_http_ssl
60     bool "Enable ssl option"
61     depends on PACKAGE_wt-http
62     default n
63 endef
64
65 define Package/wt-dbo
66   $(call Package/wt/Default)
67   DEPENDS:=wt
68   TITLE:=Object Relational Mapping
69 endef
70
71 define Package/wt-dbosqlite3
72   $(call Package/wt/Default)
73   DEPENDS:=wt +wt-dbo
74   TITLE:=Sqlite3 Dbo Backend
75 endef
76
77 define Package/wt-resources/conffiles
78 /usr/share/Wt
79 endef
80
81 # TODO: some parts of the code show that -DHAVE_GNU_REGEX can be defined to avoid dependence or boost-regex
82 # But that's turning out not to be the case (some portions still depend on boost-regex)
83 TARGET_CFLAGS += $(FPIC)
84 CMAKE_OPTIONS += \
85         -DCMAKE_BUILD_TYPE=MinSizeRel \
86         -DCMAKE_CXX_FLAGS_MINSIZEREL:STRING="-DNDEBUG -DWT_NO_SPIRIT -DWT_NO_XSS_FILTER" \
87         -DSHARED_LIBS:BOOL=ON \
88         -DBUILD_TESTS=OFF \
89         -DBUILD_EXAMPLES=OFF \
90         -DINSTALL_RESOURCES=ON \
91         -DENABLE_GM=OFF \
92         -DENABLE_HARU=OFF \
93         -DENABLE_PANGO=OFF \
94         -DENABLE_EXT=OFF \
95         -DENABLE_POSTGRES=OFF \
96         -DENABLE_QT4=OFF \
97         -DWT_NO_STD_LOCALE=ON \
98         -DWT_NO_STD_WSTRING=ON
99
100 ifndef CONFIG_PACKAGE_wt-http
101 CMAKE_OPTIONS += \
102         -DCONNECTOR_HTTP=OFF
103 endif
104
105 ifndef CONFIG_PACKAGE_wt_http_zlib
106 CMAKE_OPTIONS += \
107         -DHTTP_WITH_ZLIB=OFF
108 endif
109
110 ifndef CONFIG_PACKAGE_wt_http_ssl
111 CMAKE_OPTIONS += \
112         -DHTTP_WITH_SSL=OFF
113 endif
114
115 ifndef CONFIG_PACKAGE_wt-fcgi
116 CMAKE_OPTIONS += \
117         -DCONNECTOR_FCGI=OFF
118 endif
119
120 define Build/InstallDev
121         $(INSTALL_DIR) $(1)/usr/include
122         $(CP) -a $(PKG_INSTALL_DIR)/usr/include/Wt $(1)/usr/include
123
124         $(INSTALL_DIR) $(1)/usr/share/cmake-2.4/Modules
125         $(CP) $(PKG_INSTALL_DIR)/usr/share/cmake-2.4/Modules/FindWt.cmake $(1)/usr/share/cmake-2.4/Modules
126
127         $(INSTALL_DIR) $(1)/usr/lib
128         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwt*.so* $(1)/usr/lib
129 endef
130
131 define BuildPlugin
132   define Package/$(1)/install
133         $(INSTALL_DIR) $$(1)/usr/lib
134         for m in $(2); do \
135                 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwt$$$$$$$${m}.so* $$(1)/usr/lib/ ; \
136         done
137   endef
138
139   $$(eval $$(call BuildPackage,$(1)))
140 endef
141
142 define Package/wt/install
143         $(INSTALL_DIR) $(1)/etc/wt
144         $(INSTALL_DATA) $(PKG_BUILD_DIR)/wt_config.xml $(1)/etc/wt
145
146         $(INSTALL_DIR) $(1)/usr/lib
147         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwt.so* $(1)/usr/lib
148 endef
149
150 define Package/wt/conffiles
151 /etc/wt
152 endef
153
154 define Package/wt-resources/install
155         $(INSTALL_DIR) $(1)/usr/share
156         $(CP) -a $(PKG_INSTALL_DIR)/usr/share/Wt $(1)/usr/share
157 endef
158
159 $(eval $(call BuildPackage,wt))
160 $(eval $(call BuildPackage,wt-resources))
161 $(eval $(call BuildPlugin,wt-http,http))
162 $(eval $(call BuildPlugin,wt-fcgi,fcgi))
163 $(eval $(call BuildPlugin,wt-dbo,dbo))
164 $(eval $(call BuildPlugin,wt-dbosqlite3,dbosqlite3))