shairport-sync: Create mbed TLS version (replaces PolarSSL)
[feed/packages.git] / sound / shairport-sync / Makefile
1 #
2 # This is free software, licensed under the GNU General Public License v2.
3 # See /LICENSE for more information.
4 # updated to work with latest source from abrasive
5 #
6
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=shairport-sync
10 PKG_VERSION:=2.8.6
11 PKG_RELEASE:=2
12
13 PKG_SOURCE_PROTO:=git
14 PKG_SOURCE_URL:=git://github.com/mikebrady/shairport-sync.git
15 PKG_SOURCE_VERSION:=$(PKG_VERSION)
16 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
17 PKG_SOURCE:=$(PKG_VERSION).tar.gz
18 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>, \
19 Mike Brady <mikebrady@eircom.net>
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)
22
23 PKG_LICENSE:=MIT
24 PKG_LICENSE_FILES:=COPYING LICENSES shairport.c
25
26 PKG_BUILD_PARALLEL:=1
27 PKG_FIXUP:=autoreconf
28
29 include $(INCLUDE_DIR)/package.mk
30
31 define Package/shairport-sync/default
32 SECTION:=sound
33 CATEGORY:=Sound
34 TITLE:=AirPlay compatible audio player
35 DEPENDS:=@AUDIO_SUPPORT +libpthread +alsa-lib +libconfig +libdaemon +libpopt
36 PROVIDES:=shairport-sync
37 URL:=http://github.com/mikebrady/shairport-sync
38 endef
39
40 define Package/shairport-sync-openssl
41 $(Package/shairport-sync/default)
42 TITLE+= (openssl)
43 DEPENDS+= +libopenssl +libavahi-client +libsoxr
44 VARIANT:=openssl
45 endef
46
47 define Package/shairport-sync-mbedtls
48 $(Package/shairport-sync/default)
49 TITLE+= (mbed TLS)
50 DEPENDS+= +libmbedtls +libavahi-client +libsoxr
51 VARIANT:=mbedtls
52 DEFAULT_VARIANT:=1
53 endef
54
55 define Package/shairport-sync-mini
56 $(Package/shairport-sync/default)
57 TITLE+= (minimal)
58 DEPENDS+= +libmbedtls
59 VARIANT:=mini
60 endef
61
62 define Package/shairport-sync/default/description
63 Shairport Sync plays audio from iTunes and AirPlay sources, including
64 iOS devices, Quicktime Player and third party sources such as forkedDaapd.
65 Audio played by a Shairport Sync-powered device stays synchronised with the source
66 and hence with similar devices playing the same source.
67
68 Shairport Sync does not support AirPlay video or photo streaming.
69 Ensure Kernel Modules > Sound Support > kmod-sound-core is selected.
70 Also select kmod-usb-audio if you want to use USB-connected sound cards.
71 endef
72 Package/shairport-sync-openssl/description = $(Package/shairport-sync/default/description)
73 Package/shairport-sync-mbedtls/description = $(Package/shairport-sync/default/description)
74
75 define Package/shairport-sync-mini/description
76 $(Package/shairport-sync/default/description)
77
78 Minimal version uses mbed TLS and does not include libsoxr and avahi support.
79 endef
80
81 CONFIGURE_ARGS+= \
82 --with-alsa \
83 --with-metadata
84
85 ifeq ($(BUILD_VARIANT),openssl)
86 CONFIGURE_ARGS+= --with-ssl=openssl
87 endif
88
89 ifeq ($(BUILD_VARIANT),mbedtls)
90 CONFIGURE_ARGS+= --with-ssl=mbedtls
91 endif
92
93 ifeq ($(BUILD_VARIANT),mini)
94 CONFIGURE_ARGS+= --with-ssl=mbedtls --with-tinysvcmdns
95 else
96 CONFIGURE_ARGS+= --with-avahi --with-soxr
97 endif
98
99 define Package/shairport-sync/default/conffiles
100 /etc/shairport-sync.conf
101 endef
102
103 Package/shairport-sync-openssl/conffiles = $(Package/shairport-sync/default/conffiles)
104 Package/shairport-sync-mbedtls/conffiles = $(Package/shairport-sync/default/conffiles)
105 Package/shairport-sync-mini/conffiles = $(Package/shairport-sync/default/conffiles)
106
107 define Package/shairport-sync/default/install
108 $(INSTALL_DIR) $(1)/usr/bin
109 $(INSTALL_BIN) $(PKG_BUILD_DIR)/shairport-sync $(1)/usr/bin/
110 $(INSTALL_DIR) $(1)/etc
111 $(INSTALL_DATA) $(PKG_BUILD_DIR)/scripts/shairport-sync.conf $(1)/etc/shairport-sync.conf
112 $(INSTALL_DIR) $(1)/etc/init.d
113 $(INSTALL_BIN) ./files/shairport-sync.init $(1)/etc/init.d/shairport-sync
114 $(INSTALL_DIR) $(1)/etc/config
115 $(INSTALL_DATA) ./files/shairport-sync.config $(1)/etc/config/shairport-sync
116 endef
117
118 Package/shairport-sync-openssl/install = $(Package/shairport-sync/default/install)
119 Package/shairport-sync-mbedtls/install = $(Package/shairport-sync/default/install)
120 Package/shairport-sync-mini/install = $(Package/shairport-sync/default/install)
121
122 $(eval $(call BuildPackage,shairport-sync-openssl))
123 $(eval $(call BuildPackage,shairport-sync-mbedtls))
124 $(eval $(call BuildPackage,shairport-sync-mini))