packages/foxboard-utils: fix whitespaces
[packages.git] / utils / pciutils / Makefile
1 #
2 # Copyright (C) 2007-2013 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.2.0
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=@KERNEL/software/utils/pciutils
16 PKG_MD5SUM:=d73a1b35e5d5efa70e8476d5917de11f
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  contains collection of programs for inspecting and manipulating configuration
32  of PCI devices
33 endef
34
35 define Package/pciutils/postinst
36 #!/bin/sh
37 [ -z "$${IPKG_INSTROOT}" ] || \
38 (cd $${PKG_ROOT}/usr/share; $${PKG_ROOT}/usr/sbin/update-pciids; rm pci.ids.gz.old)
39 exit 0
40 endef
41
42 MAKE_FLAGS += \
43         CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
44         PREFIX="/usr" \
45         HOST="$(GNU_TARGET_NAME)" \
46         ZLIB="yes" \
47
48 ifneq ($(CONFIG_USE_EGLIBC),)
49 TARGET_LDFLAGS += -lresolv
50 endif
51
52 define Build/InstallDev
53         $(INSTALL_DIR) $(1)/usr/lib
54         $(CP) $(PKG_BUILD_DIR)/lib/libpci.a $(1)/usr/lib
55         $(INSTALL_DIR) $(1)/usr/include/pci
56         $(CP) $(foreach i,pci.h config.h header.h types.h, \
57                 $(PKG_BUILD_DIR)/lib/$(i)) $(1)/usr/include/pci
58 endef
59
60 define Package/pciutils/install
61         $(INSTALL_DIR) $(1)/usr/sbin
62         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{lspci,setpci,update-pciids} $(1)/usr/sbin/
63         $(INSTALL_DIR) $(1)/usr/share
64         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/pci.ids.gz $(1)/usr/share/
65 endef
66
67 $(eval $(call BuildPackage,pciutils))