I got errors when packaging my deb with your method. After reading compiler errors, I figured out an alternate method.
Alternate solution:
Create a directory in your tweak's root directory and name it com.yourname.yourcompanyname
Inside that directory, create a directory called DEBIAN. Enter your newly created DEBIAN directory and add your postinst, preinst, prerm, and postrm scripts inside there. Also, you have to take your control file from your tweak's root directory and copy it into ./com.yourname.yourcompanyname/DEBIAN
To compile do this:
Open MobileTerminal and type the following lines of code
su
alpine //or your root password
cd /var/mobile/tweakdirectory
dpkg-deb -Z gzip -b com.yourname.yourcompanynameYour deb will stil be unarchiveable without using lzma and you don't have to make any modifications to your project beforehand.
Hope this helps fix any errors you may encounter
@@DiDA