wine.spec 5.8 KB

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