mplayer.spec 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. ##
  2. ## mplayer.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2003 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 versions
  26. %define V_mplayer 1.0pre2
  27. %define V_blue 1.0
  28. %define V_live 2003.10.27
  29. # package information
  30. Name: mplayer
  31. Summary: Multimedia Player
  32. URL: http://www.mplayerhq.hu/
  33. Vendor: Árpád Gereöffy et al.
  34. Packager: The OpenPKG Project
  35. Distribution: OpenPKG [EVAL]
  36. Group: Video
  37. License: GPL and others
  38. Version: %{V_mplayer}
  39. Release: 20031027
  40. # build options
  41. %option with_gui no
  42. %option with_win32 yes
  43. # list of sources
  44. Source0: ftp://ftp.mplayerhq.hu/MPlayer/releases/MPlayer-%{V_mplayer}.tar.bz2
  45. Source1: ftp://ftp.mplayerhq.hu/MPlayer/releases/fonts/font-arial-iso-8859-1.tar.bz2
  46. Source2: ftp://ftp.mplayerhq.hu/MPlayer/releases/codecs/win32codecs.tar.bz2
  47. Source3: ftp://ftp.mplayerhq.hu/MPlayer/releases/codecs/qt5dlls.tar.bz2
  48. Source4: ftp://ftp.mplayerhq.hu/MPlayer/Skin/Blue-%{V_blue}.tar.bz2
  49. Source5: http://www.live.com/liveMedia/public/live.%{V_live}.tar.gz
  50. Patch0: mplayer.patch
  51. # build information
  52. Prefix: %{l_prefix}
  53. BuildRoot: %{l_buildroot}
  54. BuildPreReq: OpenPKG, openpkg >= 20030909, X11, gcc
  55. PreReq: OpenPKG, openpkg >= 20030909, X11
  56. BuildPreReq: zlib, libiconv, sdl, freetype, jpeg, png, vorbis-libs, lzo
  57. PreReq: zlib, libiconv, sdl, freetype, jpeg, png, vorbis-libs, lzo
  58. %if "%{with_gui}" == "yes"
  59. BuildPreReq: glib, gtk
  60. PreReq: glib, gtk
  61. %endif
  62. AutoReq: no
  63. AutoReqProv: no
  64. %description
  65. This is the Unix movie player. MPlayer can play most standard
  66. video formats out of the box and almost all others with the help
  67. of external codecs. MPlayer works best from the command line, but
  68. visual feedback for many functions is available from its onscreen
  69. status display (OSD), which is also used for displaying subtitles.
  70. %prep
  71. %setup0 -q -n MPlayer-%{V_mplayer}
  72. %setup5 -q -n MPlayer-%{V_mplayer} -T -D -a 5
  73. %patch0 -p0
  74. %{l_shtool} subst \
  75. -e 's;u_int\([0-9]*\)_t;uint\1_t;g' \
  76. drivers/radeon/radeonfb.c \
  77. etc/cygwin_inttypes.h \
  78. loader/module.c \
  79. loader/wrapper.h \
  80. libmpdvdkit2/bsdi_ioctl.c \
  81. libdha/sysdep/AsmMacros_alpha.h \
  82. TVout/matroxset/matroxset.c \
  83. TVout/matroxset/fb.h \
  84. TVout/fbset/fbset.c \
  85. TVout/fbset/fb.h \
  86. TVout/con2fb/con2fb.c \
  87. live/groupsock/*.cpp \
  88. live/groupsock/include/*.h \
  89. live/groupsock/include/*.hh \
  90. live/liveMedia/*.cpp \
  91. live/liveMedia/*.hh \
  92. live/liveMedia/include/*.hh
  93. %build
  94. # translate target names into qmake system types
  95. case "%{l_platform -t}" in
  96. *-sunos* ) host=solaris ;;
  97. *-linux* ) host=linux ;;
  98. *-freebsd* ) host=freebsd ;;
  99. * ) host=`uname | tr A-Z a-z` ;;
  100. esac
  101. # build live streaming libs first
  102. ( cd live
  103. ./genMakefiles $host
  104. %{l_make} %{l_mflags}
  105. ) || exit $?
  106. # configure programs
  107. CC="%{l_cc}" \
  108. CXX="%{l_cxx}" \
  109. CFLAGS="%{l_cflags -O}" \
  110. CXXFLAGS="%{l_cxxflags -O}" \
  111. CPPFLAGS="%{l_cppflags}" \
  112. LDFLAGS="%{l_ldflags}" \
  113. ./configure \
  114. --prefix=%{l_prefix} \
  115. --confdir=%{l_prefix}/etc/mplayer/ \
  116. --with-codecsdir=%{l_prefix}/libexec/mplayer/nativecodecs/ \
  117. %if "%{with_gui}" == "yes"
  118. --enable-gui \
  119. --with-glib-config=%{l_prefix}/bin/glib-config \
  120. --with-gtk-config=%{l_prefix}/bin/gtk-config \
  121. %else
  122. --disable-gui \
  123. %endif
  124. %if "%{with_win32}" == "yes"
  125. --with-win32libdir=%{l_prefix}/libexec/mplayer/win32codecs \
  126. --enable-win32 \
  127. --enable-qtx \
  128. %else
  129. --disable-win32 \
  130. %endif
  131. --enable-largefiles \
  132. --enable-live \
  133. --with-livelibdir=`pwd`/live \
  134. --enable-xvid \
  135. --enable-freetype \
  136. --enable-vorbis \
  137. --enable-menu \
  138. --enable-jpeg \
  139. --enable-png \
  140. --enable-sdl \
  141. --enable-liblzo \
  142. --enable-x11 \
  143. --with-x11incdir=`%{l_prefix}/etc/rc --query x11_incdir` \
  144. --with-x11libdir=`%{l_prefix}/etc/rc --query x11_libdir` \
  145. --with-extraincdir=%{l_prefix}/include/:%{l_prefix}/include/lzo \
  146. --with-extralibdir=%{l_prefix}/lib/ \
  147. --with-sdl-config=%{l_prefix}/bin/sdl-config \
  148. --with-freetype-config=%{l_prefix}/bin/freetype-config \
  149. --disable-i18n
  150. # fix sloppy library defs for selected platforms
  151. ARCH_LIB=`grep '^ARCH_LIB' config.mak | \
  152. sed -e 's;^ARCH_LIB[ \t]*=[ \t]*\(.*\);\1;'`
  153. case "%{l_platform -t}" in
  154. *-sunos* )
  155. if echo $ARCH_LIB | grep '\-pthread[^s]'; then
  156. ARCH_LIB=`grep '^ARCH_LIB' config.mak | \
  157. sed -e 's;^ARCH_LIB[ \t]*=[ \t]*\(.*\)-pthread[^s]\(.*\);\1 -pthreads \2 -ldl -lrt;'`
  158. fi
  159. ;;
  160. esac
  161. # temporary hack to fool faad dependencies
  162. %{l_shtool} subst \
  163. -e 's;#define FAADVERSION[ \t]*$;#define FAADVERSION 20;g' \
  164. config.h
  165. # build programs
  166. %{l_make} %{l_mflags}
  167. %install
  168. rm -rf $RPM_BUILD_ROOT
  169. # create installation tree
  170. %{l_shtool} mkdir -f -p -m 755 \
  171. $RPM_BUILD_ROOT%{l_prefix}/bin \
  172. $RPM_BUILD_ROOT%{l_prefix}/etc/mplayer \
  173. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  174. %if "%{with_gui}" == "yes"
  175. $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/Skin \
  176. %endif
  177. $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/font \
  178. $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer/nativecodecs
  179. # install binaries
  180. %{l_shtool} install -s -c -m 755 \
  181. mplayer \
  182. mencoder \
  183. $RPM_BUILD_ROOT%{l_prefix}/bin/
  184. %if "%{with_gui}" == "yes"
  185. %{l_shtool} mkln -s -f \
  186. $RPM_BUILD_ROOT%{l_prefix}/bin/mplayer \
  187. $RPM_BUILD_ROOT%{l_prefix}/bin/gmplayer
  188. %endif
  189. # install manpages
  190. %{l_shtool} install -c -m 644 \
  191. DOCS/en/mplayer.1 \
  192. $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  193. %{l_shtool} mkln -s -f \
  194. $RPM_BUILD_ROOT%{l_prefix}/man/man1/mplayer.1 \
  195. $RPM_BUILD_ROOT%{l_prefix}/man/man1/mencoder.1
  196. # install configuration files
  197. %{l_shtool} install -c -m 644 \
  198. -e 's;^\([a-z]\);# \1;' \
  199. etc/example.conf \
  200. $RPM_BUILD_ROOT%{l_prefix}/etc/mplayer/mplayer.conf
  201. %{l_shtool} install -c -m 644 \
  202. etc/codecs.conf etc/input.conf etc/menu.conf \
  203. $RPM_BUILD_ROOT%{l_prefix}/etc/mplayer/
  204. %if "%{with_gui}" == "yes"
  205. # install a default skin
  206. ( cd $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/Skin
  207. %{l_bzip2} -dc %{SOURCE Blue-%{V_blue}.tar.bz2} | %{l_tar} -xvf -
  208. %{l_shtool} mkln -s -f Blue default
  209. ) || exit $?
  210. %endif
  211. # install fonts for OSD and subtitles
  212. %{l_bzip2} -dc %{SOURCE font-arial-iso-8859-1.tar.bz2} | %{l_tar} -xvf -
  213. cp -f font-arial-iso-8859-1/font-arial-24-iso-8859-1/* \
  214. $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/font/
  215. %if "%{with_win32}" == "yes"
  216. # install win32 and quicktime codecs
  217. ( %{l_shtool} mkdir -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer
  218. cd $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer
  219. %{l_bzip2} -dc %{SOURCE win32codecs.tar.bz2} | %{l_tar} -xvf -
  220. ) || exit $?
  221. %{l_bzip2} -dc %{SOURCE qt5dlls.tar.bz2} | %{l_tar} -xvf -
  222. mv -f qt5dlls/* $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer/win32codecs/
  223. %endif
  224. # determine installation files
  225. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  226. '%config %{l_prefix}/etc/mplayer/*'
  227. %files -f files
  228. %clean
  229. rm -rf $RPM_BUILD_ROOT