##
## wine.spec -- OpenPKG RPM Specification
## Copyright (c) 2000-2004 The OpenPKG Project
## Copyright (c) 2000-2004 Ralf S. Engelschall
## Copyright (c) 2000-2004 Cable & Wireless
##
## Permission to use, copy, modify, and distribute this software for
## any purpose with or without fee is hereby granted, provided that
## the above copyright notice and this permission notice appear in all
## copies.
##
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
## SUCH DAMAGE.
##
# package information
Name: wine
Summary: Wine Is Not an Emulator (WINE)
URL: http://www.winehq.org/
Vendor: Bob Amstadt, Alexandre Julliard et al.
Packager: The OpenPKG Project
Distribution: OpenPKG
Class: EVAL
Group: XWindow
License: LGPL
Version: 20040309
Release: 20040316
# list of sources
Source0: http://www.ibiblio.org/pub/Linux/ALPHA/wine/development/Wine-%{version}.tar.gz
Source1: winesetup.sh
Patch0: wine.patch
# build information
Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
BuildPreReq: OpenPKG, openpkg >= 20040130, X11, xpm, perl, gcc, make, flex, bison
PreReq: OpenPKG, openpkg >= 20040130, X11, xpm, perl
AutoReq: no
AutoReqProv: no
%description
The Wine project started in 1993 as a way to support running Win16
and Win32 API based programs on Intel x86. Wine does not emulate
the Intel x86 processor. Instead the applications run natively on
the Intel x86 with just all Windows API calls implemented by Wine
through a mapping onto the Unix/X11 API. An original Microsoft
Windows(tm) installation is not required, because the goal of Wine
is the full reimplementation of the Windows APIs which makes the
original Windows implementation unnecessary. Wine is still under
heavy development, but many people find it already useful in running
a growing number of Windows applications.
%track
prog wine = {
version = %{version}
url = http://www.ibiblio.org/pub/Linux/ALPHA/wine/development/
regex = Wine-(__VER__)\.tar\.gz
}
%prep
%setup -q
%patch -p0
# pre-check the build platform in advance
case "%{l_platform -t}" in
*i?86-linux* | *i?86-freebsd* | *i?86-netbsd* | *i?86-sunos* ) ;;
* ) echo "Linux/FreeBSD/NetBSD/Solaris on Intel x86 supported only"; exit 1 ;;
esac
%build
# configure package
CC="%{l_cc}" \
CXX="%{l_cxx}" \
CFLAGS="%{l_cflags -O}" \
CXXFLAGS="%{l_cxxflags -O}" \
CPPFLAGS="%{l_cppflags}" \
LDFLAGS="%{l_ldflags}" \
./configure \
--prefix=%{l_prefix} \
--disable-trace \
--disable-debug
# build package
%{l_make} %{l_mflags -O}
%install
rm -rf $RPM_BUILD_ROOT
# install package
%{l_make} %{l_mflags} install \
prefix=$RPM_BUILD_ROOT%{l_prefix} \
exec_prefix=$RPM_BUILD_ROOT%{l_prefix}
# install default configuration files
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/share/wine
%{l_shtool} install -c -m 644 \
tools/wine.inf documentation/samples/* \
$RPM_BUILD_ROOT%{l_prefix}/share/wine/
# post-adjust installation
mv $RPM_BUILD_ROOT%{l_prefix}/bin/function_grep.pl \
$RPM_BUILD_ROOT%{l_prefix}/bin/function_grep
strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3w
%{l_shtool} subst \
-e 's;#!/usr/bin/perl;#!%{l_prefix}/bin/perl;' \
$RPM_BUILD_ROOT%{l_prefix}/bin/winemaker
# make sure the shared libraries are found
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/libexec/wine
for prog in wine wineserver wmc wrc; do
mv $RPM_BUILD_ROOT%{l_prefix}/bin/$prog \
$RPM_BUILD_ROOT%{l_prefix}/libexec/wine/$prog
( echo "#!/bin/sh"
echo "LD_LIBRARY_PATH=\"%{l_prefix}/lib:\${LD_LIBRARY_PATH:-/usr/lib}\""
echo "export LD_LIBRARY_PATH"
echo "exec %{l_prefix}/libexec/wine/$prog \${1+\"\$@\"}"
) >$prog.sh && %{l_shtool} install -c -m 755 \
$prog.sh $RPM_BUILD_ROOT%{l_prefix}/bin/$prog
done
# install a utility for setting up $HOME/.wine
%{l_shtool} install -c -m 755 %{l_value -s l_prefix} \
%{SOURCE winesetup.sh} \
$RPM_BUILD_ROOT%{l_prefix}/bin/winesetup
# determine installation files
%{l_rpmtool} files -v -ofiles-wine -r$RPM_BUILD_ROOT \
%{l_files_std} \
'%not %dir %{l_prefix}/share/aclocal'
%files -f files-wine
%clean
rm -rf $RPM_BUILD_ROOT
%post
if [ $1 -eq 1 ]; then
( echo "In order to use WINE, every user has to establish a reasonable"
echo "\$HOME/.wine/ folder containing at least the essential directory"
echo "structure of Windows on a classical C:\\ drive plus some initial"
echo "system registry. For this each WINE user should initially run:"
echo "\$ $RPM_INSTALL_PREFIX/bin/winesetup"
) | %{l_rpmtool} msg -b
fi