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)/">
59 <transform dir file link hardlink -> \
60 edit path "^(usr/perl5/.*/)i86pc-solaris-(64int|thread-multi-64)/" "\1$!(PERL_ARCH)/">
61 <transform dir file link hardlink -> \
62 edit path "^(usr/perl5/(vendor_perl/)?)5\.[^/]*" "\1$!(PERLVER)">
63 <transform dir file link hardlink \
64 path=usr/perl5/.*/perllocal\.pod$ -> drop>
65 <transform dir file link hardlink \
66 path=usr/perl5/.*/\.packlist$ -> drop>
69 <transform dir file link hardlink path=usr\/lib\/python2\.7\/.*\.pyc$ -> drop>
70 <transform dir file link hardlink path=usr\/lib\/python2\.7\/.*\.pyo$ -> drop>
71 <transform dir file link hardlink path=usr\/lib\/python3\.\d+\/(.*\/)?__pycache__\/ -> drop>
72 # Drop backports/__init__.py because all supported Python versions are PEP 420
73 # compliant so this file is no longer needed.
74 # See https://github.com/jaraco/backports.entry_points_selectable/issues/5
75 <transform dir file link hardlink path=usr\/lib\/python3\.\d+\/vendor-packages\/backports\/__init__\.py$ -> drop>
76 # PEP 627 made the RECORD file optional. Since we do not need the file and it
77 # could contain inaccurate info we simply drop it.
78 <transform dir file link hardlink path=usr\/lib\/python3\.\d+\/vendor-packages\/[^/]+\.dist-info/RECORD$ -> drop>
79 # Replace Python version by $(PYV)
81 edit path "^(usr/lib/python3\.\d+/vendor-packages/(.*/)?[^/]+\.cpython-)3\d+\.so$" "\1$!(PYV).so">
82 # Replace Python version by $(PYVER)
83 <transform file path=usr/bin/[^/]+-3\.\d+$ -> default tmp.fmri "$(COMPONENT_FMRI)">
84 <transform file tmp.fmri=.*runtime/python -> edit path "^(usr/bin/[^/]+-)3\.\d+$" "\1$!(PYVER)">
85 <transform file tmp.fmri=.*library/python/ -> edit path "^(usr/bin/[^/]+-)3\.\d+$" "\1$!(PYVER)">
86 <transform file tmp.fmri=.* -> delete tmp.fmri .*>
87 <transform dir file link hardlink -> \
88 edit path "^(usr/lib/python3\.\d+/vendor-packages/[^/]+-py)3\.\d+(\.egg-info(/.*)?)$" "\1$!(PYVER)\2">
89 <transform dir file link hardlink -> \
90 edit path "^(usr/lib/python3\.\d+/vendor-packages/[^/]+-py)3\.\d+(-nspkg\.pth)$" "\1$!(PYVER)\2">
91 <transform dir file link hardlink -> \
92 edit path "^(usr/lib/python)3\.\d+(/.*)?$" "\1$!(PYVER)\2">
93 <transform dir file link hardlink -> \
94 edit path "^(usr/include/python)3\.\d+(/.*)?$" "\1$!(PYVER)\2">
97 <transform dir file link hardlink -> \
98 edit path "^(usr\/gcc\/)\d+\/" "\1$!(GCCVER)/">
100 <transform link hardlink -> \
101 edit target "(^|/)(sparcv9|amd64)(/|$)" "\1$!(MACH64)\3">
102 <transform link hardlink -> \
103 edit target "(^|/)(sparcv7|i86)(/|$)" "\1$!(MACH32)\3">
104 <transform link hardlink -> \
105 edit target "(^|/)(sparc|i386)(/|$)" "\1$!(MACH)\3">
107 # <transform dir file link hardlink -> \
108 # edit path "$(COMPONENT_NAME)" "$!(COMPONENT_NAME)">
109 # <transform dir file link hardlink -> \
110 # edit target "$(COMPONENT_NAME)" "$!(COMPONENT_NAME)">
112 <transform dir file link hardlink -> \
113 edit path "$(HUMAN_VERSION_RE)" "$!(HUMAN_VERSION)">
114 <transform dir file link hardlink -> \
115 edit target "$(HUMAN_VERSION_RE)" "$!(HUMAN_VERSION)">
117 <transform dir file link hardlink -> \
118 edit path "$(COMPONENT_RE_VERSION)" "$!(COMPONENT_VERSION)">
119 <transform dir file link hardlink -> \
120 edit target "$(COMPONENT_RE_VERSION)" "$!(COMPONENT_VERSION)">
122 <transform dir file link hardlink -> \
123 edit path "$(IPS_COMPONENT_RE_VERSION)" "$!(IPS_COMPONENT_VERSION)">
124 <transform dir file link hardlink -> \
125 edit target "$(IPS_COMPONENT_RE_VERSION)" "$!(IPS_COMPONENT_VERSION)">
127 # Clang support (must be after HUMAN_VERSION transforms)
128 <transform dir file link hardlink path="usr/clang/[^/]+/lib/lib.*\.so" -> \
129 edit path "(lib[^/]+\.so\.)\d+" "\1$!(CLANGVER)">
130 <transform link hardlink path="usr/clang/[^/]+/lib/lib.*\.so" -> \
131 edit target "(lib[^/]+\.so\.)\d+" "\1$!(CLANGVER)">
132 <transform dir file link hardlink -> \
133 edit path "^(usr/clang/[^/]+/lib/clang/)\d+/" "\1$!(CLANGVER)/">
134 <transform dir file link hardlink -> \
135 edit path "^(usr/clang/)\d+/" "\1$!(CLANGVER)/">
137 # convert temporary macro names to their real name
139 edit value "\$!\((.*)\)" "$(\1)">
140 <transform dir file link hardlink -> \
141 edit path "\$!\((.*)\)" "$(\1)">
142 <transform dir file link hardlink -> \
143 edit target "\$!\((.*)\)" "$(\1)">
144 <transform dir file link hardlink -> \
145 edit path "\$!\((.*)\)" "$(\1)">
146 <transform dir file link hardlink -> \
147 edit target "\$!\((.*)\)" "$(\1)">
148 <transform dir file link hardlink -> \
149 edit path "\$!\((.*)\)" "$(\1)">
150 <transform dir file link hardlink -> \
151 edit target "\$!\((.*)\)" "$(\1)">
152 <transform dir file link hardlink -> \
153 edit path "\$!\((.*)\)" "$(\1)">
154 <transform dir file link hardlink -> \
155 edit target "\$!\((.*)\)" "$(\1)">
156 <transform dir file link hardlink -> \
157 edit path "\$!\((.*)\)" "$(\1)">
158 <transform dir file link hardlink -> \
159 edit target "\$!\((.*)\)" "$(\1)">
161 <transform file link hardlink path=mangled/(.*) -> drop>
162 # drop all dirs except for illumos-closed
163 <transform dir path=(?!(opt/onbld/closed/root_i386(-nd)?/)) -> drop>