mplayer.spec 9.2 KB

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