Enigma2 plugin to to play various online streams (mostly Latvian).

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. @echo off
  2. :--- Pull content submodule ---
  3. cd content
  4. git commit -a -m a
  5. git checkout .
  6. git pull
  7. cd ..
  8. :=== Parameters ===
  9. :--- Extract version number ---
  10. python get_version.py PlayStream.py >version.txt
  11. cat version.txt
  12. rem pause
  13. set /p ver=<version.txt
  14. echo Version: %ver%
  15. pause
  16. :--- Set variables ---
  17. set prog=PlayStream
  18. set pack_name=enigma2-plugin-extensions-playstream
  19. set desc=Play online streams from various sources, mostly Latvian
  20. set ext_dir=usr\lib\enigma2\python\Plugins\Extensions\
  21. set ext_dir2=/usr/lib/enigma2/python/Plugins/Extensions/
  22. set script_dir=usr\script\
  23. set ipk_dir=ipkg\
  24. set release_dir=release\
  25. set feed_dir=q:\web\feed\
  26. set AR=\MinGW\bin\ar.exe
  27. set TAR=\MinGW\msys\1.0\bin\tar.exe
  28. :=== Create data files ===
  29. if exist %ipk_dir% rm -r -f %ipk_dir%
  30. mkdir %ipk_dir%
  31. for %%f in (
  32. readme.md
  33. changelog.md
  34. __init__.py
  35. plugin.py
  36. plugin_locale.py
  37. plugin.png
  38. skin.xml
  39. %prog%.py
  40. %prog%.png
  41. key_menu.png
  42. key_exit.png
  43. VideoDownload.py
  44. enigma2_api.py
  45. content\__init__.py
  46. content\ContentSources.py
  47. content\Downloader.py
  48. content\resolver.py
  49. content\util.py
  50. content\file.py
  51. content\icon.gif
  52. content\run.py
  53. content\playstreamproxy.py
  54. content\offline.mp4
  55. content\demjson.py
  56. content\sources\__init__.py
  57. content\sources\SourceBase.py
  58. content\sources\cinemalive.py
  59. content\sources\config.py
  60. content\sources\euronews.py
  61. content\sources\filmix.py
  62. content\sources\filmon.py
  63. content\sources\iplayer.py
  64. content\sources\kinofilmnet.py
  65. content\sources\movieplace.py
  66. content\sources\ltc.py
  67. content\sources\mtgplay.py
  68. content\sources\play24.py
  69. content\sources\replay.py
  70. content\sources\lmt.py
  71. content\sources\serialguru.py
  72. content\sources\tvdom.py
  73. content\sources\ustvnow.py
  74. content\sources\viaplay.py
  75. content\sources\filmas.py
  76. content\sources\tvplay.py
  77. content\sources\YouTubeVideoUrl.py
  78. content\sources\jsinterp.py
  79. content\sources\swfinterp.py
  80. content\sources\streams.cfg
  81. content\resolvers\__init__.py
  82. content\resolvers\aadecode.py
  83. content\resolvers\hqqresolver.py
  84. content\resolvers\openload3.py
  85. content\resolvers\hdgo.py
  86. content\resolvers\kapnob.py
  87. content\resolvers\kodik.py
  88. content\resolvers\cloudsany.py
  89. content\resolvers\youtuberesolver.py
  90. locale\*.*
  91. ) do echo f | xcopy /y /q %%f %ipk_dir%data\%ext_dir%%prog%\%%f
  92. xcopy /y /q content\picons\* %ipk_dir%data\%ext_dir%%prog%\picons\
  93. xcopy /y /q playstreamproxy %ipk_dir%data\etc\init.d\
  94. :=== control file ===
  95. mkdir %ipk_dir%CONTROL\
  96. rem xcopy /v /d /y control %ipk_dir%CONTROL\
  97. echo 2.0 >%ipk_dir%debian-binary
  98. (
  99. echo Version: %ver%
  100. echo Package: %pack_name%
  101. echo Description: %desc%
  102. echo Architecture: all
  103. echo Section:
  104. echo Priority: optional
  105. echo Maintainer: ivars777@gmail.com
  106. echo Homepage:
  107. echo Depends: python-json,python-twisted-web,python-simplejson,python-html,python-zlib,python-requests
  108. echo Source:
  109. ) >%ipk_dir%CONTROL\control
  110. dos2unix %ipk_dir%CONTROL\control
  111. :=== preinst file ===
  112. (
  113. echo #!/bin/sh
  114. echo if [ -d %ext_dir2%%prog%/sources ]; then
  115. echo rm -rf %ext_dir2%%prog%/*.pyo ^> /dev/null 2^>^&1
  116. echo rm -rf %ext_dir2%%prog%/resolvers ^> /dev/null 2^>^&1
  117. echo mkdir %ext_dir2%%prog%/content
  118. echo mkdir %ext_dir2%%prog%/content/sources
  119. echo mv %ext_dir2%%prog%/sources/streams.cfg %ext_dir2%%prog%/content/sources/streams.cfg.old
  120. echo mv %ext_dir2%%prog%/sources/*.cfg %ext_dir2%%prog%/content/sources/
  121. echo rm -rf %ext_dir2%%prog%/sources ^> /dev/null 2^>^&1
  122. echo fi
  123. echo if [ -e /etc/init.d/playstreamproxy ]; then
  124. echo rm /etc/init.d/playstreamproxy ^> /dev/null 2^>^&1
  125. echo fi
  126. echo exit 0
  127. ) >%ipk_dir%CONTROL\preinst
  128. dos2unix %ipk_dir%CONTROL\preinst
  129. :=== postinst file ===
  130. (
  131. echo #!/bin/sh
  132. echo chmod +x /etc/init.d/playstreamproxy
  133. echo ln -s /etc/init.d/playstreamproxy /etc/rc4.d/S50playstreamproxy
  134. echo ln -s /etc/init.d/playstreamproxy /etc/rc3.d/S50playstreamproxy
  135. echo ln -s /etc/init.d/playstreamproxy /usr/bin/playstreamproxy
  136. echo rm -rf %ext_dir2%%prog%/*.pyo ^> /dev/null 2^>^&1
  137. echo rm -rf %ext_dir2%%prog%/content/sources/*.pyo ^> /dev/null 2^>^&1
  138. echo rm -rf %ext_dir2%%prog%/content/resolvers/*.pyo ^> /dev/null 2^>^&1
  139. echo exit 0
  140. ) >%ipk_dir%CONTROL\postinst
  141. dos2unix %ipk_dir%CONTROL\postinst
  142. :=== postrm file ===
  143. (
  144. echo #!/bin/sh
  145. rem echo if [ -e /etc/rc4.d/S50playstreamproxy ]; then
  146. echo rm /etc/rc4.d/S50playstreamproxy ^> /dev/null 2^>^&1
  147. rem echo fi
  148. echo #!/bin/sh
  149. rem echo if [ -e /etc/rc3.d/S50playstreamproxy ]; then
  150. echo rm /etc/rc3.d/S50playstreamproxy ^> /dev/null 2^>^&1
  151. rem echo fi
  152. rem echo if [ -e /usr/bin/playstreamproxyy ]; then
  153. echo rm /usr/bin/playstreamproxy ^> /dev/null 2^>^&1
  154. rem echo fi
  155. echo if [ -e /etc/init.d/playstreamproxy ]; then
  156. echo rm /etc/init.d/playstreamproxy ^> /dev/null 2^>^&1
  157. echo fi
  158. echo exit 0
  159. ) >%ipk_dir%CONTROL\postrm
  160. dos2unix %ipk_dir%CONTROL\postrm
  161. :=== conffiles file ===
  162. rem (
  163. rem echo %ext_dir2%%prog%/content/sources/streams.cfg
  164. rem ) >%ipk_dir%CONTROL\conffiles
  165. rem dos2unix %ipk_dir%CONTROL\conffiles
  166. :=== create ipk file ===
  167. if not exist %release_dir% mkdir %release_dir%
  168. %TAR% -C ipkg\data --mode=777 -czf ipkg\data.tar.gz .
  169. %TAR% -C ipkg\CONTROL --mode=777 -czf ipkg\control.tar.gz .
  170. if exist %release_dir%%pack_name%_%ver%.ipk del %release_dir%%pack_name%_%ver%.ipk
  171. %AR% -r %release_dir%%pack_name%_%ver% ipkg\debian-binary ipkg\data.tar.gz ipkg\control.tar.gz
  172. @echo on
  173. mv %release_dir%%pack_name%_%ver% %release_dir%%pack_name%_%ver%.ipk
  174. git add %release_dir%%pack_name%_%ver%.ipk
  175. :=== Commit/push and copy to feed if message given ===
  176. if not ()==(%1%) (
  177. git commit -m "%1%"
  178. git tag -d "%ver%"
  179. git tag "%ver%"
  180. git push origin master
  181. copy %release_dir%%pack_name%_%ver%.ipk %feed_dir%%pack_name%_%ver%.ipk
  182. pushd %feed_dir%
  183. python c:\Python27\Scripts\opkg-make-index . >Packages
  184. dos2unix Packages
  185. gzip -f -k Packages
  186. popd
  187. )