mplayer.spec 9.1 KB

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