mplayer.spec 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  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.0pre3
  27. %define V_blue 1.0
  28. %define V_live 2004.01.19
  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: 20040120
  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, sed
  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. loader/module.c \
  78. loader/wrapper.h \
  79. libmpdvdkit2/bsdi_ioctl.c \
  80. libdha/sysdep/AsmMacros_alpha.h \
  81. TVout/matroxset/matroxset.c \
  82. TVout/matroxset/fb.h \
  83. TVout/fbset/fbset.c \
  84. TVout/fbset/fb.h \
  85. TVout/con2fb/con2fb.c \
  86. live/groupsock/*.cpp \
  87. live/groupsock/include/*.h \
  88. live/groupsock/include/*.hh \
  89. live/liveMedia/*.cpp \
  90. live/liveMedia/*.hh \
  91. live/liveMedia/include/*.hh
  92. %build
  93. # translate target names into qmake system types
  94. case "%{l_platform -t}" in
  95. *-sunos* ) host=solaris ;;
  96. *-linux* ) host=linux ;;
  97. *-freebsd* ) host=freebsd ;;
  98. * ) host=`uname | tr A-Z a-z` ;;
  99. esac
  100. # build live streaming libs first
  101. ( cd live
  102. ./genMakefiles $host
  103. %{l_make} %{l_mflags}
  104. ) || exit $?
  105. # configure programs
  106. CC="%{l_cc}" \
  107. CXX="%{l_cxx}" \
  108. CFLAGS="%{l_cflags -O}" \
  109. CXXFLAGS="%{l_cxxflags -O} -Wno-deprecated" \
  110. CPPFLAGS="%{l_cppflags}" \
  111. LDFLAGS="%{l_ldflags}" \
  112. ./configure \
  113. --prefix=%{l_prefix} \
  114. --confdir=%{l_prefix}/etc/mplayer/ \
  115. --with-codecsdir=%{l_prefix}/libexec/mplayer/nativecodecs/ \
  116. %if "%{with_gui}" == "yes"
  117. --enable-gui \
  118. --with-glib-config=%{l_prefix}/bin/glib-config \
  119. --with-gtk-config=%{l_prefix}/bin/gtk-config \
  120. %else
  121. --disable-gui \
  122. %endif
  123. %if "%{with_win32}" == "yes"
  124. --with-win32libdir=%{l_prefix}/libexec/mplayer/win32codecs \
  125. --enable-win32 \
  126. --enable-qtx \
  127. %else
  128. --disable-win32 \
  129. %endif
  130. --enable-largefiles \
  131. --enable-live \
  132. --with-livelibdir=`pwd`/live \
  133. --enable-xvid \
  134. --enable-freetype \
  135. --enable-vorbis \
  136. --enable-menu \
  137. --enable-jpeg \
  138. --enable-png \
  139. --enable-sdl \
  140. --enable-liblzo \
  141. --enable-x11 \
  142. --with-x11incdir=`%{l_prefix}/etc/rc --query x11_incdir` \
  143. --with-x11libdir=`%{l_prefix}/etc/rc --query x11_libdir` \
  144. --with-extraincdir=%{l_prefix}/include/:%{l_prefix}/include/lzo \
  145. --with-extralibdir=%{l_prefix}/lib/ \
  146. --with-sdl-config=%{l_prefix}/bin/sdl-config \
  147. --with-freetype-config=%{l_prefix}/bin/freetype-config \
  148. --disable-i18n
  149. # fix sloppy library defs for selected platforms
  150. ARCH_LIB=`grep '^ARCH_LIB' config.mak | \
  151. sed -e 's;^ARCH_LIB[ \t]*=[ \t]*\(.*\);\1;'`
  152. case "%{l_platform -t}" in
  153. *-sunos* )
  154. if echo $ARCH_LIB | grep '\-pthread[^s]'; then
  155. ARCH_LIB=`grep '^ARCH_LIB' config.mak | \
  156. sed -e 's;^ARCH_LIB[ \t]*=[ \t]*\(.*\)-pthread[^s]\(.*\);\1 -pthreads \2 -ldl -lrt;'`
  157. fi
  158. ;;
  159. esac
  160. # temporary hack to fool faad dependencies
  161. %{l_shtool} subst \
  162. -e 's;#define FAADVERSION[ \t]*$;#define FAADVERSION 20;g' \
  163. config.h
  164. # build programs
  165. %{l_make} %{l_mflags}
  166. %install
  167. rm -rf $RPM_BUILD_ROOT
  168. # create installation tree
  169. %{l_shtool} mkdir -f -p -m 755 \
  170. $RPM_BUILD_ROOT%{l_prefix}/bin \
  171. $RPM_BUILD_ROOT%{l_prefix}/etc/mplayer \
  172. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  173. %if "%{with_gui}" == "yes"
  174. $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/Skin \
  175. %endif
  176. $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/font \
  177. $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer/nativecodecs
  178. # install binaries
  179. %{l_shtool} install -s -c -m 755 \
  180. mplayer \
  181. mencoder \
  182. $RPM_BUILD_ROOT%{l_prefix}/bin/
  183. %if "%{with_gui}" == "yes"
  184. %{l_shtool} mkln -s -f \
  185. $RPM_BUILD_ROOT%{l_prefix}/bin/mplayer \
  186. $RPM_BUILD_ROOT%{l_prefix}/bin/gmplayer
  187. %endif
  188. # install manpages
  189. %{l_shtool} install -c -m 644 \
  190. DOCS/man/en/mplayer.1 \
  191. $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  192. %{l_shtool} mkln -s -f \
  193. $RPM_BUILD_ROOT%{l_prefix}/man/man1/mplayer.1 \
  194. $RPM_BUILD_ROOT%{l_prefix}/man/man1/mencoder.1
  195. # install configuration files
  196. %{l_shtool} install -c -m 644 \
  197. -e 's;^\([a-z]\);# \1;' \
  198. etc/example.conf \
  199. $RPM_BUILD_ROOT%{l_prefix}/etc/mplayer/mplayer.conf
  200. %{l_shtool} install -c -m 644 \
  201. etc/codecs.conf etc/input.conf etc/menu.conf \
  202. $RPM_BUILD_ROOT%{l_prefix}/etc/mplayer/
  203. %if "%{with_gui}" == "yes"
  204. # install a default skin
  205. ( cd $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/Skin
  206. %{l_bzip2} -dc %{SOURCE Blue-%{V_blue}.tar.bz2} | %{l_tar} -xvf -
  207. %{l_shtool} mkln -s -f Blue default
  208. ) || exit $?
  209. %endif
  210. # install fonts for OSD and subtitles
  211. %{l_bzip2} -dc %{SOURCE font-arial-iso-8859-1.tar.bz2} | %{l_tar} -xvf -
  212. cp font-arial-iso-8859-1/font-arial-24-iso-8859-1/* \
  213. $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/font/
  214. %if "%{with_win32}" == "yes"
  215. # install win32 and quicktime codecs
  216. ( %{l_shtool} mkdir -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer
  217. cd $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer
  218. %{l_bzip2} -dc %{SOURCE win32codecs.tar.bz2} | %{l_tar} -xvf -
  219. ) || exit $?
  220. %{l_bzip2} -dc %{SOURCE qt5dlls.tar.bz2} | %{l_tar} -xvf -
  221. mv -f qt5dlls/* $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer/win32codecs/
  222. %endif
  223. # determine installation files
  224. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  225. '%config %{l_prefix}/etc/mplayer/*'
  226. %files -f files
  227. %clean
  228. rm -rf $RPM_BUILD_ROOT