wine.spec 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. ##
  2. ## wine.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package information
  26. Name: wine
  27. Summary: Wine Is Not an Emulator (WINE)
  28. URL: http://www.winehq.org/
  29. Vendor: Bob Amstadt, Alexandre Julliard et al.
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG
  32. Class: EVAL
  33. Group: XWindow
  34. License: LGPL
  35. Version: 20040309
  36. Release: 20040316
  37. # list of sources
  38. Source0: http://www.ibiblio.org/pub/Linux/ALPHA/wine/development/Wine-%{version}.tar.gz
  39. Source1: winesetup.sh
  40. Patch0: wine.patch
  41. # build information
  42. Prefix: %{l_prefix}
  43. BuildRoot: %{l_buildroot}
  44. BuildPreReq: OpenPKG, openpkg >= 20040130, X11, xpm, perl, gcc, make, flex, bison
  45. PreReq: OpenPKG, openpkg >= 20040130, X11, xpm, perl
  46. AutoReq: no
  47. AutoReqProv: no
  48. %description
  49. The Wine project started in 1993 as a way to support running Win16
  50. and Win32 API based programs on Intel x86. Wine does not emulate
  51. the Intel x86 processor. Instead the applications run natively on
  52. the Intel x86 with just all Windows API calls implemented by Wine
  53. through a mapping onto the Unix/X11 API. An original Microsoft
  54. Windows(tm) installation is not required, because the goal of Wine
  55. is the full reimplementation of the Windows APIs which makes the
  56. original Windows implementation unnecessary. Wine is still under
  57. heavy development, but many people find it already useful in running
  58. a growing number of Windows applications.
  59. %track
  60. prog wine = {
  61. version = %{version}
  62. url = http://www.ibiblio.org/pub/Linux/ALPHA/wine/development/
  63. regex = Wine-(__VER__)\.tar\.gz
  64. }
  65. %prep
  66. %setup -q
  67. %patch -p0
  68. # pre-check the build platform in advance
  69. case "%{l_platform -t}" in
  70. *i?86-linux* | *i?86-freebsd* | *i?86-netbsd* | *i?86-sunos* ) ;;
  71. * ) echo "Linux/FreeBSD/NetBSD/Solaris on Intel x86 supported only"; exit 1 ;;
  72. esac
  73. %build
  74. # configure package
  75. CC="%{l_cc}" \
  76. CXX="%{l_cxx}" \
  77. CFLAGS="%{l_cflags -O}" \
  78. CXXFLAGS="%{l_cxxflags -O}" \
  79. CPPFLAGS="%{l_cppflags}" \
  80. LDFLAGS="%{l_ldflags}" \
  81. ./configure \
  82. --prefix=%{l_prefix} \
  83. --disable-trace \
  84. --disable-debug
  85. # build package
  86. %{l_make} %{l_mflags -O}
  87. %install
  88. rm -rf $RPM_BUILD_ROOT
  89. # install package
  90. %{l_make} %{l_mflags} install \
  91. prefix=$RPM_BUILD_ROOT%{l_prefix} \
  92. exec_prefix=$RPM_BUILD_ROOT%{l_prefix}
  93. # install default configuration files
  94. %{l_shtool} mkdir -f -p -m 755 \
  95. $RPM_BUILD_ROOT%{l_prefix}/share/wine
  96. %{l_shtool} install -c -m 644 \
  97. tools/wine.inf documentation/samples/* \
  98. $RPM_BUILD_ROOT%{l_prefix}/share/wine/
  99. # post-adjust installation
  100. mv $RPM_BUILD_ROOT%{l_prefix}/bin/function_grep.pl \
  101. $RPM_BUILD_ROOT%{l_prefix}/bin/function_grep
  102. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  103. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3w
  104. %{l_shtool} subst \
  105. -e 's;#!/usr/bin/perl;#!%{l_prefix}/bin/perl;' \
  106. $RPM_BUILD_ROOT%{l_prefix}/bin/winemaker
  107. # make sure the shared libraries are found
  108. %{l_shtool} mkdir -f -p -m 755 \
  109. $RPM_BUILD_ROOT%{l_prefix}/libexec/wine
  110. for prog in wine wineserver wmc wrc; do
  111. mv $RPM_BUILD_ROOT%{l_prefix}/bin/$prog \
  112. $RPM_BUILD_ROOT%{l_prefix}/libexec/wine/$prog
  113. ( echo "#!/bin/sh"
  114. echo "LD_LIBRARY_PATH=\"%{l_prefix}/lib:\${LD_LIBRARY_PATH:-/usr/lib}\""
  115. echo "export LD_LIBRARY_PATH"
  116. echo "exec %{l_prefix}/libexec/wine/$prog \${1+\"\$@\"}"
  117. ) >$prog.sh && %{l_shtool} install -c -m 755 \
  118. $prog.sh $RPM_BUILD_ROOT%{l_prefix}/bin/$prog
  119. done
  120. # install a utility for setting up $HOME/.wine
  121. %{l_shtool} install -c -m 755 %{l_value -s l_prefix} \
  122. %{SOURCE winesetup.sh} \
  123. $RPM_BUILD_ROOT%{l_prefix}/bin/winesetup
  124. # determine installation files
  125. %{l_rpmtool} files -v -ofiles-wine -r$RPM_BUILD_ROOT \
  126. %{l_files_std} \
  127. '%not %dir %{l_prefix}/share/aclocal'
  128. %files -f files-wine
  129. %clean
  130. rm -rf $RPM_BUILD_ROOT
  131. %post
  132. if [ $1 -eq 1 ]; then
  133. ( echo "In order to use WINE, every user has to establish a reasonable"
  134. echo "\$HOME/.wine/ folder containing at least the essential directory"
  135. echo "structure of Windows on a classical C:\\ drive plus some initial"
  136. echo "system registry. For this each WINE user should initially run:"
  137. echo "\$ $RPM_INSTALL_PREFIX/bin/winesetup"
  138. ) | %{l_rpmtool} msg -b
  139. fi