mplayer.spec 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. ##
  2. ## mplayer.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2007 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.0pre8
  26. %define V_codecs_essential 20061022
  27. %define V_codecs_quicktime 20040704
  28. %define V_skin_blue 1.7
  29. %define V_skin_dvdplayer 1.1
  30. %define V_skin_industrial 1.0
  31. %define V_skin_osxbrushed 2.3
  32. %define V_skin_orange 1.3
  33. %define V_skin_powerplayer 1.1
  34. %define V_skin_proton 1.2
  35. %define V_extension_live 2007.08.03a
  36. # package information
  37. Name: mplayer
  38. Summary: Multimedia Player
  39. URL: http://www.mplayerhq.hu/
  40. Vendor: Árpád Gereöffy et al.
  41. Packager: OpenPKG Foundation e.V.
  42. Distribution: OpenPKG Community
  43. Class: EVAL
  44. Group: Video
  45. License: GPL and others
  46. Version: %{V_mplayer}
  47. Release: 20070807
  48. # build options
  49. %option with_gui yes
  50. %option with_win32 yes
  51. # list of sources
  52. Source0: ftp://ftp2.mplayerhq.hu/MPlayer/releases/MPlayer-%{V_mplayer}.tar.bz2
  53. Source1: ftp://ftp2.mplayerhq.hu/MPlayer/releases/codecs/windows-essential-%{V_codecs_essential}.zip
  54. Source2: ftp://ftp2.mplayerhq.hu/MPlayer/releases/fonts/font-arial-iso-8859-1.tar.bz2
  55. Source3: ftp://ftp2.mplayerhq.hu/MPlayer/Skin/Blue-%{V_skin_blue}.tar.bz2
  56. Source4: ftp://ftp2.mplayerhq.hu/MPlayer/Skin/DVDPlayer-%{V_skin_dvdplayer}.tar.bz2
  57. Source5: ftp://ftp2.mplayerhq.hu/MPlayer/Skin/Industrial-%{V_skin_industrial}.tar.bz2
  58. Source6: ftp://ftp2.mplayerhq.hu/MPlayer/Skin/OSX-Brushed-%{V_skin_osxbrushed}.tar.bz2
  59. Source7: ftp://ftp2.mplayerhq.hu/MPlayer/Skin/Orange-%{V_skin_orange}.tar.bz2
  60. Source8: ftp://ftp2.mplayerhq.hu/MPlayer/Skin/PowerPlayer-%{V_skin_powerplayer}.tar.bz2
  61. Source9: ftp://ftp2.mplayerhq.hu/MPlayer/Skin/proton-%{V_skin_proton}.tar.bz2
  62. Source10: http://www.live555.com/liveMedia/public/live.%{V_extension_live}.tar.gz
  63. Patch0: mplayer.patch
  64. # build information
  65. Prefix: %{l_prefix}
  66. BuildRoot: %{l_buildroot}
  67. BuildPreReq: OpenPKG, openpkg >= 20040130, X11, gcc3, make, sed
  68. PreReq: OpenPKG, openpkg >= 20040130, X11
  69. BuildPreReq: zlib, libiconv, sdl, freetype, jpeg, png
  70. PreReq: zlib, libiconv, sdl, freetype, jpeg, png
  71. BuildPreReq: lame, vorbis-libs, lzo, libsmbclient, aalib
  72. PreReq: lame, vorbis-libs, lzo, libsmbclient, aalib
  73. %if "%{with_gui}" == "yes"
  74. BuildPreReq: glib, gtk
  75. PreReq: glib, gtk
  76. %endif
  77. AutoReq: no
  78. AutoReqProv: no
  79. %description
  80. This is the Unix movie player. MPlayer can play most standard
  81. video formats out of the box and almost all others with the help
  82. of external codecs. MPlayer works best from the command line, but
  83. visual feedback for many functions is available from its onscreen
  84. status display (OSD), which is also used for displaying subtitles.
  85. %track
  86. prog mplayer = {
  87. version = %{V_mplayer}
  88. url = ftp://ftp2.mplayerhq.hu/MPlayer/releases/
  89. regex = MPlayer-(__VER__)\.tar\.bz2
  90. }
  91. prog mplayer:codecs_essential = {
  92. version = %{V_codecs_essential}
  93. url = ftp://ftp2.mplayerhq.hu/MPlayer/releases/codecs/
  94. regex = windows-essential-(__VER__)\.zip
  95. }
  96. prog mplayer:skin_blue = {
  97. version = %{V_skin_blue}
  98. url = ftp://ftp2.mplayerhq.hu/MPlayer/Skin/
  99. regex = Blue-(__VER__)\.tar\.bz2
  100. }
  101. prog mplayer:skin_dvdplayer = {
  102. version = %{V_skin_dvdplayer}
  103. url = ftp://ftp2.mplayerhq.hu/MPlayer/Skin/
  104. regex = DVDPlayer-(__VER__)\.tar\.bz2
  105. }
  106. prog mplayer:skin_industrial = {
  107. version = %{V_skin_industrial}
  108. url = ftp://ftp2.mplayerhq.hu/MPlayer/Skin/
  109. regex = Industrial-(__VER__)\.tar\.bz2
  110. }
  111. prog mplayer:skin_osxbrushed = {
  112. version = %{V_skin_osxbrushed}
  113. url = ftp://ftp2.mplayerhq.hu/MPlayer/Skin/
  114. regex = OSX-Brushed-(__VER__)\.tar\.bz2
  115. }
  116. prog mplayer:skin_orange = {
  117. version = %{V_skin_orange}
  118. url = ftp://ftp2.mplayerhq.hu/MPlayer/Skin/
  119. regex = Orange-(__VER__)\.tar\.bz2
  120. }
  121. prog mplayer:skin_powerplayer = {
  122. version = %{V_skin_powerplayer}
  123. url = ftp://ftp2.mplayerhq.hu/MPlayer/Skin/
  124. regex = PowerPlayer-(__VER__)\.tar\.bz2
  125. }
  126. prog mplayer:skin_proton = {
  127. version = %{V_skin_proton}
  128. url = ftp://ftp2.mplayerhq.hu/MPlayer/Skin/
  129. regex = proton-(__VER__)\.tar\.bz2
  130. }
  131. prog mplayer:extension_live = {
  132. version = %{V_extension_live}
  133. url = http://www.live555.com/liveMedia/public/
  134. regex = live\.(200\d\.\d+\.\d+[a-z]?)\.tar\.gz
  135. }
  136. %prep
  137. %setup -q -n MPlayer-%{V_mplayer}
  138. %setup -q -n MPlayer-%{V_mplayer} -T -D -a 10
  139. %patch -p0
  140. %{l_shtool} subst \
  141. -e 's; *-I/usr/local/include/*[a-zA-Z0-9{},/ ]*;;g' \
  142. -e 's; */usr/local/include/*[a-zA-Z0-9{},/ ]*;;g' \
  143. -e 's; *-L/usr/local/lib/*[a-zA-Z0-9{},/ ]*;;g' \
  144. -e 's; */usr/local/lib/*[a-zA-Z0-9{},/ ]*;;g' \
  145. -e 's; */usr/local/*[a-zA-Z0-9{},/ ]*;;g' \
  146. configure
  147. %{l_shtool} subst \
  148. -e 's;u_int\([0-9]*\)_t;uint\1_t;g' \
  149. drivers/radeon/radeonfb.c \
  150. loader/module.c \
  151. loader/wrapper.h \
  152. libmpdvdkit2/bsdi_ioctl.c \
  153. libdha/sysdep/AsmMacros_alpha.h \
  154. live/groupsock/*.cpp \
  155. live/groupsock/include/*.h \
  156. live/groupsock/include/*.hh \
  157. live/liveMedia/*.cpp \
  158. live/liveMedia/*.hh \
  159. live/liveMedia/include/*.hh
  160. %build
  161. # translate target names into qmake system types
  162. case "%{l_platform -t}" in
  163. *-sunos* ) host=solaris ;;
  164. *-linux* ) host=linux ;;
  165. *-freebsd* ) host=freebsd ;;
  166. * ) host=`uname | tr A-Z a-z` ;;
  167. esac
  168. # build live streaming libs first
  169. ( cd live
  170. ./genMakefiles $host
  171. %{l_make} %{l_mflags}
  172. ) || exit $?
  173. # configure programs
  174. CC="%{l_prefix}/bin/gcc3" \
  175. CXX="%{l_prefix}/bin/g++3" \
  176. CFLAGS="%{l_cflags -O}" \
  177. CXXFLAGS="%{l_cxxflags -O} -Wno-deprecated" \
  178. CPPFLAGS="%{l_cppflags lzo .}" \
  179. LDFLAGS="%{l_ldflags}" \
  180. _ld_aa=`%{l_prefix}/bin/aalib-config --libs` \
  181. ./configure </dev/null \
  182. --prefix=%{l_prefix} \
  183. --confdir=%{l_prefix}/etc/mplayer/ \
  184. --with-codecsdir=%{l_prefix}/libexec/mplayer/codecs/ \
  185. %if "%{with_gui}" == "yes"
  186. --enable-gui \
  187. --with-glib-config=%{l_prefix}/bin/glib-config \
  188. --with-gtk-config=%{l_prefix}/bin/gtk-config \
  189. %else
  190. --disable-gui \
  191. %endif
  192. %if "%{with_win32}" == "yes"
  193. --with-win32libdir=%{l_prefix}/libexec/mplayer/codecs/win32 \
  194. --enable-win32 \
  195. --enable-qtx \
  196. %else
  197. --disable-win32 \
  198. %endif
  199. --disable-libavcodec \
  200. --disable-libavformat \
  201. --disable-gcc-checking \
  202. --enable-largefiles \
  203. --enable-live \
  204. --with-livelibdir=`pwd`/live \
  205. --enable-xvid \
  206. --enable-freetype \
  207. --enable-vorbis \
  208. --enable-menu \
  209. --enable-jpeg \
  210. --enable-png \
  211. --enable-sdl \
  212. --enable-liblzo \
  213. --enable-x11 \
  214. --enable-smb \
  215. --enable-aa \
  216. --with-x11incdir=`%{l_rc} --query x11_incdir` \
  217. --with-x11libdir=`%{l_rc} --query x11_libdir` \
  218. --with-extraincdir=%{l_prefix}/include/:%{l_prefix}/include/lzo \
  219. --with-extralibdir=%{l_prefix}/lib/ \
  220. --with-sdl-config=%{l_prefix}/bin/sdl-config \
  221. --with-freetype-config=%{l_prefix}/bin/freetype-config \
  222. --disable-lirc \
  223. --disable-lircc
  224. # fix sloppy library defs for selected platforms
  225. ARCH_LIB=`grep '^ARCH_LIB' config.mak | \
  226. sed -e 's;^ARCH_LIB[ \t]*=[ \t]*\(.*\);\1;'`
  227. case "%{l_platform -t}" in
  228. *-sunos* )
  229. if echo $ARCH_LIB | grep '\-pthread[^s]'; then
  230. ARCH_LIB=`grep '^ARCH_LIB' config.mak | \
  231. sed -e 's;^ARCH_LIB[ \t]*=[ \t]*\(.*\)-pthread[^s]\(.*\);\1 -pthreads \2 -ldl -lrt;'`
  232. fi
  233. ;;
  234. esac
  235. # temporary hack to fool faad dependencies
  236. %{l_shtool} subst \
  237. -e 's;#define FAADVERSION[ \t]*$;#define FAADVERSION 20;g' \
  238. config.h
  239. # build programs
  240. %{l_make} %{l_mflags}
  241. %install
  242. rm -rf $RPM_BUILD_ROOT
  243. # create installation tree
  244. %{l_shtool} mkdir -f -p -m 755 \
  245. $RPM_BUILD_ROOT%{l_prefix}/bin \
  246. $RPM_BUILD_ROOT%{l_prefix}/etc/mplayer \
  247. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  248. %if "%{with_gui}" == "yes"
  249. $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/Skin \
  250. %endif
  251. $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/font \
  252. $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer/codecs
  253. # install binaries
  254. %{l_shtool} install -s -c -m 755 \
  255. mplayer \
  256. mencoder \
  257. $RPM_BUILD_ROOT%{l_prefix}/bin/
  258. %if "%{with_gui}" == "yes"
  259. %{l_shtool} mkln -s -f \
  260. $RPM_BUILD_ROOT%{l_prefix}/bin/mplayer \
  261. $RPM_BUILD_ROOT%{l_prefix}/bin/gmplayer
  262. %endif
  263. # install manpages
  264. %{l_shtool} install -c -m 644 \
  265. DOCS/man/en/mplayer.1 \
  266. $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  267. %{l_shtool} mkln -s -f \
  268. $RPM_BUILD_ROOT%{l_prefix}/man/man1/mplayer.1 \
  269. $RPM_BUILD_ROOT%{l_prefix}/man/man1/mencoder.1
  270. # install configuration files
  271. %{l_shtool} install -c -m 644 \
  272. -e 's;^\([a-z]\);# \1;' \
  273. etc/example.conf \
  274. $RPM_BUILD_ROOT%{l_prefix}/etc/mplayer/mplayer.conf
  275. %{l_shtool} install -c -m 644 \
  276. etc/codecs.conf etc/input.conf etc/menu.conf \
  277. $RPM_BUILD_ROOT%{l_prefix}/etc/mplayer/
  278. %if "%{with_gui}" == "yes"
  279. # install a default skin and several others
  280. ( cd $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/Skin
  281. %{l_bzip2} -dc %{SOURCE Blue-%{V_skin_blue}.tar.bz2} | %{l_tar} -xvf -
  282. %{l_bzip2} -dc %{SOURCE DVDPlayer-%{V_skin_dvdplayer}.tar.bz2} | %{l_tar} -xvf -
  283. %{l_bzip2} -dc %{SOURCE Industrial-%{V_skin_industrial}.tar.bz2} | %{l_tar} -xvf -
  284. %{l_bzip2} -dc %{SOURCE OSX-Brushed-%{V_skin_osxbrushed}.tar.bz2} | %{l_tar} -xvf -
  285. %{l_bzip2} -dc %{SOURCE Orange-%{V_skin_orange}.tar.bz2} | %{l_tar} -xvf -
  286. %{l_bzip2} -dc %{SOURCE PowerPlayer-%{V_skin_powerplayer}.tar.bz2} | %{l_tar} -xvf -
  287. %{l_bzip2} -dc %{SOURCE proton-%{V_skin_proton}.tar.bz2} | %{l_tar} -xvf -
  288. %{l_shtool} mkln -s -f Blue default
  289. ) || exit $?
  290. %endif
  291. # install fonts for OSD and subtitles
  292. %{l_bzip2} -dc %{SOURCE font-arial-iso-8859-1.tar.bz2} | %{l_tar} -xvf -
  293. cp font-arial-iso-8859-1/font-arial-24-iso-8859-1/* \
  294. $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/font/
  295. %if "%{with_win32}" == "yes"
  296. # install win32 and quicktime codecs
  297. ( %{l_shtool} mkdir -p -m 755 \
  298. $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer/codecs
  299. cd $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer/codecs
  300. %{l_prefix}/bin/unzip -x %{SOURCE windows-essential-%{V_codecs_essential}.zip}
  301. mv windows-essential-%{V_codecs_essential} win32
  302. ) || exit $?
  303. %endif
  304. # determine installation files
  305. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  306. '%config %{l_prefix}/etc/mplayer/*'
  307. %files -f files
  308. %clean
  309. rm -rf $RPM_BUILD_ROOT