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

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