Fixes for OLSRd2 build process
[oonf.git] / openwrt / oonf-olsrd2-git / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=oonf-git
4 PKG_VERSION:=2014-11-07
5 #PKG_REV:=ec2bca8f28b4d14df049fc81e177160ca0e3c3a3
6 #PKG_RELEASE:=$(PKG_REV)
7
8 #PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
9 #PKG_SOURCE_URL:=http://olsr.org/git/oonf_api.git
10 #PKG_SOURCE_PROTO:=git
11 #PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
12 #PKG_SOURCE_VERSION:=$(PKG_REV)
13
14 CMAKE_INSTALL:=1
15
16 include $(INCLUDE_DIR)/package.mk
17 include $(INCLUDE_DIR)/cmake.mk
18
19 CMAKE_SOURCE_DIR=$(CURDIR)/../../
20 CMAKE_OPTIONS=-D OONF_NO_WERROR:Bool=true \
21               -D OONF_LOGGING_LEVEL:String=debug \
22               -D OONF_NO_TESTING:Bool=true \
23               -D UCI:Bool=true \
24               -D OONF_APP_DEFAULT_CFG_HANDLER:String=uci \
25               -D OONF_STATIC_PLUGINS:String="class;clock;duplicate_set;interface;layer2;packet_socket;rfc5444;socket;stream_socket;telnet;timer;viewer;os_clock;os_net;os_routing;os_system;nhdp;olsrv2;ff_dat_metric;neighbor_probing;nl80211_listener;link_config;layer2info;cfg_uciloader;nhdpinfo;olsrv2info" \
26               -D INSTALL_LIB_DIR:Path=lib/oonf \
27               -D INSTALL_INCLUDE_DIR:Path=include/oonf \
28               -D INSTALL_CMAKE_DIR:Path=lib/oonf \
29               -D CMAKE_PREFIX_PATH=$(STAGING_DIR)/usr
30
31 define Package/oonf-git/template
32         SECTION:=net
33         CATEGORY:=Network
34         MAINTAINER:=Henning Rogge <hrogge@gmail.com>
35         SUBMENU:=OLSR.org network framework
36         URL:=http://www.olsr.org/
37 endef
38
39 define Package/olsrd2-git
40         $(call Package/oonf-git/template) 
41         TITLE:= Build Olsrd V2 Routing Agent
42         DEPENDS:=+librt +libnl-tiny +libuci
43 endef
44
45 Build/Compile=$(call Build/Compile/Default,static)
46 Build/Install=
47
48 define Build/Install
49         $(INSTALL_BIN) -D $(PKG_BUILD_DIR)/$(MAKE_PATH)/olsrd2_static $(PKG_INSTALL_DIR)/usr/sbin/olsrd2;
50 endef
51
52 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include -I${STAGING_DIR}/usr/include/libnl-tiny
53
54 define Package/olsrd2-git/install
55         $(INSTALL_BIN)  -D $(PKG_BUILD_DIR)/olsrd2_static $(1)/usr/sbin/olsrd2
56         $(INSTALL_BIN)  -D ./files/olsrd2.init            $(1)/etc/init.d/olsrd2
57         $(INSTALL_BIN)  -D ./files/olsrd2.hotplug         $(1)/etc/hotplug.d/iface/50-olsrd2
58         $(INSTALL_DATA) -D ./files/olsrd2.uci             $(1)/etc/config/olsrd2
59 endef
60
61 define Package/olsrd2-git/conffiles
62 /etc/config/olsrd2
63 endef
64
65 $(eval $(call BuildPackage,olsrd2-git))