summaryrefslogtreecommitdiff
path: root/openwrt/dolmetsch-ctl/Makefile
blob: 6ba0a517ff0217f6d5d5fac272b0c623bbe47097 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#
# Copyright (C) 2006-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=dolmetschctl
PKG_VERSION:=2015-10-14
PKG_RELEASE:=3
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=git://git.spreadspace.org/dolmetschctl.git
PKG_SOURCE:=$(PKG_NAME).tar.gz
PKG_SOURCE_VERSION:=a84e372d3f977f657378bb489f9ed5d88ea70334
PKG_SOURCE_SUBDIR:=$(PKG_NAME)

PKG_MAINTAINER:=Christian Pointner <equinox@spreadspace.org>

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk

define Package/dolmetschctl
  SECTION:=utils
  CATEGORY:=Utilities
  DEPENDS:=+alsa-lib +liblo
  TITLE:=Dolmetsch Control (server)
  URL:=http://www.spreadspace.org/
endef

define Package/dolmetschctl-client
  SECTION:=utils
  CATEGORY:=Utilities
  DEPENDS:=+alsa-lib +liblo
  TITLE:=Dolmetsch Control (client)
  URL:=http://www.spreadspace.org/
endef

define Build/Configure
	(cd $(PKG_BUILD_DIR)/app; \
    touch include.mk; \
    echo '#ifndef DOLMETSCHCTL_config_h_INCLUDED' > config.h; \
    echo '#define DOLMETSCHCTL_config_h_INCLUDED' >> config.h; \
    echo '' >> config.h; \
    echo '#define VERSION_STRING_0 "dolmetschctl trunk (git '$(PKG_SOURCE_VERSION)')"' >> config.h; \
    echo '#define VERSION_STRING_1 "built on '`hostname`', '`date +"%d.%m.%Y %H:%M:%S %Z"`'"' >> config.h; \
    echo '' >> config.h; \
    echo '#define TARGET "linux"' >> config.h; \
    echo '#define PREFIX "/usr"' >> config.h; \
    echo '#define BINDIR "/usr/bin"' >> config.h; \
    echo '#define ETCDIR "/etc"' >> config.h; \
    echo '' >> config.h; \
    echo '#endif' >> config.h \
  )
endef

define Build/Compile
	$(MAKE) -C $(PKG_BUILD_DIR)/app \
    $(TARGET_CONFIGURE_OPTS) \
    TARGET=Linux \
    CFLAGS="$(TARGET_CFLAGS)" \
    LDFLAGS="$(TARGET_LDFLAGS) -llo -lasound"
	$(STRIP) $(PKG_BUILD_DIR)/app/dolmetschctl
	$(STRIP) $(PKG_BUILD_DIR)/app/dolmetschctl-client
endef


define Package/dolmetschctl/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/app/dolmetschctl $(1)/usr/bin/
	$(INSTALL_DIR) $(1)/etc/init.d
	$(INSTALL_BIN) ./files/dolmetschctl.init $(1)/etc/init.d/dolmetschctl
endef

define Package/dolmetschctl-client/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/app/dolmetschctl-client $(1)/usr/bin/
	$(INSTALL_DIR) $(1)/etc/init.d
	$(INSTALL_BIN) ./files/dolmetschctl-client.init $(1)/etc/init.d/dolmetschctl-client
endef

$(eval $(call BuildPackage,dolmetschctl))
$(eval $(call BuildPackage,dolmetschctl-client))