2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
7 # A full copy of the text of the CDDL should have accompanied this
8 # source. A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
13 # Copyright 2023 Marcel Telka
17 # Rename section 1 man page(s) to contain version number
18 COMPONENT_POST_INSTALL_ACTION += \
19 for f in $(PROTOUSRSHAREMAN1DIR)/*.1 ; do \
20 [[ -f $$f ]] || continue ; \
21 for v in $(PYTHON_VERSIONS) ; do \
22 [[ "$$f" == "$${f%%$$v.1}" ]] || continue 2 ; \
24 $(MV) $$f $${f%%.1}-$(PYTHON_VERSION).1 ; \
27 # Replace Python version in man page file paths
28 GENERATE_EXTRA_CMD += | \
29 $(GSED) -e 's|\(usr/share/man/man.*-\)3\.[0-9]\{1,\}\(\.[0-9]\)|\1$$(PYVER)\2|' | uniq
31 # Create mediated symlinks
32 printf '<transform file path=(usr/share/man/man1/)([^/]+)-(3\\.\\d+)\\.1$ -> emit link path=%%<1>%%<2>.1 target=%%<2>-%%<3>.1 mediator=python mediator-version=%%<3> >\n' >> "$DISTRIBUTION-PYVER.p5m"