Marcel Telka
2024-04-03 72d66ff28ec33bc2c05b355c6218d98d13b79450
commit | author | age
1d5ab0 1 #
MT 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
5 # 1.0 of the CDDL.
6 #
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.
10 #
11
12 #
13 # Copyright 2023 Marcel Telka
14 #
15
16 %include-3%
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 ; \
23         done ; \
24         $(MV) $$f $${f%%.1}-$(PYTHON_VERSION).1 ; \
25     done ;
26
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
30 %hook-manifest%
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"