302N/A#
302N/A# CDDL HEADER START
302N/A#
302N/A# The contents of this file are subject to the terms of the
302N/A# Common Development and Distribution License (the "License").
302N/A# You may not use this file except in compliance with the License.
302N/A#
302N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
302N/A# or http://www.opensolaris.org/os/licensing.
302N/A# See the License for the specific language governing permissions
302N/A# and limitations under the License.
302N/A#
302N/A# When distributing Covered Code, include this CDDL HEADER in each
302N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
302N/A# If applicable, add the following below this CDDL HEADER, with the
302N/A# fields enclosed by brackets "[]" replaced with your own identifying
302N/A# information: Portions Copyright [yyyy] [name of copyright owner]
302N/A#
302N/A# CDDL HEADER END
302N/A#
5680N/A
302N/A#
5680N/A# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
5680N/A#
5680N/ABUILD_BITS= NO_ARCH
302N/Ainclude ../../make-rules/shared-macros.mk
302N/A
302N/ACOMPONENT_NAME= hwdata
302N/ACOMPONENT_VERSION= 0.5.11
5680N/ACOMPONENT_SRC=
302N/A
3961N/ATPNO_PCI= 21782
3961N/ATPNO_USB= 21783
2899N/A
5680N/ABUILD_STYLE= archive
5680N/Ainclude $(WS_MAKE_RULES)/common.mk
302N/A
302N/A# Since upstream only offers the latest snapshot for download, without
302N/A# any way to retrieve a specific version, we just keep the currently
302N/A# shipped versions of these two text files directly in the gate and
302N/A# simply check in new versions to update them.
302N/A#
302N/A# When it's time to update, you can use these rules to download with
302N/A# 'gmake -B pci.ids usb.ids' After updating the data files, ensure
302N/A# that the header with version/date and license info is still being
2419N/A# correctly extracted and copied into the generated license files,
2419N/A# and run 'gmake test' to verify there are no invalid or control chars
2419N/A# in the files.
302N/A
304N/Adownload::
304N/A @echo 'No downloads for this component'
304N/A
302N/AID_FILES = pci.ids usb.ids
302N/A
302N/ACOMPONENT_ARCHIVE_URL_pci.ids = http://pciids.sourceforge.net/v2.2/pci.ids
302N/ACOMPONENT_ARCHIVE_URL_usb.ids = http://www.linux-usb.org/usb.ids
302N/ACOMPONENT_ARCHIVE_URLS = $(foreach i,$(ID_FILES),$(COMPONENT_ARCHIVE_URL_$(i)))
302N/A
1498N/A# Retrieve version from ids file
1498N/AID_VERSION_EXTRACT_COMMAND=$(GSED) -n -e '/Version:/ { s/^.*: //p' -e ' q }'
1498N/A
302N/APKG_OPTIONS += -D COMPONENT_ARCHIVE_URLS='$(COMPONENT_ARCHIVE_URLS:%=value="%")'
1498N/APKG_MACROS += $(foreach i,$(ID_FILES),\
1498N/A COMPONENT_VERSION_$(i)='$(shell $(ID_VERSION_EXTRACT_COMMAND) $(i))')
1498N/A
1498N/A# Since we have two separately licensed components we don't use the default
1498N/A# license transform rules, but handle the license info metadata directly
1498N/ALICENSE_TRANSFORMS =
302N/A
302N/A$(ID_FILES):
302N/A curl -s -o $@ $(COMPONENT_ARCHIVE_URL_$(@F))
302N/A
302N/A# License files for packaging are generated during the build
302N/ALICENSES = $(ID_FILES:%=%.license)
302N/ABUILT_LICENSES = $(LICENSES:%=$(BUILD_DIR)/%)
302N/A
302N/A# Extract the header up to the first blank line
984N/A$(BUILD_DIR)/%.header: %
984N/A $(MKDIR) $(@D)
302N/A $(GSED) -e '/^$$/ q' $< > $@
302N/A
302N/A# Generate license files for each document by substituting in templates:
302N/A# __HEADER__ - read in contents of generated header file, then delete the
302N/A# __HEADER__ line
302N/A$(BUILD_DIR)/%.license: $(BUILD_DIR)/%.header
1498N/A $(GSED) -e '/__HEADER__/ r $<' -e '/__HEADER__/ d' ids.license.tmpl > $@
302N/A
984N/Ainstall build: $(BUILT_LICENSES)
302N/A
2419N/A# Ensure there are no control characters/escape sequences or invalid UTF-8
2419N/A# characters in the *.ids text files.
2419N/Atest: $(BUILD_DIR)
2419N/A @ export LC_ALL='en_US.UTF-8' ; \
2419N/A for f in $(ID_FILES) ; do \
2419N/A tr -cd '[:print:][:space:]' < $$f > $(BUILD_DIR)/$$f.clean \
2419N/A && diff -u $$f $(BUILD_DIR)/$$f.clean ; \
2419N/A if (( $$? == 0 )) ; then \
2419N/A print $$f PASSED ; \
2419N/A else \
2419N/A print $$f FAILED ; \
2419N/A fi \
2419N/A done
302N/A
4337N/Asystem-test: $(SYSTEM_TESTS_NOT_IMPLEMENTED)
4337N/A