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

imake.bat 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. @echo off
  2. :--- Pull content submodule ---
  3. cd content
  4. git commit -a -m labojumi
  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\xtv.py
  72. content\sources\serialguru.py
  73. content\sources\tvdom.py
  74. content\sources\ustvnow.py
  75. content\sources\viaplay.py
  76. content\sources\filmas.py
  77. content\sources\tvplay.py
  78. content\sources\YouTubeVideoUrl.py
  79. content\sources\jsinterp.py
  80. content\sources\swfinterp.py
  81. content\sources\streams.cfg
  82. content\resolvers\__init__.py
  83. content\resolvers\aadecode.py
  84. content\resolvers\hqqresolver.py
  85. content\resolvers\openload3.py
  86. content\resolvers\hdgo.py
  87. content\resolvers\kapnob.py
  88. content\resolvers\kodik.py
  89. content\resolvers\cloudsany.py
  90. content\resolvers\youtuberesolver.py
  91. locale\*.*
  92. ) do echo f | xcopy /y /q %%f %ipk_dir%data\%ext_dir%%prog%\%%f
  93. xcopy /y /q content\picons\* %ipk_dir%data\%ext_dir%%prog%\picons\
  94. xcopy /y /q playstreamproxy %ipk_dir%data\etc\init.d\
  95. :=== control file ===
  96. mkdir %ipk_dir%CONTROL\
  97. rem xcopy /v /d /y control %ipk_dir%CONTROL\
  98. echo 2.0 >%ipk_dir%debian-binary
  99. (
  100. echo Version: %ver%
  101. echo Package: %pack_name%
  102. echo Description: %desc%
  103. echo Architecture: all
  104. echo Section:
  105. echo Priority: optional
  106. echo Maintainer: ivars777@gmail.com
  107. echo Homepage:
  108. echo Depends: python-json,python-twisted-web,python-simplejson,python-html,python-zlib,python-requests
  109. echo Source:
  110. ) >%ipk_dir%CONTROL\control
  111. dos2unix %ipk_dir%CONTROL\control
  112. :=== preinst file ===
  113. (
  114. echo #!/bin/sh
  115. echo if [ -d %ext_dir2%%prog%/sources ]; then
  116. echo rm -rf %ext_dir2%%prog%/*.pyo ^> /dev/null 2^>^&1
  117. echo rm -rf %ext_dir2%%prog%/resolvers ^> /dev/null 2^>^&1
  118. echo mkdir %ext_dir2%%prog%/content
  119. echo mkdir %ext_dir2%%prog%/content/sources
  120. echo mv %ext_dir2%%prog%/sources/streams.cfg %ext_dir2%%prog%/content/sources/streams.cfg.old
  121. echo mv %ext_dir2%%prog%/sources/*.cfg %ext_dir2%%prog%/content/sources/
  122. echo rm -rf %ext_dir2%%prog%/sources ^> /dev/null 2^>^&1
  123. echo fi
  124. echo if [ -e /etc/init.d/playstreamproxy ]; then
  125. echo rm /etc/init.d/playstreamproxy ^> /dev/null 2^>^&1
  126. echo fi
  127. echo exit 0
  128. ) >%ipk_dir%CONTROL\preinst
  129. dos2unix %ipk_dir%CONTROL\preinst
  130. :=== postinst file ===
  131. (
  132. echo #!/bin/sh
  133. echo chmod +x /etc/init.d/playstreamproxy
  134. echo ln -s /etc/init.d/playstreamproxy /etc/rc4.d/S50playstreamproxy
  135. echo ln -s /etc/init.d/playstreamproxy /etc/rc3.d/S50playstreamproxy
  136. echo ln -s /etc/init.d/playstreamproxy /usr/bin/playstreamproxy
  137. echo rm -rf %ext_dir2%%prog%/*.pyo ^> /dev/null 2^>^&1
  138. echo rm -rf %ext_dir2%%prog%/content/sources/*.pyo ^> /dev/null 2^>^&1
  139. echo rm -rf %ext_dir2%%prog%/content/resolvers/*.pyo ^> /dev/null 2^>^&1
  140. echo exit 0
  141. ) >%ipk_dir%CONTROL\postinst
  142. dos2unix %ipk_dir%CONTROL\postinst
  143. :=== postrm file ===
  144. (
  145. echo #!/bin/sh
  146. rem echo if [ -e /etc/rc4.d/S50playstreamproxy ]; then
  147. echo rm /etc/rc4.d/S50playstreamproxy ^> /dev/null 2^>^&1
  148. rem echo fi
  149. echo #!/bin/sh
  150. rem echo if [ -e /etc/rc3.d/S50playstreamproxy ]; then
  151. echo rm /etc/rc3.d/S50playstreamproxy ^> /dev/null 2^>^&1
  152. rem echo fi
  153. rem echo if [ -e /usr/bin/playstreamproxyy ]; then
  154. echo rm /usr/bin/playstreamproxy ^> /dev/null 2^>^&1
  155. rem echo fi
  156. echo if [ -e /etc/init.d/playstreamproxy ]; then
  157. echo rm /etc/init.d/playstreamproxy ^> /dev/null 2^>^&1
  158. echo fi
  159. echo exit 0
  160. ) >%ipk_dir%CONTROL\postrm
  161. dos2unix %ipk_dir%CONTROL\postrm
  162. :=== conffiles file ===
  163. rem (
  164. rem echo %ext_dir2%%prog%/content/sources/streams.cfg
  165. rem ) >%ipk_dir%CONTROL\conffiles
  166. rem dos2unix %ipk_dir%CONTROL\conffiles
  167. :=== create ipk file ===
  168. if not exist %release_dir% mkdir %release_dir%
  169. %TAR% -C ipkg\data --mode=777 -czf ipkg\data.tar.gz .
  170. %TAR% -C ipkg\CONTROL --mode=777 -czf ipkg\control.tar.gz .
  171. if exist %release_dir%%pack_name%_%ver%.ipk del %release_dir%%pack_name%_%ver%.ipk
  172. %AR% -r %release_dir%%pack_name%_%ver% ipkg\debian-binary ipkg\data.tar.gz ipkg\control.tar.gz
  173. @echo on
  174. mv %release_dir%%pack_name%_%ver% %release_dir%%pack_name%_%ver%.ipk
  175. git add %release_dir%%pack_name%_%ver%.ipk
  176. :=== Commit/push and copy to feed if message given ===
  177. if not ()==(%1%) (
  178. git commit -m "%ver%"
  179. git tag -d "%ver%"
  180. git tag "%ver%"
  181. git push origin master
  182. copy %release_dir%%pack_name%_%ver%.ipk %feed_dir%%pack_name%_%ver%.ipk
  183. pushd %feed_dir%
  184. python c:\Python27\Scripts\opkg-make-index . >Packages
  185. dos2unix Packages
  186. gzip -f -k Packages
  187. popd
  188. )