4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
21 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
25 # This set of transforms is intended to be used to convert a set of actions
26 # generated by "pkgsend generate ..." into a more generic set of actions with
27 # most attributes removed and paths converted to use strategically placed
28 # macros to remove plartform or version specifics.
31 # convert the "pkgsend generate" file "hash" to a common value
32 <transform file -> set action.hash 'NOHASH'>
34 # drop extra attribute data that "pkgsend generate" might have added
35 <transform dir file link hardlink license -> delete timestamp .*>
36 <transform dir file link hardlink license -> delete pkg.size .*>
37 <transform dir file link hardlink license -> delete owner .*>
38 <transform dir file link hardlink license -> delete group .*>
39 <transform dir link hardlink license -> delete mode .*>
40 # preserve mode for illumos-closed files
41 <transform file path=(?!opt/onbld/closed/root_i386) -> delete mode .*>
43 #<transform set name=pkg.fmri -> edit value "@[^ \t\n\r\f\v]*" "@$!(IPS_COMPONENT_VERSION),$!(BUILD_VERSION)">
45 <transform dir file link hardlink -> \
46 edit path "/(sparcv9|amd64)$" "/$!(MACH64)">
47 <transform dir file link hardlink -> \
48 edit path "/(sparcv9|amd64)/" "/$!(MACH64)/">
49 <transform dir file link hardlink -> \
50 edit path "/(sparcv7|i86)$" "/$!(MACH32)">
51 <transform dir file link hardlink -> \
52 edit path "/(sparcv7|i86)/" "/$!(MACH32)/">
53 <transform dir file link hardlink -> \
54 edit path "/(sparc|i386)$" "/$!(MACH)">
55 <transform dir file link hardlink -> \
56 edit path "/(sparc|i386)/" "/$!(MACH)/">
57 <transform dir file link hardlink -> \
58 edit path "/(sparc|i386)-(sun|pc)-solaris\d\.\d+" "/$!(GNU_TRIPLET)">
61 <transform dir file link hardlink -> \
62 edit path "^(usr/perl5/.*/)i86pc-solaris-(64int|thread-multi-64)/" "\1$!(PERL_ARCH)/">
63 <transform dir file link hardlink -> \
64 edit path "^(usr/perl5/(vendor_perl/)?)5\.[^/]*" "\1$!(PERLVER)">
65 <transform dir file link hardlink \
66 path=usr/perl5/.*/perllocal\.pod$ -> drop>
67 <transform dir file link hardlink \
68 path=usr/perl5/.*/\.packlist$ -> drop>
71 <transform dir file link hardlink path=usr\/lib\/python2\.7\/.*\.pyc$ -> drop>
72 <transform dir file link hardlink path=usr\/lib\/python2\.7\/.*\.pyo$ -> drop>
73 <transform dir file link hardlink path=usr\/lib\/python3\.\d+\/(.*\/)?__pycache__\/ -> drop>
74 # Drop backports/__init__.py because all supported Python versions are PEP 420
75 # compliant so this file is no longer needed.
76 # See https://github.com/jaraco/backports.entry_points_selectable/issues/5
77 <transform dir file link hardlink path=usr\/lib\/python3\.\d+\/vendor-packages\/backports\/__init__\.py$ -> drop>
78 # PEP 627 made the RECORD file optional. Since we do not need the file and it
79 # could contain inaccurate info we simply drop it.
80 <transform dir file link hardlink path=usr\/lib\/python3\.\d+\/vendor-packages\/[^/]+\.dist-info/RECORD$ -> drop>
81 # Strip Python 3 cpython ABI extension
83 edit path "^(usr/lib/python3\.\d+/vendor-packages/(.*/)?[^/]+)\.cpython-3\d+\.so$" "\1.so">
84 # Strip Python 3 abi3 ABI extension
86 edit path "^(usr/lib/python3\.\d+/vendor-packages/(.*/)?[^/]+)\.abi3\.so$" "\1.so">
87 # Replace Python version by $(PYVER)
88 <transform file path=usr/bin/[^/]+-3\.\d+$ -> default tmp.fmri "$(COMPONENT_FMRI)">
89 <transform file tmp.fmri=.*runtime/python -> edit path "^(usr/bin/[^/]+-)3\.\d+$" "\1$!(PYVER)">
90 <transform file tmp.fmri=.*library/python/ -> edit path "^(usr/bin/[^/]+-)3\.\d+$" "\1$!(PYVER)">
91 <transform file tmp.fmri=.* -> delete tmp.fmri .*>
92 <transform dir file link hardlink -> \
93 edit path "^(usr/lib/python3\.\d+/vendor-packages/[^/]+-py)3\.\d+(\.egg-info(/.*)?)$" "\1$!(PYVER)\2">
94 <transform dir file link hardlink -> \
95 edit path "^(usr/lib/python3\.\d+/vendor-packages/[^/]+-py)3\.\d+(-nspkg\.pth)$" "\1$!(PYVER)\2">
96 <transform dir file link hardlink -> \
97 edit path "^(usr/lib/python)3\.\d+(/vendor-packages/)" "\1$!(PYVER)\2">
99 <transform dir file link hardlink -> \
100 edit target "/(sparcv9|amd64)$" "/$!(MACH64)">
101 <transform dir file link hardlink -> \
102 edit target "/(sparcv9|amd64)/" "/$!(MACH64)/">
103 <transform dir file link hardlink -> \
104 edit target "/(sparcv7|i86)$" "/$!(MACH32)">
105 <transform dir file link hardlink -> \
106 edit target "/(sparcv7|i86)/" "/$!(MACH32)/">
107 <transform dir file link hardlink -> \
108 edit target "/(sparc|i386)$" "/$!(MACH)">
109 <transform dir file link hardlink -> \
110 edit target "/(sparc|i386)/" "/$!(MACH)/">
111 <transform dir file link hardlink -> \
112 edit target "/(sparc|i386)-(sun|pc)-solaris\d\.\d+" "/$!(GNU_TRIPLET)/">
114 # <transform dir file link hardlink -> \
115 # edit path "$(COMPONENT_NAME)" "$!(COMPONENT_NAME)">
116 # <transform dir file link hardlink -> \
117 # edit target "$(COMPONENT_NAME)" "$!(COMPONENT_NAME)">
119 <transform dir file link hardlink -> \
120 edit path "$(HUMAN_VERSION_RE)" "$!(HUMAN_VERSION)">
121 <transform dir file link hardlink -> \
122 edit target "$(HUMAN_VERSION_RE)" "$!(HUMAN_VERSION)">
124 <transform dir file link hardlink -> \
125 edit path "$(COMPONENT_RE_VERSION)" "$!(COMPONENT_VERSION)">
126 <transform dir file link hardlink -> \
127 edit target "$(COMPONENT_RE_VERSION)" "$!(COMPONENT_VERSION)">
129 <transform dir file link hardlink -> \
130 edit path "$(IPS_COMPONENT_RE_VERSION)" "$!(IPS_COMPONENT_VERSION)">
131 <transform dir file link hardlink -> \
132 edit target "$(IPS_COMPONENT_RE_VERSION)" "$!(IPS_COMPONENT_VERSION)">
134 # convert temporary macro names to their real name
136 edit value "\$!\((.*)\)" "$(\1)">
137 <transform dir file link hardlink -> \
138 edit path "\$!\((.*)\)" "$(\1)">
139 <transform dir file link hardlink -> \
140 edit target "\$!\((.*)\)" "$(\1)">
141 <transform dir file link hardlink -> \
142 edit path "\$!\((.*)\)" "$(\1)">
143 <transform dir file link hardlink -> \
144 edit target "\$!\((.*)\)" "$(\1)">
145 <transform dir file link hardlink -> \
146 edit path "\$!\((.*)\)" "$(\1)">
147 <transform dir file link hardlink -> \
148 edit target "\$!\((.*)\)" "$(\1)">
149 <transform dir file link hardlink -> \
150 edit path "\$!\((.*)\)" "$(\1)">
151 <transform dir file link hardlink -> \
152 edit target "\$!\((.*)\)" "$(\1)">
153 <transform dir file link hardlink -> \
154 edit path "\$!\((.*)\)" "$(\1)">
155 <transform dir file link hardlink -> \
156 edit target "\$!\((.*)\)" "$(\1)">
158 <transform file link hardlink path=mangled/(.*) -> drop>
159 # drop all dirs except for illumos-closed
160 <transform dir path=(?!(opt/onbld/closed/root_i386(-nd)?/)) -> drop>