dss.spec 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. ##
  2. ## dss.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.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_opkg 4.1.3
  27. %define V_dss 4_1_3
  28. # package information
  29. Name: dss
  30. Summary: Darwin Streaming Server
  31. URL: http://developer.apple.com/darwin/projects/streaming/
  32. Vendor: Apple Computer, Incorporated
  33. Packager: The OpenPKG Project
  34. Distribution: OpenPKG [EVAL]
  35. Group: Video
  36. License: APSL
  37. Version: %{V_opkg}
  38. Release: 20030509
  39. # list of sources
  40. Source0: http://www.opensource.apple.com/projects/streaming/source/DSS-%{V_dss}.src.tar.gz
  41. Source1: rc.dss
  42. %NoSource 0
  43. # build information
  44. Prefix: %{l_prefix}
  45. BuildRoot: %{l_buildroot}
  46. BuildPreReq: OpenPKG, openpkg >= 20030103, perl, make, gcc
  47. PreReq: OpenPKG, openpkg >= 20030103, perl
  48. AutoReq: no
  49. AutoReqProv: no
  50. %description
  51. The Darwin Streaming Server is server technology which allows you
  52. to send streaming QuickTime data to clients across the Internet
  53. using the industry standard RTP and RTSP protocols. It is based on
  54. the same code as Apple's QuickTime Streaming Server.
  55. %prep
  56. %setup -q -n DSS-%{V_dss}.src
  57. %{l_shtool} subst \
  58. -e 's;/etc/streaming/;%{l_prefix}/etc/dss/;' \
  59. -e 's;/etc/\(streamingserver.conf\);%{l_prefix}/etc/dss/\1;' \
  60. APIModules/QTSSAccessModule/QTSSAccessModule.cpp \
  61. APIModules/QTSSDemoAuthorizationModule.bproj/QTSSDemoModule.cpp \
  62. APIModules/QTSSReflectorModule/QTSSRelayModule.cpp \
  63. MP3Broadcaster/MP3Broadcaster.cpp \
  64. Server.tproj/main.cpp \
  65. StreamingProxy.tproj/proxy_unix.c \
  66. WebAdmin/src/streamingadminserver.pl \
  67. WebAdmin/streamingadminserver_Darwin.conf
  68. %build
  69. # standard OpenPKG build variables
  70. CC="%{l_cc}"
  71. CXX="%{l_cxx}"
  72. CFLAGS="%{l_cflags -O}"
  73. CXXFLAGS="%{l_cxxflags -O}"
  74. CPPFLAGS="%{l_cppflags}"
  75. LDFLAGS="%{l_ldflags}"
  76. export CC CXX CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
  77. # special Darwin build variables
  78. CPLUS="g++"
  79. CCOMP="gcc"
  80. LINKER="g++"
  81. MAKE="%{l_make}"
  82. INCLUDE_FLAG="-include"
  83. export CPLUS CCOMP LINKER MAKE INCLUDE_FLAG
  84. case "%{l_target}" in
  85. *-solaris* )
  86. COMPILER_FLAGS="-D__solaris__ -D_REENTRANT -L/usr/local/lib -R/usr/local/lib"
  87. CORE_LINK_LIBS="-lpthread -ldl -lsocket -lnsl -lresolv -lm -lcrypt -lstdc++"
  88. SHARED=-G
  89. MODULE_LIBS=
  90. ;;
  91. *-freebsd* )
  92. COMPILER_FLAGS=
  93. CORE_LINK_LIBS="-pthread -lm -lcrypt"
  94. SHARED=-shared
  95. MODULE_LIBS="-lgcc -lstdc++"
  96. ;;
  97. *-linux* )
  98. COMPILER_FLAGS="-D_REENTRANT -D__USE_POSIX -D__linux__ -pipe"
  99. CORE_LINK_LIBS="-lpthread -ldl -lm -lcrypt -lstdc++"
  100. SHARED=-shared
  101. MODULE_LIBS=
  102. if [ -f /usr/include/socketbits.h ]; then
  103. NEED_SOCKETBITS=1
  104. export NEED_SOCKETBITS
  105. fi
  106. ;;
  107. * )
  108. COMPILER_FLAGS="-D__linux__"
  109. CORE_LINK_LIBS="-lpthread -ldl -lm -lcrypt"
  110. SHARED=-shared
  111. MODULE_LIBS=
  112. if [ -f /usr/include/socketbits.h ]; then
  113. NEED_SOCKETBITS=1
  114. export NEED_SOCKETBITS
  115. fi
  116. ;;
  117. esac
  118. export COMPILER_FLAGS CORE_LINK_LIBS SHARED MODULE_LIBS
  119. # build the program parts (order important)
  120. for dir in \
  121. CommonUtilitiesLib \
  122. QTFileLib \
  123. . \
  124. APIModules/QTSSDemoAuthorizationModule.bproj \
  125. APIModules/QTSSRawFileModule.bproj \
  126. APIModules/QTSSSpamDefenseModule.bproj \
  127. StreamingProxy.tproj \
  128. qtpasswd.tproj \
  129. PlaylistBroadcaster.tproj \
  130. MP3Broadcaster \
  131. QTFileTools/QTBroadcaster.tproj \
  132. QTFileTools/QTFileInfo.tproj \
  133. QTFileTools/QTFileTest.tproj \
  134. QTFileTools/QTRTPFileTest.tproj \
  135. QTFileTools/QTRTPGen.tproj \
  136. QTFileTools/QTSDPGen.tproj \
  137. QTFileTools/QTSampleLister.tproj \
  138. QTFileTools/QTTrackInfo.tproj; \
  139. do
  140. (cd $dir && %{l_make} %{l_mflags} -f Makefile.POSIX)
  141. done
  142. %install
  143. rm -rf $RPM_BUILD_ROOT
  144. # make directory structure
  145. %{l_shtool} mkdir -f -p -m 755 \
  146. $RPM_BUILD_ROOT%{l_prefix}/bin \
  147. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  148. $RPM_BUILD_ROOT%{l_prefix}/etc/dss \
  149. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  150. $RPM_BUILD_ROOT%{l_prefix}/share/dss/movies \
  151. $RPM_BUILD_ROOT%{l_prefix}/var/dss/logs
  152. # install the server and administrative binaries
  153. %{l_shtool} install -s -c -m 755 \
  154. DarwinStreamingServer $RPM_BUILD_ROOT%{l_prefix}/sbin/
  155. %{l_shtool} install -c -m 755 \
  156. -e 's;#!/usr/bin/perl;#!%{l_prefix}/bin/perl;' \
  157. WebAdmin/src/streamingadminserver.pl $RPM_BUILD_ROOT%{l_prefix}/sbin/
  158. # install miscellaneous binaries
  159. %{l_shtool} install -s -c -m 755 \
  160. PlaylistBroadcaster.tproj/PlaylistBroadcaster \
  161. MP3Broadcaster/MP3Broadcaster \
  162. qtpasswd.tproj/qtpasswd \
  163. $RPM_BUILD_ROOT%{l_prefix}/bin/
  164. # install configuration files
  165. %{l_shtool} install -c -m 644 \
  166. qtusers \
  167. qtgroups \
  168. streamingserver.xml \
  169. relayconfig.xml-Sample \
  170. $RPM_BUILD_ROOT%{l_prefix}/etc/dss/
  171. cp -fp $RPM_BUILD_ROOT%{l_prefix}/etc/dss/streamingserver.xml \
  172. $RPM_BUILD_ROOT%{l_prefix}/etc/dss/streamingserver.xml-sample
  173. # install run commands
  174. %{l_shtool} install -c -m 755 \
  175. -e 's;@l_prefix@;%{l_prefix};g' \
  176. -e 's;@l_susr@;%{l_susr};g' \
  177. %{SOURCE rc.dss} \
  178. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  179. # install sample movies and audio files
  180. %{l_shtool} install -c -m 644 \
  181. sample.mp3 \
  182. sample_100kbit.mov \
  183. sample_300kbit.mov \
  184. sample_100kbit.mp4 \
  185. sample_300kbit.mp4 \
  186. $RPM_BUILD_ROOT%{l_prefix}/share/dss/movies/
  187. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  188. %{l_files_std} \
  189. '%config %{l_prefix}/etc/dss/*' \
  190. '%config %attr(600,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/dss/qtusers' \
  191. '%config %attr(600,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/dss/qtgroups' \
  192. '%config %attr(600,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/dss/streamingserver.xml' \
  193. '%config %attr(600,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/dss/relayconfig.xml-Sample'
  194. %files -f files
  195. %clean
  196. rm -rf $RPM_BUILD_ROOT
  197. %post
  198. # write a default admin username and password to qtusers
  199. username='ghandi'; password='guessit'
  200. $RPM_INSTALL_PREFIX/bin/qtpasswd -p $password $username
  201. # add the new admin username to {l_prefix}/etc/dss/qtgroupsusers
  202. echo admin: $username >$RPM_INSTALL_PREFIX/etc/dss/qtgroups