mplayer.spec 9.5 KB

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