make-rules: fix Python package names normalization
| | |
| | | from pyproject_installer.build_cmd._build import parse_build_system_spec; \ |
| | | [print(x) for x in parse_build_system_spec(Path("'$(SOURCE_DIR)'"))["requires"]]' \ |
| | | | $(GSED) -e $$'s/^[ \t]*''\([a-zA-Z0-9]\([a-zA-Z0-9._-]*[a-zA-Z0-9]\)\{0,1\}\).*/\1/' \ |
| | | | tr [A-Z] [a-z] | $(GSED) -e 's/[.-_]\{1,\}/-/g' \ |
| | | | tr [A-Z] [a-z] | $(GSED) -e 's/[._-]\{1,\}/-/g' \ |
| | | | $(GSED) -e 's/.*/depend type=require fmri=pkg:\/library\/python\/&-$$(PYV)/' \ |
| | | > $@ |
| | | |
| | |
| | | COMPONENT_ARCHIVE ?= $(COMPONENT_SRC).tar.gz |
| | | # To make the package name comparable we normalize it here by following the |
| | | # PyPA Core metadata specifications and PEP 503. |
| | | COMPONENT_FMRI ?= library/python/$(shell echo $(COMPONENT_NAME) | tr [A-Z] [a-z] | $(GSED) -e 's/[.-_]\{1,\}/-/g') |
| | | COMPONENT_FMRI ?= library/python/$(shell echo $(COMPONENT_NAME) | tr [A-Z] [a-z] | $(GSED) -e 's/[._-]\{1,\}/-/g') |
| | | COMPONENT_PROJECT_URL ?= https://pypi.org/project/$(COMPONENT_NAME)/ |
| | | COMPONENT_ARCHIVE_URL ?= $(call pypi_url) |
| | | COMPONENT_PYPI ?= $(COMPONENT_NAME) |