mplayer.spec 9.3 KB

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