Changeset 1170
- Timestamp:
- Jun 7, 2017, 1:19:08 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
rpm/trunk/macros.in
r1168 r1170 1096 1096 1097 1097 #------------------------------------------------------------------------ 1098 # Macros to handle creation/deletion of WPS objects from %post* sections.1099 # There are four single macros:1100 #1101 # %wps_object_create OBJECTID:SPECIFICATION1102 # %wps_object_create_batch < FILE1103 # %wps_object_delete OBJECTID1104 # %wps_object_delete_all1105 #1106 # And a pair of begin-end macros:1107 #1108 # %wps_object_create_begin1109 # OBJECTID:SPECIFICATION1110 # OBJECTID:SPECIFICATION1111 # ...1112 # %wps_object_create_end1113 #1114 # All macros (except %wps_object_create_end) accept the -n option that1115 # specifies the full package name (defaults to %{name}). The -n option1116 # must be always used for subpackages as there is no way to detect the1117 # subpackage name automatically.1118 #1119 # OBJECTID is an object identifier (w/o angle brackets). SPECIFICATION is1120 # a string that describes the properties of the object to create and has1121 # the following format:1122 #1123 # CLASSNAME|TITLE|LOCATION[|SETUP[|OPTION]]1124 #1125 # Each component of this format string directly corresponds to the1126 # respective argument of the SysCreateObject REXX function. Refer to1127 # to the REXX reference manual for details.. Note that when OPTION is not1128 # specified, U (update) mode is used by default.1129 #1130 # FILE is a text file used to create multiple objects at once: each line1131 # in this file is an object ID followed by the specification (as described1132 # above except that no quotes needed), like this:1133 #1134 # OBJECTID:SPECIFICATION1135 #1136 # The pair of begin-end macrs serves for the same purpose but doesn't require1137 # an external file (see below for an example).1138 #1139 # The indirect FILE or begin-end form is preferred and even required if one1140 # of the object parameters contains a double forward slash (e.g. 'http://foo')1141 # because otherwise the Classic REXX interpreter will treat it as a start of1142 # the comment block and fail.1143 #1144 # Note that RPM tracks reference counting for each created object so you1145 # may e.g. share a single WPS folder among several packages -- by creating a1146 # folder with the same object ID in each package's %post section and1147 # deleting it in its %postun section -- the folder will be actually removed1148 # from the desktop only when the last package that creates it gets1149 # uninstalled.1150 #1151 # Note also that each object is automatically associated with the package1152 # it is created for so that %wps_object_delete_all knows what objects1153 # to delete when you call it from %postun.1154 #1155 # Some object parameters (the LOCATION string or parts of the SETUP string such1156 # as EXENAME) require valid OS/2 path strings as values, with back slashes1157 # instead of forward slashes and @unixroot expanded to a full path. You may1158 # cause this expansion by enclosing the respective part of the string in double1159 # parenthesis. Note that double parenthesis may not be nested.1160 #1161 # Examples:1162 #1163 # %post1164 # ...1165 # # create objects one by one...1166 # %wps_object_create MYAPP_FOLDER:WPFolder|My App %{version}|<WP_DESKTOP>1167 # %wps_object_create MYAPP_EXE:WPProgram|My App|<MYAPP_FOLDER>|EXENAME=((${_bindir}/myapp.exe))1168 #1169 # # ...or all at once1170 # %wps_object_create_begin1171 # MYAPP_README:WPProgram|Read Me|<MYAPP_FOLDER>|EXENAME=e.exe;PROGTYPE=PROG_PM;PARAMETERS=(({_%docdir}/%{name}/README));OPEN=RUNNING1172 # MYAPP_URL:WPUrl|myapp.example.com|<MYAPP_FOLDER>|URL=http://myapp.example.com1173 # %wps_object_create_end1174 #1175 # %postun1176 # ...1177 # # delete all objects created for this package with wps_object_create*1178 # %wps_object_delete_all1179 #1180 # # create objects for the subpackage 'sub'1181 # %post sub1182 # %wps_object_create -n %{name}-sub MYAPP_EXE:WPProgram|My Sub App|<MYAPP_FOLDER>|EXENAME=((${_bindir}/mysubapp.exe))1183 #1184 # # delete objects for the subpackage 'sub'1185 # %postun sub1186 # %wps_object_delete_all -n %{name}-sub1187 #1188 1189 %wps_object_create(n:) /@unixroot/usr/lib/rpm/wps-object.cmd /create %{!-n:%{name}}%{-n:%{-n*}} "%{*}"\1190 %{nil}1191 1192 %wps_object_create_batch(n:) /@unixroot/usr/lib/rpm/wps-object.cmd /create %{!-n:%{name}}%{-n:%{-n*}} %{*}\1193 %{nil}1194 1195 %wps_object_delete(n:) /@unixroot/usr/lib/rpm/wps-object.cmd /delete %{!-n:%{name}}%{-n:%{-n*}} "%{*}"\1196 %{nil}1197 1198 %wps_object_delete_all(n:) /@unixroot/usr/lib/rpm/wps-object.cmd /deleteall %{!-n:%{name}}%{-n:%{-n*}}\1199 %{nil}1200 1201 %wps_object_create_begin(n:) /@unixroot/usr/lib/rpm/wps-object.cmd /create %{!-n:%{name}}%{-n:%{-n*}} <<'EOF'\1202 %{nil}1203 1204 %wps_object_create_end EOF\1205 ###1206 1207 #------------------------------------------------------------------------1208 # Macros to check for conflicts with installed WarpIn packages.1209 #1210 # %warpin_conflicts_begin1211 # Vendor\Application\ConflictingPackage11212 # Vendor\Application\ConflictingPackage21213 # ...1214 # %warpin_conflicts_end1215 #1216 # This pair of begin-end macros takes a list of WarpIn package IDs in between1217 # and aborts the current scriptlet if any of these packages is installed.1218 # A message containing the name and the version of the detected conflicting1219 # package, if any, is printed to the console. This pair of macros is intended1220 # to be used in %pre sections of .spec files so that it is able to abort the1221 # installation if there are conflicts.1222 #1223 1224 %warpin_conflicts_begin \{ /@unixroot/usr/lib/rpm/warpin-conflicts.cmd <<'EOF'\1225 %{nil}1226 1227 %warpin_conflicts_end EOF\1228 \} || exit $?1229 1230 #------------------------------------------------------------------------1231 1098 # OS/2 boot drive and unixroot directory macros 1232 1099 #
Note:
See TracChangeset
for help on using the changeset viewer.