pwrtray: Split package into frontend and backend. This allows the backend to be used...
[openwrt/svn-archive/archive.git] / Xorg / app / pwrtray / Makefile
1 #
2 # Copyright (C) 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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=pwrtray
11 PKG_REV:=3994c1c31958a53be7f838f86d62629b1349b2bd
12 PKG_VERSION:=$(PKG_REV)
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=git://git.bu3sch.de/pwrtray.git
17 PKG_SOURCE_PROTO:=git
18 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
19 PKG_SOURCE_VERSION:=$(PKG_REV)
20 PKG_INSTALL:=1
21 PKG_BUILD_PARALLEL:=1
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/pwrtray-common
26 MAINTAINER:=Michael Buesch <mb@bu3sch.de>
27 URL:=http://bu3sch.de/gitweb?p=pwrtray.git;a=summary
28 endef
29
30 define Package/pwrtray-backend
31 $(call Package/pwrtray-common)
32 SECTION:=utils
33 CATEGORY:=Utilities
34 TITLE:=System power control daemon
35 DEPENDS:=+FEATURE_drawing-backend_libX11:libX11
36 endef
37
38 define Package/pwrtray-backend/description
39 Tiny system power control daemon.
40 endef
41
42 define Package/pwrtray
43 $(call Package/pwrtray-common)
44 SECTION:=xorg-app
45 CATEGORY:=Xorg
46 SUBMENU:=app
47 TITLE:=Frontend to pwrtray-backend daemon
48 DEPENDS:=+pwrtray-backend +qt4 +qt4-gui
49 endef
50
51 define Package/pwrtray/description
52 Small system-tray frontend to the power control daemon.
53 endef
54
55 EXTRA_CFLAGS:= \
56 -I$(PKG_BUILD_DIR)/tray/moc \
57 -I$(STAGING_DIR)/usr/include/QtCore \
58 -I$(STAGING_DIR)/usr/include/QtGui
59
60 EXTRA_LDFLAGS:= \
61 -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
62 -Wl,-rpath=/usr/lib/
63
64 MAKE_VARS+= \
65 MOC="$(STAGING_DIR_HOST)/bin/moc" \
66 STRIP="$(STRIP)" \
67 $(if $(CONFIG_PACKAGE_libX11),FEATURE_XLOCK=y,FEATURE_XLOCK=n) \
68 $(if $(CONFIG_PACKAGE_pwrtray),FEATURE_TRAY=y,FEATURE_TRAY=n)
69
70 #MAKE_FLAGS+= \
71 # V=1
72
73 define Package/pwrtray-backend/install
74 $(INSTALL_DIR) $(1)/etc/init.d $(1)/usr/bin $(1)/usr/share
75 $(INSTALL_BIN) ./files/etc/init.d/* $(1)/etc/init.d/
76 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pwrtray-backend $(1)/usr/bin/
77 $(if $(CONFIG_PACKAGE_libX11),$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pwrtray-xlock $(1)/usr/bin/)
78 $(if $(CONFIG_PACKAGE_pwrtray),$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pwrtray $(1)/usr/bin/)
79 $(CP) $(PKG_INSTALL_DIR)/usr/share/pwrtray $(1)/usr/share/
80 [ -e $(1)/etc/pwrtray-backendrc ] || \
81 $(INSTALL_DATA) ./files/etc/pwrtray-backendrc $(1)/etc/
82 endef
83
84 $(eval $(call BuildPackage,pwrtray-backend))
85 $(eval $(call BuildPackage,pwrtray))