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

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