mplayer.spec 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. ##
  2. ## mplayer.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2005 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2005 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package versions
  25. %define V_mplayer 1.0pre7
  26. %define V_blue 1.4
  27. %define V_live 2005.05.26
  28. # package information
  29. Name: mplayer
  30. Summary: Multimedia Player
  31. URL: http://www.mplayerhq.hu/
  32. Vendor: Árpád Gereöffy et al.
  33. Packager: OpenPKG
  34. Distribution: OpenPKG
  35. Class: EVAL
  36. Group: Video
  37. License: GPL and others
  38. Version: %{V_mplayer}
  39. Release: 20050526
  40. # build options
  41. %option with_gui yes
  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 >= 20040130, X11, gcc, make, sed
  55. PreReq: OpenPKG, openpkg >= 20040130, X11
  56. BuildPreReq: zlib, libiconv, sdl, freetype, jpeg, png, vorbis-libs, lzo, libsmbclient
  57. PreReq: zlib, libiconv, sdl, freetype, jpeg, png, vorbis-libs, lzo, libsmbclient
  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. %track
  71. prog mplayer = {
  72. version = %{V_mplayer}
  73. url = ftp://ftp.mplayerhq.hu/MPlayer/releases/
  74. regex = MPlayer-(__VER__)\.tar\.bz2
  75. }
  76. prog mplayer:blue = {
  77. version = %{V_blue}
  78. url = ftp://ftp.mplayerhq.hu/MPlayer/Skin/
  79. regex = Blue-(__VER__)\.tar\.bz2
  80. }
  81. prog mplayer:live = {
  82. comment = "rse: new snapshots occur every second day, no need to upgrade such fast"
  83. version = %{V_live}
  84. url = http://www.live.com/liveMedia/public/
  85. regex = live\.(200\d\.\d+\.\d?[02468])\.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; *-I/usr/local/include/*[a-zA-Z0-9{},/ ]*;;g' \
  93. -e 's; */usr/local/include/*[a-zA-Z0-9{},/ ]*;;g' \
  94. -e 's; *-L/usr/local/lib/*[a-zA-Z0-9{},/ ]*;;g' \
  95. -e 's; */usr/local/lib/*[a-zA-Z0-9{},/ ]*;;g' \
  96. -e 's; */usr/local/*[a-zA-Z0-9{},/ ]*;;g' \
  97. configure
  98. %{l_shtool} subst \
  99. -e 's;u_int\([0-9]*\)_t;uint\1_t;g' \
  100. drivers/radeon/radeonfb.c \
  101. loader/module.c \
  102. loader/wrapper.h \
  103. libmpdvdkit2/bsdi_ioctl.c \
  104. libdha/sysdep/AsmMacros_alpha.h \
  105. live/groupsock/*.cpp \
  106. live/groupsock/include/*.h \
  107. live/groupsock/include/*.hh \
  108. live/liveMedia/*.cpp \
  109. live/liveMedia/*.hh \
  110. live/liveMedia/include/*.hh
  111. %build
  112. # translate target names into qmake system types
  113. case "%{l_platform -t}" in
  114. *-sunos* ) host=solaris ;;
  115. *-linux* ) host=linux ;;
  116. *-freebsd* ) host=freebsd ;;
  117. * ) host=`uname | tr A-Z a-z` ;;
  118. esac
  119. # build live streaming libs first
  120. ( cd live
  121. ./genMakefiles $host
  122. %{l_make} %{l_mflags}
  123. ) || exit $?
  124. # configure programs
  125. CC="%{l_cc}" \
  126. CXX="%{l_cxx}" \
  127. CFLAGS="%{l_cflags -O}" \
  128. CXXFLAGS="%{l_cxxflags -O} -Wno-deprecated" \
  129. CPPFLAGS="%{l_cppflags}" \
  130. LDFLAGS="%{l_ldflags}" \
  131. _ld_aa=`%{l_prefix}/bin/aalib-config --libs` \
  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. --enable-aa \
  164. --with-x11incdir=`%{l_rc} --query x11_incdir` \
  165. --with-x11libdir=`%{l_rc} --query x11_libdir` \
  166. --with-extraincdir=%{l_prefix}/include/:%{l_prefix}/include/lzo \
  167. --with-extralibdir=%{l_prefix}/lib/ \
  168. --with-sdl-config=%{l_prefix}/bin/sdl-config \
  169. --with-freetype-config=%{l_prefix}/bin/freetype-config \
  170. --disable-lirc \
  171. --disable-lircc \
  172. --disable-i18n
  173. # fix sloppy library defs for selected platforms
  174. ARCH_LIB=`grep '^ARCH_LIB' config.mak | \
  175. sed -e 's;^ARCH_LIB[ \t]*=[ \t]*\(.*\);\1;'`
  176. case "%{l_platform -t}" in
  177. *-sunos* )
  178. if echo $ARCH_LIB | grep '\-pthread[^s]'; then
  179. ARCH_LIB=`grep '^ARCH_LIB' config.mak | \
  180. sed -e 's;^ARCH_LIB[ \t]*=[ \t]*\(.*\)-pthread[^s]\(.*\);\1 -pthreads \2 -ldl -lrt;'`
  181. fi
  182. ;;
  183. esac
  184. # temporary hack to fool faad dependencies
  185. %{l_shtool} subst \
  186. -e 's;#define FAADVERSION[ \t]*$;#define FAADVERSION 20;g' \
  187. config.h
  188. # build programs
  189. %{l_make} %{l_mflags}
  190. %install
  191. rm -rf $RPM_BUILD_ROOT
  192. # create installation tree
  193. %{l_shtool} mkdir -f -p -m 755 \
  194. $RPM_BUILD_ROOT%{l_prefix}/bin \
  195. $RPM_BUILD_ROOT%{l_prefix}/etc/mplayer \
  196. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  197. %if "%{with_gui}" == "yes"
  198. $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/Skin \
  199. %endif
  200. $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/font \
  201. $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer/nativecodecs
  202. # install binaries
  203. %{l_shtool} install -s -c -m 755 \
  204. mplayer \
  205. mencoder \
  206. $RPM_BUILD_ROOT%{l_prefix}/bin/
  207. %if "%{with_gui}" == "yes"
  208. %{l_shtool} mkln -s -f \
  209. $RPM_BUILD_ROOT%{l_prefix}/bin/mplayer \
  210. $RPM_BUILD_ROOT%{l_prefix}/bin/gmplayer
  211. %endif
  212. # install manpages
  213. %{l_shtool} install -c -m 644 \
  214. DOCS/man/en/mplayer.1 \
  215. $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  216. %{l_shtool} mkln -s -f \
  217. $RPM_BUILD_ROOT%{l_prefix}/man/man1/mplayer.1 \
  218. $RPM_BUILD_ROOT%{l_prefix}/man/man1/mencoder.1
  219. # install configuration files
  220. %{l_shtool} install -c -m 644 \
  221. -e 's;^\([a-z]\);# \1;' \
  222. etc/example.conf \
  223. $RPM_BUILD_ROOT%{l_prefix}/etc/mplayer/mplayer.conf
  224. %{l_shtool} install -c -m 644 \
  225. etc/codecs.conf etc/input.conf etc/menu.conf \
  226. $RPM_BUILD_ROOT%{l_prefix}/etc/mplayer/
  227. %if "%{with_gui}" == "yes"
  228. # install a default skin
  229. ( cd $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/Skin
  230. %{l_bzip2} -dc %{SOURCE Blue-%{V_blue}.tar.bz2} | %{l_tar} -xvf -
  231. %{l_shtool} mkln -s -f Blue default
  232. ) || exit $?
  233. %endif
  234. # install fonts for OSD and subtitles
  235. %{l_bzip2} -dc %{SOURCE font-arial-iso-8859-1.tar.bz2} | %{l_tar} -xvf -
  236. cp font-arial-iso-8859-1/font-arial-24-iso-8859-1/* \
  237. $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/font/
  238. %if "%{with_win32}" == "yes"
  239. # install win32 and quicktime codecs
  240. ( %{l_shtool} mkdir -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer
  241. cd $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer
  242. %{l_bzip2} -dc %{SOURCE win32codecs.tar.bz2} | %{l_tar} -xvf -
  243. ) || exit $?
  244. %{l_bzip2} -dc %{SOURCE qt5dlls.tar.bz2} | %{l_tar} -xvf -
  245. mv -f qt5dlls/* $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer/win32codecs/
  246. %endif
  247. # determine installation files
  248. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  249. '%config %{l_prefix}/etc/mplayer/*'
  250. %files -f files
  251. %clean
  252. rm -rf $RPM_BUILD_ROOT