mplayer.spec 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  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_codecs_essential 20050412
  27. %define V_codecs_quicktime 20040704
  28. %define V_skin_blue 1.4
  29. %define V_extension_live 2005.09.09
  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: 20050910
  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.live.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.live.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. --enable-largefiles \
  156. --enable-live \
  157. --with-livelibdir=`pwd`/live \
  158. --enable-xvid \
  159. --enable-freetype \
  160. --enable-vorbis \
  161. --enable-menu \
  162. --enable-jpeg \
  163. --enable-png \
  164. --enable-sdl \
  165. --enable-liblzo \
  166. --enable-x11 \
  167. --enable-smb \
  168. --enable-aa \
  169. --with-x11incdir=`%{l_rc} --query x11_incdir` \
  170. --with-x11libdir=`%{l_rc} --query x11_libdir` \
  171. --with-extraincdir=%{l_prefix}/include/:%{l_prefix}/include/lzo \
  172. --with-extralibdir=%{l_prefix}/lib/ \
  173. --with-sdl-config=%{l_prefix}/bin/sdl-config \
  174. --with-freetype-config=%{l_prefix}/bin/freetype-config \
  175. --disable-lirc \
  176. --disable-lircc \
  177. --disable-i18n
  178. # fix sloppy library defs for selected platforms
  179. ARCH_LIB=`grep '^ARCH_LIB' config.mak | \
  180. sed -e 's;^ARCH_LIB[ \t]*=[ \t]*\(.*\);\1;'`
  181. case "%{l_platform -t}" in
  182. *-sunos* )
  183. if echo $ARCH_LIB | grep '\-pthread[^s]'; then
  184. ARCH_LIB=`grep '^ARCH_LIB' config.mak | \
  185. sed -e 's;^ARCH_LIB[ \t]*=[ \t]*\(.*\)-pthread[^s]\(.*\);\1 -pthreads \2 -ldl -lrt;'`
  186. fi
  187. ;;
  188. esac
  189. # temporary hack to fool faad dependencies
  190. %{l_shtool} subst \
  191. -e 's;#define FAADVERSION[ \t]*$;#define FAADVERSION 20;g' \
  192. config.h
  193. # build programs
  194. %{l_make} %{l_mflags}
  195. %install
  196. rm -rf $RPM_BUILD_ROOT
  197. # create installation tree
  198. %{l_shtool} mkdir -f -p -m 755 \
  199. $RPM_BUILD_ROOT%{l_prefix}/bin \
  200. $RPM_BUILD_ROOT%{l_prefix}/etc/mplayer \
  201. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  202. %if "%{with_gui}" == "yes"
  203. $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/Skin \
  204. %endif
  205. $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/font \
  206. $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer/codecs
  207. # install binaries
  208. %{l_shtool} install -s -c -m 755 \
  209. mplayer \
  210. mencoder \
  211. $RPM_BUILD_ROOT%{l_prefix}/bin/
  212. %if "%{with_gui}" == "yes"
  213. %{l_shtool} mkln -s -f \
  214. $RPM_BUILD_ROOT%{l_prefix}/bin/mplayer \
  215. $RPM_BUILD_ROOT%{l_prefix}/bin/gmplayer
  216. %endif
  217. # install manpages
  218. %{l_shtool} install -c -m 644 \
  219. DOCS/man/en/mplayer.1 \
  220. $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  221. %{l_shtool} mkln -s -f \
  222. $RPM_BUILD_ROOT%{l_prefix}/man/man1/mplayer.1 \
  223. $RPM_BUILD_ROOT%{l_prefix}/man/man1/mencoder.1
  224. # install configuration files
  225. %{l_shtool} install -c -m 644 \
  226. -e 's;^\([a-z]\);# \1;' \
  227. etc/example.conf \
  228. $RPM_BUILD_ROOT%{l_prefix}/etc/mplayer/mplayer.conf
  229. %{l_shtool} install -c -m 644 \
  230. etc/codecs.conf etc/input.conf etc/menu.conf \
  231. $RPM_BUILD_ROOT%{l_prefix}/etc/mplayer/
  232. %if "%{with_gui}" == "yes"
  233. # install a default skin
  234. ( cd $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/Skin
  235. %{l_bzip2} -dc %{SOURCE Blue-%{V_skin_blue}.tar.bz2} | %{l_tar} -xvf -
  236. %{l_shtool} mkln -s -f Blue default
  237. ) || exit $?
  238. %endif
  239. # install fonts for OSD and subtitles
  240. %{l_bzip2} -dc %{SOURCE font-arial-iso-8859-1.tar.bz2} | %{l_tar} -xvf -
  241. cp font-arial-iso-8859-1/font-arial-24-iso-8859-1/* \
  242. $RPM_BUILD_ROOT%{l_prefix}/share/mplayer/font/
  243. %if "%{with_win32}" == "yes"
  244. # install win32 and quicktime codecs
  245. ( %{l_shtool} mkdir -p -m 755 \
  246. $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer/codecs
  247. cd $RPM_BUILD_ROOT%{l_prefix}/libexec/mplayer/codecs
  248. %{l_prefix}/bin/unzip -x %{SOURCE windows-essential-%{V_codecs_essential}.zip}
  249. mv windows-essential-%{V_codecs_essential} win32
  250. ) || exit $?
  251. %endif
  252. # determine installation files
  253. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  254. '%config %{l_prefix}/etc/mplayer/*'
  255. %files -f files
  256. %clean
  257. rm -rf $RPM_BUILD_ROOT