c8bb41edbb1aa1e3e9993cabdf865095d1c152e0
[openwrt/svn-archive/archive.git] / net / umurmur / Makefile
1 #
2 # Copyright (C) 2009-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=umurmur
10 PKG_VERSION:=0.2.2
11 PKG_RELEASE:=1
12
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14 PKG_SOURCE_URL:=http://umurmur.googlecode.com/files/
15 PKG_MD5SUM:=a841cf38de7fbc8bdacafbd481561da7
16
17 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/umurmur/Default
22 SECTION:=net
23 CATEGORY:=Network
24 TITLE:=uMurmur
25 DEPENDS:=+libconfig
26 URL:=http://code.google.com/p/umurmur
27 MAINTAINER:=Martin Johansson <martin@fatbob.nu>
28 endef
29
30 define Package/umurmur/Default/description
31 Minimalistic Mumble server daemon.
32 endef
33
34 define Package/umurmur-openssl
35 $(call Package/umurmur/Default)
36 TITLE+= (with OpenSSL support)
37 DEPENDS+= +libopenssl
38 VARIANT:=openssl
39 endef
40
41 define Package/umurmur-openssl/description
42 $(call Package/umurmur/Default/description)
43 Uses OpenSSL library for SSL and crypto.
44 endef
45
46 define Package/umurmur-polarssl
47 $(call Package/umurmur/Default)
48 TITLE+= (with PolarSSL support)
49 DEPENDS+= +libpolarssl
50 VARIANT:=polarssl
51 endef
52
53 define Package/umurmur-polarssl/description
54 $(call Package/umurmur/Default/description)
55 Uses the PolarSSL library for SSL and crypto.
56 endef
57
58 define Build/Compile
59 CC="$(TARGET_CC)" \
60 CFLAGS="$(TARGET_CFLAGS)" \
61 LDFLAGS="$(TARGET_LDFLAGS)" \
62 $(MAKE) -C $(PKG_BUILD_DIR)/src all
63 endef
64
65 define Package/umurmur-openssl/conffiles
66 /etc/umurmur.conf
67 endef
68
69 Package/umurmur-polarssl/conffiles = $(Package/umurmur-openssl/conffiles)
70
71 define Package/umurmur-openssl/install
72 $(INSTALL_DIR) $(1)/usr/bin
73 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/umurmurd $(1)/usr/bin/
74 $(INSTALL_DIR) $(1)/etc
75 $(INSTALL_CONF) $(PKG_BUILD_DIR)/openwrt/files/umurmur.conf $(1)/etc/
76 $(INSTALL_DIR) $(1)/etc/init.d
77 $(INSTALL_BIN) $(PKG_BUILD_DIR)/openwrt/files/umurmur.init $(1)/etc/init.d/umurmur
78 $(INSTALL_DIR) $(1)/etc/umurmur
79 endef
80
81 Package/umurmur-polarssl/install = $(Package/umurmur-openssl/install)
82
83 ifeq ($(BUILD_VARIANT),openssl)
84 TARGET_CFLAGS += -DWRT_TARGET -I$(STAGING_DIR)/usr/include
85 TARGET_LDFLAGS += -lcrypto -lssl
86 endif
87
88 ifeq ($(BUILD_VARIANT),polarssl)
89 TARGET_CFLAGS += -DUSE_POLARSSL -DWRT_TARGET -I$(STAGING_DIR)/usr/include
90 TARGET_LDFLAGS += -lpolarssl
91 endif
92
93 $(eval $(call BuildPackage,umurmur-openssl))
94 $(eval $(call BuildPackage,umurmur-polarssl))