package sysfsutils: add support for sysfs settings at boot
[openwrt/openwrt.git] / package / libs / sysfsutils / Makefile
1 #
2 # Copyright (C) 2006-2012 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:=sysfsutils
11 PKG_VERSION:=2.1.0
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@SF/linux-diag
16 PKG_HASH:=e865de2c1f559fff0d3fc936e660c0efaf7afe662064f2fb97ccad1ec28d208a
17 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
18
19 PKG_LICENSE:=LGPL-2.1
20 PKG_LICENSE_FILES:=COPYING cmd/GPL lib/LGPL
21
22 PKG_FIXUP:=autoreconf
23
24 PKG_INSTALL:=1
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/libsysfs
29 SECTION:=libs
30 CATEGORY:=Libraries
31 SUBMENU:=Filesystem
32 TITLE:=Sysfs library
33 URL:=http://linux-diag.sourceforge.net/Sysfsutils.html
34 endef
35
36 define Package/sysfsutils
37 SECTION:=utils
38 CATEGORY:=Utilities
39 SUBMENU:=Filesystem
40 DEPENDS:=+libsysfs
41 TITLE:=System Utilities Based on Sysfs
42 URL:=http://linux-diag.sourceforge.net/Sysfsutils.html
43 endef
44
45 define Package/libsysfs/description
46 The library's purpose is to provide a consistant and stable interface for
47 querying system device information exposed through sysfs.
48 endef
49
50 define Package/sysfsutils/description
51 A utility built upon libsysfs that lists devices by bus, class, and topology.
52 endef
53
54 define Build/InstallDev
55 $(INSTALL_DIR) $(1)/usr/include
56 $(CP) $(PKG_INSTALL_DIR)/usr/include/sysfs $(1)/usr/include/
57
58 $(INSTALL_DIR) $(1)/usr/lib
59 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsysfs.{a,so*,la} $(1)/usr/lib/
60 endef
61
62 define Package/libsysfs/install
63 $(INSTALL_DIR) $(1)/usr/lib
64 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsysfs.so* $(1)/usr/lib/
65 endef
66
67 define Package/sysfsutils/install
68 $(INSTALL_DIR) $(1)/etc/init.d
69 $(INSTALL_BIN) ./files/sysfsutils $(1)/etc/init.d/
70
71 $(INSTALL_DATA) ./files/sysfs.conf $(1)/etc/
72 $(INSTALL_DIR) $(1)/etc/sysfs.d
73 $(INSTALL_DATA) ./files/local.conf $(1)/etc/sysfs.d/
74
75 $(INSTALL_DIR) $(1)/usr/bin
76 $(CP) $(PKG_INSTALL_DIR)/usr/bin/systool $(1)/usr/bin/
77 endef
78
79 define Package/sysfsutils/conffiles
80 /etc/sysfs.conf
81 /etc/sysfs.d/local.conf
82 endef
83
84 $(eval $(call BuildPackage,libsysfs))
85 $(eval $(call BuildPackage,sysfsutils))