Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

beebox / crossover   deb

Repository URL to install this package:

Version: 18.5.0-1 

/ opt / cxoffice / share / crossover / cxrepackage / rpm.spec

#------------------------------------------------------------------------------
# This SPEC file controls the building of custom CrossOver RPM packages.
#
#------------------------------------------------------------------------------


#------------------------------------------------------------------------------
#   Options (see /usr/lib/rpm/macros for documentation)
#------------------------------------------------------------------------------

# Hardcode the compression algorithm to w9.gzdio which is the historical
# default. This way we produce backwards compatible packages on systems
# which use newer defaults (lzma in particular).
%define _binary_payload              w9.gzdio

# Hardcode the file digest algorithm to MD5 (1) which is the historical
# default. This way we produce backwards compatible packages on systems
# which use newer defaults.
%define _binary_filedigest_algorithm 1


#------------------------------------------------------------------------------
#   Prologue information
#------------------------------------------------------------------------------
Summary         : Run Windows applications like MS Office
License         : Proprietary; includes substantial Free Software components.
Name            : @rpm_package@
Version         : 18.5.0
Release         : @release@
Provides        : @product_id@5
Group           : Applications/Emulators
ExclusiveArch   : %{ix86}

BuildRoot	: @buildroot@
Url             : http://www.codeweavers.com
Packager        : CrossOver Packager <info@codeweavers.com>

# The prefix is pretty important; RPM uses this to figure out
# how to make a package relocatable
Prefix          : /opt


#------------------------------------------------------------------------------
#   Generate our own dependency information
#------------------------------------------------------------------------------
Autoreqprov     : No

# For our scripts
Requires        : /bin/sh, /usr/bin/perl

# For the GUI (including cxmessage, etc.)
Requires        : /usr/bin/env, python >= 2.4, python < 3.0,

# Support for 32bit binaries
Requires        : ld-linux.so.2

# The C library
Requires        : libc.so.6, libc.so.6(GLIBC_2.11), libdl.so.2, libm.so.6

# The gcc support library
Requires        : libgcc_s.so.1

# X11 support for Wine and cxsetup
Requires        : libICE.so.6, libSM.so.6, libX11.so.6, libXext.so.6

# Joystick, tablet support and more (winex11.drv/wintab32).
Requires        : libXi.so.6

# Support for TrueType fonts
Requires        : libfreetype.so.6

# Needed for msxml3.dll and wldap32.dll
Requires        : libz.so.1

Requires        : libcups.so.2

# We really need libpng too but cannot depend on it due to the many versions
# out there. Fortunately:
# - It is loaded dynamically and we try the different versions.
# - cups-libs also depends on it which ensures we'll have a 32 bit
#   library to load on 64 bit systems... except on Fedora 19.

# Require some extra libraries that are pretty important for games:
# - OpenGL needed for Direct3D and OpenGL.
# - XRandR otherwise most games won't run correctly in fullscreen or have
#   mouse issues.
Requires        : libGL.so.1, libXrandr.so.2

# Needed by many games for their color cursors.
Requires        : libXcursor.so.1

# On Fedora 27 and earlier libc provides libnsl,
# but on Fedora 28 it no longer does
Requires        : libnsl.so.1



#------------------------------------------------------------------------------
#   Description
#------------------------------------------------------------------------------
%Description
CrossOver Linux makes it possible to run Windows productivity applications
such as Microsoft Office, and Quicken, and also lets you play Windows games
like Skyrim and World of Warcraft.


#------------------------------------------------------------------------------
#   Files listing
#------------------------------------------------------------------------------
%files
%defattr(-,root,root)

%docdir            @cx_root@/doc

@dir_list@
@file_list@


%clean
# Override the default clean rule: don't delete anything


%pre
#------------------------------------------------------------------------------
#   Pre install script
#------------------------------------------------------------------------------
set -e

# Setup logging
if [ -n "$CX_LOG" ]
then
    [ "$CX_LOG" = "-" ] || exec 2>>"$CX_LOG"
    echo >&2
    echo "***** `date`" >&2
    echo "Starting: $0 $@" >&2
    set -x
fi

if [ -z "$RPM_INSTALL_PREFIX" ]
then
    RPM_INSTALL_PREFIX=/opt
fi
CX_ROOT="$RPM_INSTALL_PREFIX/@product_id@"
export CX_ROOT

cxgettext()
{
    if [ -x "$CX_ROOT/bin/cxgettext" ] && "$CX_ROOT/bin/cxgettext" "$@"
    then
       return
    fi
    echo "$@"
}

report_error()
{
    if [ -n "$DISPLAY" ]
    then
        cxmessage="$CX_ROOT/bin/cxmessage"
        if [ -z "$CX_ROOT" -o ! -f "$cxmessage" -o ! -x "$cxmessage" ]
        then
            cxmessage="xmessage"
        fi
        "$cxmessage" \
            -title "Unable to install" \
            -buttons "Abort" \
            -default "Abort" \
            "$@" &
    fi
    echo "$@" >&2
}

# Keep the check for Loki's .manifest directory to handle upgrades from
# pre-10.0 versions.
if [ -d "$CX_ROOT/.manifest" -o -d "$CX_ROOT/.mojosetup" ]
then
    msg=`cxgettext "This RPM package cannot be installed on top of a Loki or MojoSetup package."`
    report_error "$msg"
    exit 1
fi

