# OS/2 specific rpm configuration file. #------------------------------------------------------------------------------ # Macros needed at rpm runtime (package installation and such) # Path to OS/2 specific rpm configuration directory containing helper scripts %_rpmconfigdir_os2 @RPMCONFIGDIR_OS2@ # System-wide path for OS/2 language files accessed via DPATH env. variable. %os2_langdir %{_datadir}/os2/lang # System-wide path for OS/2 INF files accessible via BOOKSHELF env. variable. %os2_bookdir %{_datadir}/os2/book # System-wide path for OS/2 HLP files accessible via HELP env. variable. %os2_helpdir %{_datadir}/os2/help # Converts back slashes to forward slashes. %os2_fwdslashes() %{lua: print((string.gsub(rpm.expand("%{?**}"), "\\\\", "/")))} # Converts forward lashes to back slashes. %os2_backslashes() %{lua: print((string.gsub(rpm.expand("%{?**}"), "/", "\\\\")))} # Converts a Unix path to a DOS path (backward slashes) replacing /@unixroot # with %UNIXROOT% if it starts the path. Note that if %UNIXROOT% per se contains # forward slashes, they are not converted (if you need this, use # os2_expand_unixroot and os2_backslashes). Several paths separated by ';' may # be given to handle them at once (useful for PATH-like env.vars). %os2_dos_path() %{lua: function conv_path(path) if (string.sub(path, 1, 10) == "/@unixroot" and (string.len(path) == 10 or string.sub(path, 11, 11) == '/')) then path = "%UNIXROOT%" .. string.sub(path, 11) end path = string.gsub(path, "/", "\\\\") return path end path = rpm.expand("%{?**}") seen_first = false for p in string.gmatch(path, "[^;]*") do print((seen_first and ';' or '') .. conv_path(p)) seen_first = seen_first or true end } # Expands /@unixroot to the current value of UNIXROOT if it starts the path # and converts all slashes to forward ones. If you need no fowrard slashes and # using of %UNIXROOT% instead of the real value is fine, use os2_dos_path as # it doesn't reqire -e (see below). Several paths separated by ';' may be # given to handle them at once (useful for PATH-like env.vars). # NOTE: Don't use in install-time scriptlets unless with -e and as %%{...}. %os2_expand_unixroot() %{lua: function conv_path(path) if (string.sub(path, 1, 10) == "/@unixroot" and (string.len(path) == 10 or string.sub(path, 11, 11) == '/')) then path = os.getenv("UNIXROOT") .. string.sub(path, 11) end path = string.gsub(path, "\\\\", "/") return path end path = rpm.expand("%{?**}") seen_first = false for p in string.gmatch(path, "[^;]*") do print((seen_first and ';' or '') .. conv_path(p)) seen_first = seen_first or true end } # Expands DOS-like environment variables (%VAR%) to their current values. # NOTE: Don't use in install-time scriptlets unless with -e and as %%{...}. %os2_expand_dos_vars() %{lua: str = rpm.expand("%{?**}") str = string.gsub(str, "%%(%a+)%%", os.getenv) print(str) } # Current UNIXROOT value in DOS format (backward slashes) # NOTE: Don't use in install-time scriptlets unless with -e and as %%{...}. %os2_unixroot_path() %{os2_backslashes %{os2_expand_unixroot /@unixroot}} # OS/2 boot drive. # NOTE: Don't use in install-time scriptlets unless with -e and as %%{...}. %os2_boot_drive %(%{_rpmconfigdir_os2}/getbootdrive.exe) #------------------------------------------------------------------------------ # Macros needed at package creation time # Path to script that installs legacy runtime libraries. %__legacy_runtime_install_post \ %{_rpmconfigdir_os2}/find-legacy-runtime.sh install "%{_target_cpu}" "%{_builddir}/%{?buildsubdir}"\ %{nil} # Template for legacy runtime sub-packages. %legacy_runtime_packages \ %global __legacy_runtime_packages 1\ %{expand:%(%{_rpmconfigdir_os2}/find-legacy-runtime.sh package "%{name}" "%{_sourcedir}" "%{_target_cpu}" "%{buildroot}")}\ %{nil} # List of debug files generated by brp-strip-os2 with %exclude prepended (to be # used with -f option in %files to automatically exclude them from packages). %debug_package_exclude_files "%{_builddir}/%{?buildsubdir}/exclude-debugfiles.list" # Only run what we really need in post-install on OS/2. %__os_install_post \ %{_rpmconfigdir}/brp-compress "./@unixroot"\ %{_rpmconfigdir_os2}/brp-strip-os2 "%{_builddir}/%{?buildsubdir}" %{?_strip_no_compress:--no-compress} %{!?__debug_package:--no-debuginfo} %{?_strip_opts}\ %{?__legacy_runtime_packages:%{__legacy_runtime_install_post}}\ %{?__debug_package:%{__sed} -e 's/^/%exclude /' "%{_builddir}/%{?buildsubdir}/debugfiles.list" > %{debug_package_exclude_files}}\ %{nil} # Disable using find-debuginfo.sh, brp-strip-os2 does the job. %__debug_install_post %{nil}