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