Ignore:
Timestamp:
Jun 9, 2017, 5:09:03 PM (8 years ago)
Author:
dmik
Message:

spec: os2-rpm: Add os2_boot_drive os2_dos_path and os2_unixroot_path macros.

They are moved here from rpm where they were broken since 4.13 (merge regresssion).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • spec/trunk/SPECS/os2-rpm/macros.os2

    r1169 r1185  
    11# OS/2 specific rpm configuration file.
    22
     3#------------------------------------------------------------------------------
     4# Macros needed at rpm runtime (package installation and such)
     5
     6# Path to OS/2 specific rpm configuration directory containing helper scripts
    37%_rpmconfigdir_os2 @RPMCONFIGDIR_OS2@
     8
     9# OS/2 boot drive
     10%os2_boot_drive %(%{_rpmconfigdir_os2}/getbootdrive.exe)
     11
     12# Converts a Unix path to a DOS path (backward slashes) expanding /@unixroot to
     13# a current value of UNIXROOT if it starts the path.
     14%os2_dos_path() %{lua:
     15  path = rpm.expand("%{?1}")
     16  if (string.sub(path, 1, 10) == "/@unixroot" and
     17      (string.len(path) == 10 or string.sub(path, 11, 11) == '/')) then
     18    path = os.getenv("UNIXROOT") .. string.sub(path, 11)
     19  end
     20  path = string.gsub(path, "/", "\\\\")
     21  print(path)
     22}
     23
     24# Current UNIXROOT value in DOS format (backward slashes)
     25%os2_unixroot_path() %{os2_dos_path /@unixroot}
     26
     27#------------------------------------------------------------------------------
     28# Macros needed at package creation time
    429
    530# Path to script that installs legacy runtime libraries.
Note: See TracChangeset for help on using the changeset viewer.