cac5fb6d524f3228b3c218e1c5b65a61a7256722
[packages.git] / utils / pciutils / Makefile
1 #
2 # Copyright (C) 2007-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:=pciutils
11 PKG_VERSION:=3.1.7
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=@KERNEL/software/utils/pciutils
16 PKG_MD5SUM:=35222edb86b50a6641352c66fe829b2e
17
18 PKG_INSTALL:=1
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/pciutils
23   SECTION:=utils
24   CATEGORY:=Utilities
25   TITLE:=Linux PCI Utilities
26   URL:=http://mj.ucw.cz/pciutils.shtml
27   DEPENDS:=+zlib
28 endef
29
30 define Package/pciutils/description
31         This package contains various utilities for inspecting and setting of
32         devices connected to the PCI bus.
33 endef
34
35 define Package/pciutils/postinst
36 #!/bin/sh
37 (cd $${PKG_ROOT}/usr/share; $${PKG_ROOT}/usr/sbin/update-pciids)
38 exit 0
39 endef
40
41 MAKE_FLAGS += \
42         CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
43         PREFIX="/usr" \
44         HOST="$(GNU_TARGET_NAME)" \
45         ZLIB="yes" \
46
47 define Build/InstallDev
48         $(INSTALL_DIR) $(1)/usr/lib
49         $(CP) $(PKG_BUILD_DIR)/lib/libpci.a $(1)/usr/lib
50         $(INSTALL_DIR) $(1)/usr/include/pci
51         $(CP) $(foreach i,pci.h config.h header.h types.h, \
52                 $(PKG_BUILD_DIR)/lib/$(i)) $(1)/usr/include/pci
53 endef
54
55 define Package/pciutils/install
56         $(INSTALL_DIR) $(1)/usr/sbin
57         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{lspci,setpci,update-pciids} $(1)/usr/sbin/
58         $(INSTALL_DIR) $(1)/usr/share
59         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/pci.ids.gz $(1)/usr/share/
60 endef
61
62 $(eval $(call BuildPackage,pciutils))