packages: move Xorg category to its own feed, move X-related packages as well
[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:=f9b63119a568803fad582dc0796af91bb087919c
14 PKG_VERSION:=2
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
67 EXTRA_LDFLAGS:= \
68 -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
69 -Wl,-rpath=/usr/lib/
70
71 MAKE_VARS+= \
72 MOC="$(STAGING_DIR_HOST)/bin/moc" \
73 STRIP="$(STRIP)" \
74 QT_INCDIR="$(STAGING_DIR)/usr/include" \
75 QT_LIBDIR="$(STAGING_DIR)/usr/lib" \
76 PREFIX=/usr \
77 $(if $(CONFIG_PACKAGE_libX11),FEATURE_XLOCK=y,FEATURE_XLOCK=n) \
78 FEATURE_XEVREP=n \
79 $(if $(CONFIG_PACKAGE_pwrtray),FEATURE_TRAY=y,FEATURE_TRAY=n)
80
81 MAKE_FLAGS+= \
82 V=1
83
84 define Build/Prepare
85 $(if $(LOCAL_SRC), \
86 $(CP) ./files/src/* $(PKG_BUILD_DIR)/ \
87 , \
88 $(call Build/Prepare/Default) \
89 )
90 endef
91
92 define Build/Compile
93 $(MAKE) -C $(PKG_BUILD_DIR) clean
94 $(call Build/Compile/Default)
95 endef
96
97 define Package/pwrtray-backend/install
98 $(INSTALL_DIR) $(1)/etc/init.d $(1)/usr/bin $(1)/usr/share
99 $(INSTALL_BIN) ./files/etc/init.d/* $(1)/etc/init.d/
100 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pwrtray-backend $(1)/usr/bin/
101 $(if $(CONFIG_PACKAGE_libX11),$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pwrtray-xlock $(1)/usr/bin/)
102 $(if $(CONFIG_PACKAGE_pwrtray),$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pwrtray $(1)/usr/bin/)
103 $(if $(CONFIG_PACKAGE_pwrtray),$(CP) $(PKG_INSTALL_DIR)/usr/share/pwrtray $(1)/usr/share/)
104 [ -e $(1)/etc/pwrtray-backendrc ] || \
105 $(INSTALL_DATA) ./files/etc/pwrtray-backendrc $(1)/etc/
106 endef
107
108 $(eval $(call BuildPackage,pwrtray-backend))
109 $(eval $(call BuildPackage,pwrtray))