Merge pull request #840 from cjkoenig/update_liburcu
[feed/packages.git] / utils / pciutils / Makefile
1 #
2 # Copyright (C) 2007-2014 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.3.0
12 PKG_RELEASE:=1
13 PKG_USE_MIPS16:=0
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@KERNEL/software/utils/pciutils
17 PKG_MD5SUM:=bf6ce5c50b273ffc2d27f659e929a37e
18 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
19
20 PKG_LICENSE:=GPL-2.0
21 PKG_LICENSE_FILES:=COPYING
22
23 PKG_INSTALL:=1
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/pciutils
28 SECTION:=utils
29 CATEGORY:=Utilities
30 TITLE:=Linux PCI Utilities
31 URL:=http://mj.ucw.cz/pciutils.shtml
32 DEPENDS:=+zlib
33 endef
34
35 define Package/pciutils/description
36 contains collection of programs for inspecting and manipulating configuration
37 of PCI devices
38 endef
39
40 define Package/pciutils/postinst
41 #!/bin/sh
42 [ -z "$${IPKG_INSTROOT}" ] || \
43 (cd $${PKG_ROOT}/usr/share; $${PKG_ROOT}/usr/sbin/update-pciids; rm pci.ids.gz.old)
44 exit 0
45 endef
46
47 MAKE_FLAGS += \
48 CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
49 PREFIX="/usr" \
50 HOST="$(GNU_TARGET_NAME)" \
51 ZLIB="yes" \
52
53 ifneq ($(CONFIG_USE_EGLIBC),)
54 TARGET_LDFLAGS += -lresolv
55 endif
56
57 define Build/InstallDev
58 $(INSTALL_DIR) $(1)/usr/lib
59 $(CP) $(PKG_BUILD_DIR)/lib/libpci.a $(1)/usr/lib
60 $(INSTALL_DIR) $(1)/usr/include/pci
61 $(CP) $(foreach i,pci.h config.h header.h types.h, \
62 $(PKG_BUILD_DIR)/lib/$(i)) $(1)/usr/include/pci
63 endef
64
65 define Package/pciutils/install
66 $(INSTALL_DIR) $(1)/usr/sbin
67 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{lspci,setpci,update-pciids} $(1)/usr/sbin/
68 $(INSTALL_DIR) $(1)/usr/share
69 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/pci.ids.gz $(1)/usr/share/
70 endef
71
72 $(eval $(call BuildPackage,pciutils))