@echo off :=== Parameters === set ver=0.4c set prog=GetPicons set pack_name=enigma2-plugin-extensions-getpicons set pack_prefix=enigma2-plugin-extensions- set desc=Download/create channels picons from lyngsat.com set ext_dir=usr\lib\enigma2\python\Plugins\Extensions\ set script_dir=usr\script\ set ipk_dir=ipkg\ set release_dir=release\ set feed_dir=q:\web\feed\ set AR=\MinGW\bin\ar.exe set TAR=\MinGW\msys\1.0\bin\tar.exe :=== data files if exist %ipk_dir% rm -r -f %ipk_dir% mkdir %ipk_dir% for %%f in (readme.md,changelog.md,__init__.py,plugin.py,get_picons.py) do xcopy /q /y %%f %ipk_dir%data\%ext_dir%%prog%\ for %%f in (get_picons.sh ) do xcopy /q /y %%f %ipk_dir%data\%script_dir% :=== control file === mkdir %ipk_dir%CONTROL\ rem xcopy /v /d /y control %ipk_dir%CONTROL\ echo 2.0 >%ipk_dir%debian-binary ( echo Version: %ver% echo Package: %pack_name% echo Description: %desc% echo Architecture: all echo Section: echo Priority: optional echo Maintainer: ivars777@gmail.com echo Homepage: echo Depends: python-xml python-imaging requests echo Source: ) >%ipk_dir%CONTROL\control dos2unix %ipk_dir%CONTROL\control :=== preinst file === ( echo #!/bin/sh echo if [ -d %ext_dir%%prog% ]; then echo rm -rf %ext_dir%%prog% ^> /dev/null 2^>^&1 echo fi echo if [ -e %script_dir%get_picons.sh ]; then echo rm %script_dir%get_picons.sh ^> /dev/null 2^>^&1 echo fi echo exit 0 ) >%ipk_dir%CONTROL\preinst dos2unix %ipk_dir%CONTROL\preinst :=== postrm file === ( echo #!/bin/sh echo if [ -d %ext_dir%%prog% ]; then echo rm -rf %ext_dir%%prog% ^> /dev/null 2^>^&1 echo fi echo if [ -e %script_dir%get_picons.sh ]; then echo rm %script_dir%get_picons.sh ^> /dev/null 2^>^&1 echo fi echo exit 0 ) >%ipk_dir%CONTROL\postrm dos2unix %ipk_dir%CONTROL\postrm :=== create ipk file === if not exist %release_dir% mkdir %release_dir% %TAR% -C ipkg\data --mode=777 -czf ipkg\data.tar.gz . %TAR% -C ipkg\CONTROL --mode=777 -czf ipkg\control.tar.gz . if exist %release_dir%%pack_name%_%ver%.ipk del %release_dir%%pack_name%_%ver%.ipk %AR% -r %release_dir%%pack_name%_%ver% ipkg\debian-binary ipkg\data.tar.gz ipkg\control.tar.gz @echo on mv %release_dir%%pack_name%_%ver% %release_dir%%pack_name%_%ver%.ipk copy %release_dir%%pack_name%_%ver%.ipk %feed_dir%%pack_name%_%ver%.ipk pushd %feed_dir% python c:\Python27\Scripts\opkg-make-index . >Packages dos2unix Packages gzip -f -k Packages popd