# If this package is replacing a different package (e.g. a regular package
# replacing a demo), then "$1" will still be 1! So to correctly handle this
# case we need to check if another package provides @product_id@5 already.
# A further issue is that with some rpm versions, the "no package provides
# xxx" message may be printed to stdout so that 'wc -w' may return either 0
# or more than 1.
# Furthermore we still have to check "$1" to handle upgrades from very old
# packages that don't provide @product_id@5.
packages=`rpm -q --whatprovides @product_id@5 2>/dev/null | wc -w`
if [ "$1" != "1" -o "$packages" -eq 1 ]
then
    mode="upgrade"
else
    mode="install"
fi

if [ "$mode" = "install" ]
then
    if [ -z "$CX_PRODUCT_ID" ]
    then
        CX_PRODUCT_ID="cxoffice"
    fi
elif [ -f "$CX_ROOT/.productid" ]
then
    CX_PRODUCT_ID=`cat "$CX_ROOT/.productid"`
else
    CX_PRODUCT_ID="cxoffice"
fi
productid="$CX_PRODUCT_ID"


# This script expects CX_ROOT, productid and mode to be set

# Validate the productid
echo "$productid" | LC_ALL=C egrep '^[a-zA-Z0-9_][a-zA-Z0-9_][a-zA-Z0-9_][a-zA-Z0-9_][a-zA-Z0-9_]*$' >/dev/null
if [ $? -ne 0 ]
then
    echo "The product id '$productid' is not valid" >&2
    exit 1
fi

if [ "$mode" = "upgrade" ]
then
    if [ -f "$CX_ROOT/.productid" ]
    then
        old_productid=`cat "$CX_ROOT/.productid"`
    else
        old_productid="cxoffice"
    fi
    if [ "$productid" != "$old_productid" ]
    then
        echo "An upgrade cannot change the product id" >&2
        exit 1
    fi
fi

# Remove generated files that old packages incorrectly leave around
rm -f "$CX_ROOT"/support/icons/*.png


# RPM only deletes this file after the postinstall script is run!
rm -f "$CX_ROOT/lib/nptl"/libwine.so*


%post
#------------------------------------------------------------------------------
#   Post install script
#------------------------------------------------------------------------------
set -e

# Setup logging
if [ -n "$CX_LOG" ]
then
    [ "$CX_LOG" = "-" ] || exec 2>>"$CX_LOG"
    echo >&2
    echo "***** `date`" >&2
    echo "Starting: $0 $@" >&2
    set -x
fi

if [ -z "$RPM_INSTALL_PREFIX" ]
then
    RPM_INSTALL_PREFIX=/opt
fi
CX_ROOT="$RPM_INSTALL_PREFIX/@product_id@"
export CX_ROOT
package="rpm:@rpm_package@"

# See the %pre comment.
# Note that in this script we know that at least one package provides
# @product_id@5.
packages=`rpm -q --whatprovides @product_id@5 2>/dev/null | wc -w`
if [ "$1" != "1" -o "$packages" -gt 1 ]
then
    mode="upgrade"
else
    mode="install"
fi
oldver=""

if [ "$mode" = "install" ]
then
    if [ -z "$CX_PRODUCT_ID" ]
    then
        CX_PRODUCT_ID="@product_id@"
    fi
elif [ -f "$CX_ROOT/.productid" ]
then
    CX_PRODUCT_ID=`cat "$CX_ROOT/.productid"`
else
    CX_PRODUCT_ID="@product_id@"
fi
productid="$CX_PRODUCT_ID"

# This script expects package, CX_ROOT, productid, mode and oldver to be set


builtin_product_id="cxoffice"
if [ "$mode" = "install" ]
then
    if [ "$productid" != "$builtin_product_id" ]
    then
        echo "$productid" >"$CX_ROOT/.productid"
    else
        rm -f "$CX_ROOT/.productid"
    fi
fi

uid=`perl -e 'print $>'`

unset HOME

# These files are no longer needed (were used by version 4.x)
if [ "$uid" = "0" -a -f "/sbin/conf.d/SuSEconfig.zz$productid-vfolders" ]
then
    rm -f "/sbin/conf.d/SuSEconfig.zz$productid-vfolders"
fi
rm -f "$CX_ROOT/lib/xml/libperl.so.5.8"

# Icons have moved to share/icons
rm -f "$CX_ROOT"/support/*.png

# We don't need the 2007 DST bottle hook anymore
rm -f "$CX_ROOT"/support/scripts.d/??.dst2007patch
rmdir "$CX_ROOT"/support/scripts.d 2>/dev/null || true

# Try to set up the security context if possible (especially for Fedora).
# Do so before potentially trying to upgrade bottles.
setup_selinux()
{
    # Note that this may or may not work depending on obscure system settings.
    # So try chcon on the landmark file and don't abort if that fails.
    if chcon system_u:object_r:bin_t:s0 "$CX_ROOT"/bin/cxmenu
    then
        ( cd "$CX_ROOT"/bin && find * -type d -prune -o -type f \
            -exec chcon system_u:object_r:bin_t:s0 {} \; )
        ( cd "$CX_ROOT"/lib && find * -type d -prune -o -type f \
            -exec chcon system_u:object_r:lib_t:s0 {} \; )
        if chcon system_u:object_r:wine_exec_t:s0 "$CX_ROOT"/bin/wine-preloader
        then
            chcon system_u:object_r:wine_exec_t:s0 "$CX_ROOT"/bin/wineloader
        fi
        if chcon system_u:object_r:textrel_shlib_t:s0 "$CX_ROOT"/lib/wine/ntdll.dll.so
        then
Loading ...