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

imake.bat 4.3KB

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