Merge pull request #2701 from cshore/pull-request-rp-pppoe
[feed/packages.git] / utils / pciutils / Makefile
1 #
2 # Copyright (C) 2007-2016 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.5.2
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@KERNEL/software/utils/pciutils
16 PKG_MD5SUM:=3a99141a9f40528d0a0035665a06dc37ddb1ae341658e51b50a76ecf86235efc
17 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
18
19 PKG_LICENSE:=GPL-2.0
20 PKG_LICENSE_FILES:=COPYING
21
22 PKG_USE_MIPS16:=0
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:=+libkmod +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 HWDB="no" \
52 ZLIB="yes"
53
54 ifneq ($(CONFIG_USE_GLIBC),)
55 TARGET_LDFLAGS += -lresolv
56 endif
57
58 define Build/InstallDev
59 $(INSTALL_DIR) $(1)/usr/lib
60 $(CP) $(PKG_BUILD_DIR)/lib/libpci.a $(1)/usr/lib
61 $(INSTALL_DIR) $(1)/usr/include/pci
62 $(CP) $(foreach i,pci.h config.h header.h types.h, \
63 $(PKG_BUILD_DIR)/lib/$(i)) $(1)/usr/include/pci
64 endef
65
66 define Package/pciutils/install
67 $(INSTALL_DIR) $(1)/usr/sbin
68 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{lspci,setpci,update-pciids} $(1)/usr/sbin/
69 $(INSTALL_DIR) $(1)/usr/share
70 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/pci.ids.gz $(1)/usr/share/
71 endef
72
73 $(eval $(call BuildPackage,pciutils))