Changeset 1170


Ignore:
Timestamp:
Jun 7, 2017, 1:19:08 AM (8 years ago)
Author:
dmik
Message:

rpm: Move OS/2 WPS/WarpIn macros to os2-rpm.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rpm/trunk/macros.in

    r1168 r1170  
    10961096
    10971097#------------------------------------------------------------------------
    1098 # Macros to handle creation/deletion of WPS objects from %post* sections.
    1099 # There are four single macros:
    1100 #
    1101 # %wps_object_create OBJECTID:SPECIFICATION
    1102 # %wps_object_create_batch < FILE
    1103 # %wps_object_delete OBJECTID
    1104 # %wps_object_delete_all
    1105 #
    1106 # And a pair of begin-end macros:
    1107 #
    1108 # %wps_object_create_begin
    1109 # OBJECTID:SPECIFICATION
    1110 # OBJECTID:SPECIFICATION
    1111 # ...
    1112 # %wps_object_create_end
    1113 #
    1114 # All macros (except %wps_object_create_end) accept the -n option that
    1115 # specifies the full package name (defaults to %{name}). The -n option
    1116 # must be always used for subpackages as there is no way to detect the
    1117 # subpackage name automatically.
    1118 #
    1119 # OBJECTID is an object identifier (w/o angle brackets). SPECIFICATION is
    1120 # a string that describes the properties of the object to create and has
    1121 # the following format:
    1122 #
    1123 #   CLASSNAME|TITLE|LOCATION[|SETUP[|OPTION]]
    1124 #
    1125 # Each component of this format string directly corresponds to the
    1126 # respective argument of the SysCreateObject REXX function. Refer to
    1127 # to the REXX reference manual for details.. Note that when OPTION is not
    1128 # specified, U (update) mode is used by default.
    1129 #
    1130 # FILE is a text file used to create multiple objects at once: each line
    1131 # in this file is an object ID followed by the specification (as described
    1132 # above except that no quotes needed), like this:
    1133 #
    1134 #   OBJECTID:SPECIFICATION
    1135 #
    1136 # The pair of begin-end macrs serves for the same purpose but doesn't require
    1137 # an external file (see below for an example).
    1138 #
    1139 # The indirect FILE or begin-end form is preferred and even required if one
    1140 # 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 of
    1142 # the comment block and fail.
    1143 #
    1144 # Note that RPM tracks reference counting for each created object so you
    1145 # may e.g. share a single WPS folder among several packages -- by creating a
    1146 # folder with the same object ID in each package's %post section and
    1147 # deleting it in its %postun section -- the folder will be actually removed
    1148 # from the desktop only when the last package that creates it gets
    1149 # uninstalled.
    1150 #
    1151 # Note also that each object is automatically associated with the package
    1152 # it is created for so that %wps_object_delete_all knows what objects
    1153 # to delete when you call it from %postun.
    1154 #
    1155 # Some object parameters (the LOCATION string or parts of the SETUP string such
    1156 # as EXENAME) require valid OS/2 path strings as values, with back slashes
    1157 # instead of forward slashes and @unixroot expanded to a full path. You may
    1158 # cause this expansion by enclosing the respective part of the string in double
    1159 # parenthesis. Note that double parenthesis may not be nested.
    1160 #
    1161 # Examples:
    1162 #
    1163 # %post
    1164 # ...
    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 once
    1170 # %wps_object_create_begin
    1171 # MYAPP_README:WPProgram|Read Me|<MYAPP_FOLDER>|EXENAME=e.exe;PROGTYPE=PROG_PM;PARAMETERS=(({_%docdir}/%{name}/README));OPEN=RUNNING
    1172 # MYAPP_URL:WPUrl|myapp.example.com|<MYAPP_FOLDER>|URL=http://myapp.example.com
    1173 # %wps_object_create_end
    1174 #
    1175 # %postun
    1176 # ...
    1177 # # delete all objects created for this package with wps_object_create*
    1178 # %wps_object_delete_all
    1179 #
    1180 # # create objects for the subpackage 'sub'
    1181 # %post sub
    1182 # %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 sub
    1186 # %wps_object_delete_all -n %{name}-sub
    1187 #
    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_begin
    1211 # Vendor\Application\ConflictingPackage1
    1212 # Vendor\Application\ConflictingPackage2
    1213 # ...
    1214 # %warpin_conflicts_end
    1215 #
    1216 # This pair of begin-end macros takes a list of WarpIn package IDs in between
    1217 # and aborts the current scriptlet if any of these packages is installed.
    1218 # A message containing the name and the version of the detected conflicting
    1219 # package, if any, is printed to the console. This pair of macros is intended
    1220 # to be used in %pre sections of .spec files so that it is able to abort the
    1221 # 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 #------------------------------------------------------------------------
    12311098# OS/2 boot drive and unixroot directory macros
    12321099#
Note: See TracChangeset for help on using the changeset viewer.