@echo off :--- Pull content submodule --- cd content git commit -a -m a git checkout . git pull cd .. :=== Parameters === :--- Extract version number --- python get_version.py PlayStream.py >version.txt cat version.txt rem pause set /p ver=%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-json,python-twisted-web,python-simplejson,python-html,python-zlib,python-requests echo Source: ) >%ipk_dir%CONTROL\control dos2unix %ipk_dir%CONTROL\control :=== preinst file === ( echo #!/bin/sh echo if [ -d %ext_dir2%%prog%/sources ]; then echo rm -rf %ext_dir2%%prog%/*.pyo ^> /dev/null 2^>^&1 echo rm -rf %ext_dir2%%prog%/resolvers ^> /dev/null 2^>^&1 echo mkdir %ext_dir2%%prog%/content echo mkdir %ext_dir2%%prog%/content/sources echo mv %ext_dir2%%prog%/sources/streams.cfg %ext_dir2%%prog%/content/sources/streams.cfg.old echo mv %ext_dir2%%prog%/sources/*.cfg %ext_dir2%%prog%/content/sources/ echo rm -rf %ext_dir2%%prog%/sources ^> /dev/null 2^>^&1 echo fi echo if [ -e /etc/init.d/playstreamproxy ]; then echo rm /etc/init.d/playstreamproxy ^> /dev/null 2^>^&1 echo fi echo exit 0 ) >%ipk_dir%CONTROL\preinst dos2unix %ipk_dir%CONTROL\preinst :=== postinst file === ( echo #!/bin/sh echo chmod +x /etc/init.d/playstreamproxy echo ln -s /etc/init.d/playstreamproxy /etc/rc4.d/S50playstreamproxy echo ln -s /etc/init.d/playstreamproxy /etc/rc3.d/S50playstreamproxy echo ln -s /etc/init.d/playstreamproxy /usr/bin/playstreamproxy echo rm -rf %ext_dir2%%prog%/*.pyo ^> /dev/null 2^>^&1 echo rm -rf %ext_dir2%%prog%/content/sources/*.pyo ^> /dev/null 2^>^&1 echo rm -rf %ext_dir2%%prog%/content/resolvers/*.pyo ^> /dev/null 2^>^&1 echo exit 0 ) >%ipk_dir%CONTROL\postinst dos2unix %ipk_dir%CONTROL\postinst :=== postrm file === ( echo #!/bin/sh rem echo if [ -e /etc/rc4.d/S50playstreamproxy ]; then echo rm /etc/rc4.d/S50playstreamproxy ^> /dev/null 2^>^&1 rem echo fi echo #!/bin/sh rem echo if [ -e /etc/rc3.d/S50playstreamproxy ]; then echo rm /etc/rc3.d/S50playstreamproxy ^> /dev/null 2^>^&1 rem echo fi rem echo if [ -e /usr/bin/playstreamproxyy ]; then echo rm /usr/bin/playstreamproxy ^> /dev/null 2^>^&1 rem echo fi echo if [ -e /etc/init.d/playstreamproxy ]; then echo rm /etc/init.d/playstreamproxy ^> /dev/null 2^>^&1 echo fi echo exit 0 ) >%ipk_dir%CONTROL\postrm dos2unix %ipk_dir%CONTROL\postrm :=== conffiles file === rem ( rem echo %ext_dir2%%prog%/content/sources/streams.cfg rem ) >%ipk_dir%CONTROL\conffiles rem dos2unix %ipk_dir%CONTROL\conffiles :=== 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 git add %release_dir%%pack_name%_%ver%.ipk :=== Commit/push and copy to feed if message given === if not ()==(%1%) ( git commit -m "%1%" git tag -d "%ver%" git tag "%ver%" git push origin master 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 )