mkdir -p package/DEBIAN
sed -e 's/#/$(version)/' control.in >package/DEBIAN/control
mkdir -p package/usr/{bin,lib}
mkdir -p package/DEBIAN
sed -e 's/#/$(version)/' control.in >package/DEBIAN/control
mkdir -p package/usr/{bin,lib}
$(lipo) -extract armv6 -output package/usr/bin/cycript Cycript.lib/cycript-apl
$(lipo) -extract armv6 -extract arm64 -output package/usr/lib/libcycript.dylib Cycript.lib/libcycript.dylib
ln -s libcycript.dylib package/usr/lib/libcycript.0.dylib
cp -a libcycript.cy package/usr/lib/libcycript.cy
$(lipo) -extract armv6 -output package/usr/bin/cycript Cycript.lib/cycript-apl
$(lipo) -extract armv6 -extract arm64 -output package/usr/lib/libcycript.dylib Cycript.lib/libcycript.dylib
ln -s libcycript.dylib package/usr/lib/libcycript.0.dylib
cp -a libcycript.cy package/usr/lib/libcycript.cy
cp -a Cycript.lib/libcycript.db package/usr/lib/libcycript.db
sqlite3 package/usr/lib/libcycript.db "delete from cache where system & $$(($$(cat build.ios-arm{v6,64}/Makefile | sed -e '/^CY_SYSTEM = \([0-9]*\)$$/{s//\1/;p;};d;' | tr $$'\n' '|') 0)) == 0; vacuum full;"
./dpkg-deb.sh -Zlzma -b package $@
cp -a Cycript.lib/libcycript.db package/usr/lib/libcycript.db
sqlite3 package/usr/lib/libcycript.db "delete from cache where system & $$(($$(cat build.ios-arm{v6,64}/Makefile | sed -e '/^CY_SYSTEM = \([0-9]*\)$$/{s//\1/;p;};d;' | tr $$'\n' '|') 0)) == 0; vacuum full;"
./dpkg-deb.sh -Zlzma -b package $@