2024-09-09 23:48:51 -07:00
#!/usr/bin/python3
import os
2024-09-10 16:15:24 -07:00
print ( " Creating Debian package... " )
if os . name != " posix " :
print ( " WARNING: Machine is not running Linux (value of os.name is not \" posix \" ), the script will not try to auto-build the .deb file. You might need to manually `chmod 1777` the binary. " )
file = open ( " sweecrypt-gtk.py " ) . read ( ) . split ( " \n " )
open ( " dpkg/opt/sweecrypt-gtk.ui " , ' w ' ) . write ( open ( " sweecrypt-gtk.ui " ) . read ( ) )
file [ 4 ] = ' UI_FILE = " /opt/sweecrypt-gtk.ui " '
2024-09-10 16:17:09 -07:00
file . insert ( 0 , " #!/usr/bin/env " )
2024-09-10 16:15:24 -07:00
file = " \n " . join ( file )
open ( " dpkg/usr/bin/sweecrypt-gtk " , ' w ' ) . write ( file )
2024-09-10 16:17:09 -07:00
os . system ( " chmod 1777 dpkg/usr/bin/sweecrypt-gtk " )
2024-09-10 16:15:24 -07:00
if os . name == " posix " :
2024-09-10 16:18:27 -07:00
os . system ( " dpkg-deb --root-owner-group --build dpkg sweecrypt-gtk.deb " )