pwrtray: Fixes for latest kernel changes
[openwrt/svn-archive/archive.git] / Xorg / app / pwrtray / Makefile
1 #
2 # Copyright (C) 2010-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 #LOCAL_SRC:=1
11
12 PKG_NAME:=pwrtray
13 PKG_REV:=7581cda95d1cbe10ef0665840801a3120004db79
14 PKG_VERSION:=1
15 PKG_RELEASE:=1
16
17 ifeq ($(LOCAL_SRC),)
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
19 PKG_SOURCE_URL:=git://git.bu3sch.de/pwrtray.git
20 PKG_SOURCE_PROTO:=git
21 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
22 PKG_SOURCE_VERSION:=$(PKG_REV)
23 endif
24
25 PKG_INSTALL:=1
26 PKG_BUILD_PARALLEL:=1
27
28 PKG_CONFIG_DEPENDS:= \
29 CONFIG_PACKAGE_pwrtray-backend \
30 CONFIG_PACKAGE_pwrtray
31
32 include $(INCLUDE_DIR)/package.mk
33
34 define Package/pwrtray-common
35 MAINTAINER:=Michael Buesch <mb@bu3sch.de>
36 URL:=http://bu3sch.de/gitweb?p=pwrtray.git;a=summary
37 endef
38
39 define Package/pwrtray-backend
40 $(call Package/pwrtray-common)
41 SECTION:=utils
42 CATEGORY:=Utilities
43 TITLE:=System power control daemon
44 DEPENDS:=+FEATURE_drawing-backend_libX11:libX11
45 endef
46
47 define Package/pwrtray-backend/description
48 Tiny system power control daemon.
49 endef
50
51 define Package/pwrtray
52 $(call Package/pwrtray-common)
53 SECTION:=xorg-app
54 CATEGORY:=Xorg
55 SUBMENU:=app
56 TITLE:=Frontend to pwrtray-backend daemon
57 DEPENDS:=+pwrtray-backend +qt4 +qt4-gui
58 endef
59
60 define Package/pwrtray/description
61 Small system-tray frontend to the power control daemon.
62 endef
63
64 EXTRA_CFLAGS:= \
65 -I$(PKG_BUILD_DIR)/tray/moc \
66 -I$(STAGING_DIR)/usr/include/QtCore \
67 -I$(STAGING_DIR)/usr/include/QtGui
68
69 EXTRA_LDFLAGS:= \
70 -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
71 -Wl,-rpath=/usr/lib/
72
73 MAKE_VARS+= \
74 MOC="$(STAGING_DIR_HOST)/bin/moc" \
75 STRIP="$(STRIP)" \
76 $(if $(CONFIG_PACKAGE_libX11),FEATURE_XLOCK=y,FEATURE_XLOCK=n) \
77 $(if $(CONFIG_PACKAGE_pwrtray),FEATURE_TRAY=y,FEATURE_TRAY=n)
78
79 #MAKE_FLAGS+= \
80 # V=1
81
82 define Build/Prepare
83 $(if $(LOCAL_SRC), \
84 $(CP) ./files/src/* $(PKG_BUILD_DIR)/ \
85 , \
86 $(call Build/Prepare/Default) \
87 )
88 endef
89
90 define Build/Compile
91 $(MAKE) -C $(PKG_BUILD_DIR) clean
92 $(call Build/Compile/Default)
93 endef
94
95 define Package/pwrtray-backend/install
96 $(INSTALL_DIR) $(1)/etc/init.d $(1)/usr/bin $(1)/usr/share
97 $(INSTALL_BIN) ./files/etc/init.d/* $(1)/etc/init.d/
98 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pwrtray-backend $(1)/usr/bin/
99 $(if $(CONFIG_PACKAGE_libX11),$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pwrtray-xlock $(1)/usr/bin/)
100 $(if $(CONFIG_PACKAGE_pwrtray),$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pwrtray $(1)/usr/bin/)
101 $(if $(CONFIG_PACKAGE_pwrtray),$(CP) $(PKG_INSTALL_DIR)/usr/share/pwrtray $(1)/usr/share/)
102 [ -e $(1)/etc/pwrtray-backendrc ] || \
103 $(INSTALL_DATA) ./files/etc/pwrtray-backendrc $(1)/etc/
104 endef
105
106 $(eval $(call BuildPackage,pwrtray-backend))
107 $(eval $(call BuildPackage,pwrtray))