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

imake.bat 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. @echo off
  2. :=== Parameters ===
  3. if ()==(%1%) (
  4. python get_version.py PlayStream.py >version.txt
  5. set /p ver=<version.txt
  6. echo Version: %ver%
  7. ) else (
  8. set ver=%1
  9. )
  10. pause
  11. set prog=PlayStream
  12. set pack_name=enigma2-plugin-extensions-playstream
  13. set desc=Play online streams from various sources, mostly Latvian
  14. set ext_dir=usr\lib\enigma2\python\Plugins\Extensions\
  15. set ext_dir2=/usr/lib/enigma2/python/Plugins/Extensions/
  16. set script_dir=usr\script\
  17. set ipk_dir=ipkg\
  18. set release_dir=release\
  19. set feed_dir=w:\feed\
  20. set AR=\MinGW\bin\ar.exe
  21. set TAR=\MinGW\msys\1.0\bin\tar.exe
  22. :=== data files ===
  23. if exist %ipk_dir% rm -r -f %ipk_dir%
  24. mkdir %ipk_dir%
  25. for %%f in (
  26. readme.md
  27. changelog.md
  28. __init__.py
  29. plugin.py
  30. plugin_locale.py
  31. plugin.png
  32. skin.xml
  33. %prog%.py
  34. %prog%.png
  35. ContentSources.py
  36. VideoDownload.py
  37. enigma2_api.py
  38. resolver.py
  39. util.py
  40. playstreamproxy.py
  41. offline.mp4
  42. demjson.py
  43. locale\*.*
  44. sources\__init__.py
  45. sources\SourceBase.py
  46. sources\cinemalive.py
  47. sources\config.py
  48. sources\euronews.py
  49. sources\filmix.py
  50. sources\filmon.py
  51. sources\iplayer.py
  52. sources\kinofilmnet.py
  53. sources\movieplace.py
  54. sources\ltc.py
  55. sources\mtgplay.py
  56. sources\play24.py
  57. sources\replay.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. copy %release_dir%%pack_name%_%ver%.ipk %feed_dir%%pack_name%_%ver%.ipk
  152. pushd %feed_dir%
  153. python c:\Python27\Scripts\opkg-make-index . >Packages
  154. dos2unix Packages
  155. gzip -f -k Packages
  156. popd