mplayer.spec 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. ##
  2. ## mplayer.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2006 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_codecs_essential 20050412
  27. %define V_codecs_quicktime 20040704
  28. %define V_skin_blue 1.4
  29. %define V_extension_live 2006.03.03
  30. # package information
  31. Name: mplayer
  32. Summary: Multimedia Player
  33. URL: http://www.mplayerhq.hu/
  34. Vendor: Árpád Gereöffy et al.
  35. Packager: OpenPKG
  36. Distribution: OpenPKG
  37. Class: EVAL
  38. Group: Video
  39. License: GPL and others
  40. Version: %{V_mplayer}
  41. Release: 20060309
  42. # build options
  43. %option with_gui yes
  44. %option with_win32 yes
  45. # list of sources
  46. Source0: ftp://ftp2.mplayerhq.hu/MPlayer/releases/MPlayer-%{V_mplayer}.tar.bz2
  47. Source1: ftp://ftp2.mplayerhq.hu/MPlayer/releases/codecs/windows-essential-%{V_codecs_essential}.zip
  48. Source2: ftp://ftp2.mplayerhq.hu/MPlayer/releases/fonts/font-arial-iso-8859-1.tar.bz2
  49. Source3: ftp://ftp2.mplayerhq.hu/MPlayer/Skin/Blue-%{V_skin_blue}.tar.bz2
  50. Source4: http://www.live555.com/liveMedia/public/live.%{V_extension_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, aalib
  58. PreReq: zlib, libiconv, sdl, freetype, jpeg, png, vorbis-libs, lzo, libsmbclient, aalib
  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://ftp2.mplayerhq.hu/MPlayer/releases/
  75. regex = MPlayer-(__VER__)\.tar\.bz2
  76. }
  77. prog mplayer:codecs_essential = {
  78. version = %{V_codecs_essential}
  79. url = ftp://ftp2.mplayerhq.hu/MPlayer/releases/codecs/
  80. regex = windows-essential-(__VER__)\.zip
  81. }
  82. prog mplayer:skin_blue = {
  83. version = %{V_skin_blue}
  84. url = ftp://ftp2.mplayerhq.hu/MPlayer/Skin/
  85. regex = Blue-(__VER__)\.tar\.bz2
  86. }
  87. prog mplayer:extension_live = {
  88. version = %{V_extension_live}
  89. url = http://www.live555.com/liveMedia/public/
  90. regex = live\.(200\d\.\d+\.\d+)\.tar\.gz
  91. }
  92. %prep
  93. %setup -q -n MPlayer-%{V_mplayer}
  94. %setup -q -n MPlayer-%{V_mplayer} -T -D -a 4
  95. %patch -p0
  96. %{l_shtool} subst \
  97. -e 's; *-I/usr/local/include/*[a-zA-Z0-9{},/ ]*;;g' \
  98. -e 's; */usr/local/include/*[a-zA-Z0-9{},/ ]*;;g' \
  99. -e 's; *-L/usr/local/lib/*[a-zA-Z0-9{},/ ]*;;g' \
  100. -e 's; */usr/local/lib/*[a-zA-Z0-9{},/ ]*;;g' \
  101. -e 's; */usr/local/*[a-zA-Z0-9{},/ ]*;;g' \
  102. configure
  103. %{l_shtool} subst \
  104. -e 's;u_int\([0-9]*\)_t;uint\1_t;g' \
  105. drivers/radeon/radeonfb.c \
  106. loader/module.c \
  107. loader/wrapper.h \
  108. libmpdvdkit2/bsdi_ioctl.c \
  109. libdha/sysdep/AsmMacros_alpha.h \
  110. live/groupsock/*.cpp \
  111. live/groupsock/include/*.h \
  112. live/groupsock/include/*.hh \
  113. live/liveMedia/*.cpp \
  114. live/liveMedia/*.hh \
  115. live/liveMedia/include/*.hh
  116. %build
  117. # translate target names into qmake system types
  118. case "%{l_platform -t}" in
  119. *-sunos* ) host=solaris ;;
  120. *-linux* ) host=linux ;;
  121. *-freebsd* ) host=freebsd ;;
  122. * ) host=`uname | tr A-Z a-z` ;;
  123. esac
  124. # build live streaming libs first
  125. ( cd live
  126. ./genMakefiles $host
  127. %{l_make} %{l_mflags}
  128. ) || exit $?
  129. # configure programs
  130. CC="%{l_cc}" \
  131. CXX="%{l_cxx}" \
  132. CFLAGS="%{l_cflags -O}" \
  133. CXXFLAGS="%{l_cxxflags -O} -Wno-deprecated" \
  134. CPPFLAGS="%{l_cppflags lzo .}" \
  135. LDFLAGS="%{l_ldflags}" \
  136. _ld_aa=`%{l_prefix}/bin/aalib-config --libs` \
  137. ./configure \
  138. --prefix=%{l_prefix} \
  139. --confdir=%{l_prefix}/etc/mplayer/ \
  140. --with-codecsdir=%{l_prefix}/libexec/mplayer/codecs/ \
  141. %if "%{with_gui}" == "yes"
  142. --enable-gui \
  143. --with-glib-config=%{l_prefix}/bin/glib-config \
  144. --with-gtk-config=%{l_prefix}/bin/gtk-config \
  145. %else
  146. --disable-gui \
  147. %endif
  148. %if "%{with_win32}" == "yes"
  149. --with-win32libdir=%{l_prefix}/libexec/mplayer/codecs/win32 \
  150. --enable-win32 \
  151. --enable-qtx \
  152. %else
  153. --disable-win32 \
  154. %endif
  155. --disable-gcc-checking \
  156. --enable-largefiles \
  157. --enable-live \
  158. --with-livelibdir=`pwd`/live \
  159. --enable-xvid \
  160. --enable-freetype \
  161. --enable-vorbis \
  162. --enable-menu \
  163. --enable-jpeg \
  164. --enable-png \
  165. --enable-sdl \
  166. --enable-liblzo \
  167. --enable-x11 \
  168. --enable-smb \
  169. --enable-aa \
  170. --with-x11incdir=`%{l_rc} --query x11_incdir` \
  171. --with-x11libdir=`%{l_rc} --query x11_libdir` \
  172. --with-extraincdir=%{l_prefix}/include/:%{l_prefix}/include/lzo \
  173. --with-extralibdir=%{l_prefix}/lib/ \
  174. --with-sdl-config=%{l_prefix}/bin/sdl-config \
  175. --with-freetype-config=%{l_prefix}/bin/freetype-config \
  176. --disable-lirc \
  177. --disable-lircc \
  178. --disable-i18n
  179. # fix sloppy library defs for selected platforms
  180. ARCH_LIB=`grep '^ARCH_LIB' config.mak | \
  181. sed -e 's;^ARCH_LIB[ \t]*=[ \t]*\(.*\);\1;'`
  182. case "%{l_platform -t}" in
  183. *-sunos* )
  184. if echo $ARCH_LIB | grep '\-pthread[^s]'; then
  185. ARCH_LIB=`grep '^ARCH_LIB' config.mak | \
  186. sed -e 's;^ARCH_LIB[ \t]*=[ \t]*\(.*\)-pthread[^s]\(.*\);\1 -pthreads \2 -ldl -lrt;'`
  187. fi
  188. ;;
  189. esac
  190. # temporary hack to fool faad dependencies
  191. %{l_shtool} subst \
  192. -e 's;#define FAADVERSION[ \t]*$;#define FAADVERSION 20;g' \
  193. config.h
  194. # build programs
  195. %{l_make} %{l_mflags}
  196. %install
  197. rm -rf $RPM_BUILD_ROOT
  198. # create installation tree
  199. %{l_shtool} mkdir -f -p -m 755 \
  200. $RPM_BUILD_ROOT%{l_prefix}/bin \
  201. $RPM_BUILD_ROOT%{l_prefix}/etc/mplayer \
  202. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  203. %if "%{with_gui}" == "yes"
  204. $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/Skin \
  205. %endif
  206. $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/font \
  207. $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer/codecs
  208. # install binaries
  209. %{l_shtool} install -s -c -m 755 \
  210. mplayer \
  211. mencoder \
  212. $RPM_BUILD_ROOT%{l_prefix}/bin/
  213. %if "%{with_gui}" == "yes"
  214. %{l_shtool} mkln -s -f \
  215. $RPM_BUILD_ROOT%{l_prefix}/bin/mplayer \
  216. $RPM_BUILD_ROOT%{l_prefix}/bin/gmplayer
  217. %endif
  218. # install manpages
  219. %{l_shtool} install -c -m 644 \
  220. DOCS/man/en/mplayer.1 \
  221. $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  222. %{l_shtool} mkln -s -f \
  223. $RPM_BUILD_ROOT%{l_prefix}/man/man1/mplayer.1 \
  224. $RPM_BUILD_ROOT%{l_prefix}/man/man1/mencoder.1
  225. # install configuration files
  226. %{l_shtool} install -c -m 644 \
  227. -e 's;^\([a-z]\);# \1;' \
  228. etc/example.conf \
  229. $RPM_BUILD_ROOT%{l_prefix}/etc/mplayer/mplayer.conf
  230. %{l_shtool} install -c -m 644 \
  231. etc/codecs.conf etc/input.conf etc/menu.conf \
  232. $RPM_BUILD_ROOT%{l_prefix}/etc/mplayer/
  233. %if "%{with_gui}" == "yes"
  234. # install a default skin
  235. ( cd $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/Skin
  236. %{l_bzip2} -dc %{SOURCE Blue-%{V_skin_blue}.tar.bz2} | %{l_tar} -xvf -
  237. %{l_shtool} mkln -s -f Blue default
  238. ) || exit $?
  239. %endif
  240. # install fonts for OSD and subtitles
  241. %{l_bzip2} -dc %{SOURCE font-arial-iso-8859-1.tar.bz2} | %{l_tar} -xvf -
  242. cp font-arial-iso-8859-1/font-arial-24-iso-8859-1/* \
  243. $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/font/
  244. %if "%{with_win32}" == "yes"
  245. # install win32 and quicktime codecs
  246. ( %{l_shtool} mkdir -p -m 755 \
  247. $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer/codecs
  248. cd $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer/codecs
  249. %{l_prefix}/bin/unzip -x %{SOURCE windows-essential-%{V_codecs_essential}.zip}
  250. mv windows-essential-%{V_codecs_essential} win32
  251. ) || exit $?
  252. %endif
  253. # determine installation files
  254. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  255. '%config %{l_prefix}/etc/mplayer/*'
  256. %files -f files
  257. %clean
  258. rm -rf $RPM_BUILD_ROOT