[packages] pulseaudio: make configfiles readable by user pulse (#10728)
[openwrt/svn-archive/archive.git] / sound / pulseaudio / Makefile
1 #
2 # Copyright (C) 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:=pulseaudio
11 PKG_VERSION:=1.1
12 PKG_RELEASE:=4
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://freedesktop.org/software/pulseaudio/releases/
16 PKG_MD5SUM:=1b76932ca7c4b2aa992941e41ed4594b
17
18 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
19 PKG_BUILD_DEPENDS:=intltool/host
20
21 PKG_FIXUP = libtool
22
23 PKG_INSTALL = 1
24
25 include $(INCLUDE_DIR)/package.mk
26 include $(INCLUDE_DIR)/nls.mk
27
28 #TODO: split pulse into executable and library (or even better into several libraries since they're used as loadable modules, so not linked into)
29 define Package/pulseaudio/Default
30 SECTION:=sound
31 CATEGORY:=Sound
32 DEPENDS:=+libspeexdsp +libsndfile +libltdl +libpthread \
33 +librt +alsa-lib +libjson $(ICONV_DEPENDS) $(INTL_DEPENDS) \
34 @!UCLIBC_VERSION_0_9_30_1 @!UCLIBC_VERSION_0_9_30_2 \
35 @!UCLIBC_VERSION_0_9_30_3
36 TITLE:=Network sound server
37 URL:=http://www.pulseaudio.org
38 endef
39
40 define Package/pulseaudio-daemon
41 $(call Package/pulseaudio/Default)
42 VARIANT:=noavahi
43 endef
44
45 define Package/pulseaudio-daemon-avahi
46 $(call Package/pulseaudio/Default)
47 DEPENDS+=+dbus +libavahi-client +avahi-daemon-dbus
48 TITLE+= (avahi)
49 VARIANT:=avahi
50 endef
51
52 define Package/pulseaudio/Default/description
53 PulseAudio (formerly Polypaudio) is a cross-platform, networked sound server.
54 endef
55
56 define Package/pulseaudio-daemon/description
57 $(call Package/pulseaudio/Default/description)
58 endef
59
60 define Package/pulseaudio-daemon-avahi/description
61 $(call Package/pulseaudio/Default/description)
62 This package is compiled against dbus and avahi.
63 endef
64
65 define Package/pulseaudio-daemon/conffiles
66 /etc/pulse/client.conf
67 /etc/pulse/daemon.conf
68 /etc/pulse/default.pa
69 /etc/pulse/system.pa
70 endef
71
72 define Package/pulseaudio-daemon-avahi/conffiles
73 /etc/pulse/client.conf
74 /etc/pulse/daemon.conf
75 /etc/pulse/default.pa
76 /etc/pulse/system.pa
77 endef
78
79 define Package/pulseaudio-tools
80 SECTION:=sound
81 CATEGORY:=Sound
82 DEPENDS:=+libsndfile @PACKAGE_pulseaudio-daemon||PACKAGE_pulseaudio-daemon-avahi #+libpulse
83 TITLE:=Tools for Pulseaudio
84 URL:=http://www.pulseaudio.org
85 VARIANT:=noavahi
86 endef
87
88 define Package/pulseaudio-profiles
89 SECTION:=sound
90 CATEGORY:=Sound
91 DEPENDS:=@PACKAGE_pulseaudio-daemon||PACKAGE_pulseaudio-daemon-avahi
92 TITLE:=Profiles for Pulseaudio
93 URL:=http://www.pulseaudio.org
94 endef
95
96 CONFIGURE_ARGS += \
97 --with-system-user=pulse \
98 --with-system-group=pulse \
99 --with-access-group=audio \
100 --with-database=simple \
101 --enable-alsa \
102 --disable-hal \
103 --disable-gconf \
104 --disable-tcpwrap \
105 --disable-nls \
106 --disable-manpages \
107 --enable-oss-output \
108 --disable-oss-wrapper \
109 --disable-samplerate \
110 --disable-per-user-esound-socket \
111 --disable-solaris \
112 --disable-glib2 \
113 --disable-jack \
114 --disable-asyncns \
115 --disable-lirc \
116 --disable-bluez \
117 --without-caps
118
119 ifeq ($(BUILD_VARIANT),avahi)
120 CONFIGURE_ARGS += \
121 --enable-avahi \
122 --enable-dbus
123 endif
124
125 ifeq ($(BUILD_VARIANT),noavahi)
126 CONFIGURE_ARGS += \
127 --disable-avahi \
128 --disable-dbus
129 endif
130
131 CONFIGURE_VARS += \
132 PKG_CONFIG_LIBDIR="$(STAGING_DIR)/usr/lib/pkgconfig"
133
134 #SUPP_LIBS:=-L$(INTL_PREFIX)/lib -L$(ICONV_PREFIX)/lib
135 TARGET_CFLAGS += -std=gnu99
136
137 define Build/InstallDev
138 $(INSTALL_DIR) \
139 $(1)/usr/lib/pkgconfig \
140 $(1)/usr/include/pulse \
141 $(1)/usr/lib
142 $(CP) \
143 $(PKG_INSTALL_DIR)/usr/include/pulse/* \
144 $(1)/usr/include/pulse
145 $(CP) \
146 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
147 $(1)/usr/lib/pkgconfig
148 $(CP) \
149 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
150 $(1)/usr/lib/
151 endef
152
153 define Package/pulseaudio-daemon/install
154 $(INSTALL_DIR) \
155 $(1)/etc/pulse \
156 $(1)/etc/init.d \
157 $(1)/usr/bin \
158 $(1)/usr/lib \
159 $(1)/usr/lib/pulse-$(PKG_VERSION)/modules
160
161 $(INSTALL_BIN) \
162 $(PKG_INSTALL_DIR)/usr/bin/pulseaudio \
163 $(1)/usr/bin/pulseaudio
164
165 $(INSTALL_BIN) \
166 ./files/pulseaudio.init \
167 $(1)/etc/init.d/pulseaudio
168
169 $(INSTALL_CONF) \
170 $(PKG_INSTALL_DIR)/etc/pulse/* \
171 $(1)/etc/pulse
172
173 $(CP) \
174 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
175 $(1)/usr/lib/
176
177 $(CP) \
178 $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/lib*.so \
179 $(1)/usr/lib/
180
181 $(CP) \
182 $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/module*.so \
183 $(1)/usr/lib/pulse-$(PKG_VERSION)/modules/
184
185 chmod -R 0644 $(1)/etc/pulse/*
186 endef
187
188 define Package/pulseaudio-daemon-avahi/install
189 $(INSTALL_DIR) \
190 $(1)/etc/pulse \
191 $(1)/etc/init.d \
192 $(1)/usr/bin \
193 $(1)/usr/lib \
194 $(1)/usr/lib/pulse-$(PKG_VERSION)/modules \
195 $(1)/etc/dbus-1/system.d
196
197 $(INSTALL_BIN) \
198 $(PKG_INSTALL_DIR)/usr/bin/pulseaudio \
199 $(1)/usr/bin/pulseaudio
200
201 $(INSTALL_BIN) \
202 ./files/pulseaudio.init \
203 $(1)/etc/init.d/pulseaudio
204
205 $(INSTALL_CONF) \
206 $(PKG_INSTALL_DIR)/etc/pulse/* \
207 $(1)/etc/pulse
208
209 $(CP) \
210 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
211 $(1)/usr/lib/
212
213 $(CP) \
214 $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/lib*.so \
215 $(1)/usr/lib/
216
217 $(CP) \
218 $(PKG_INSTALL_DIR)/usr/lib/pulse-$(PKG_VERSION)/modules/module*.so \
219 $(1)/usr/lib/pulse-$(PKG_VERSION)/modules/
220
221 $(INSTALL_CONF) \
222 $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/pulseaudio-system.conf \
223 $(1)/etc/dbus-1/system.d/pulseaudio-system.conf
224
225 chmod -R 0644 $(1)/etc/pulse/* $(1)/etc/dbus-1/system.d/pulseaudio-system.conf
226 endef
227
228 define Package/pulseaudio-tools/install
229 $(INSTALL_DIR) \
230 $(1)/usr/bin
231
232 $(INSTALL_BIN) \
233 $(PKG_INSTALL_DIR)/usr/bin/pa* \
234 $(1)/usr/bin/
235 endef
236
237 define Package/pulseaudio-profiles/install
238 $(INSTALL_DIR) \
239 $(1)/usr/share/pulseaudio/alsa-mixer/paths \
240 $(1)/usr/share/pulseaudio/alsa-mixer/profile-sets
241
242 $(INSTALL_CONF) \
243 $(PKG_INSTALL_DIR)/usr/share/pulseaudio/alsa-mixer/paths/* \
244 $(1)/usr/share/pulseaudio/alsa-mixer/paths
245
246 $(INSTALL_CONF) \
247 $(PKG_INSTALL_DIR)/usr/share/pulseaudio/alsa-mixer/profile-sets/* \
248 $(1)/usr/share/pulseaudio/alsa-mixer/profile-sets
249 endef
250
251 $(eval $(call BuildPackage,pulseaudio-daemon))
252 $(eval $(call BuildPackage,pulseaudio-daemon-avahi))
253 $(eval $(call BuildPackage,pulseaudio-tools))
254 $(eval $(call BuildPackage,pulseaudio-profiles))