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 dir file link hardlink -> \
101 edit target "/(sparcv9|amd64)$" "/$!(MACH64)">
102 <transform dir file link hardlink -> \
103 edit target "/(sparcv9|amd64)/" "/$!(MACH64)/">
104 <transform dir file link hardlink -> \
105 edit target "/(sparcv7|i86)$" "/$!(MACH32)">
106 <transform dir file link hardlink -> \
107 edit target "/(sparcv7|i86)/" "/$!(MACH32)/">
108 <transform dir file link hardlink -> \
109 edit target "/(sparc|i386)$" "/$!(MACH)">
110 <transform dir file link hardlink -> \
111 edit target "/(sparc|i386)/" "/$!(MACH)/">
113 # <transform dir file link hardlink -> \
114 # edit path "$(COMPONENT_NAME)" "$!(COMPONENT_NAME)">
115 # <transform dir file link hardlink -> \
116 # edit target "$(COMPONENT_NAME)" "$!(COMPONENT_NAME)">
118 <transform dir file link hardlink -> \
119 edit path "$(HUMAN_VERSION_RE)" "$!(HUMAN_VERSION)">
120 <transform dir file link hardlink -> \
121 edit target "$(HUMAN_VERSION_RE)" "$!(HUMAN_VERSION)">
123 <transform dir file link hardlink -> \
124 edit path "$(COMPONENT_RE_VERSION)" "$!(COMPONENT_VERSION)">
125 <transform dir file link hardlink -> \
126 edit target "$(COMPONENT_RE_VERSION)" "$!(COMPONENT_VERSION)">
128 <transform dir file link hardlink -> \
129 edit path "$(IPS_COMPONENT_RE_VERSION)" "$!(IPS_COMPONENT_VERSION)">
130 <transform dir file link hardlink -> \
131 edit target "$(IPS_COMPONENT_RE_VERSION)" "$!(IPS_COMPONENT_VERSION)">
133 # convert temporary macro names to their real name
135 edit value "\$!\((.*)\)" "$(\1)">
136 <transform dir file link hardlink -> \
137 edit path "\$!\((.*)\)" "$(\1)">
138 <transform dir file link hardlink -> \
139 edit target "\$!\((.*)\)" "$(\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)">
157 <transform file link hardlink path=mangled/(.*) -> drop>
158 # drop all dirs except for illumos-closed
159 <transform dir path=(?!(opt/onbld/closed/root_i386(-nd)?/)) -> drop>