actions.py 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Licensed under the GNU General Public License, version 3.
  5. # See the file http://www.gnu.org/licenses/gpl.txt
  6. from inary.actionsapi import autotools
  7. from inary.actionsapi import inarytools
  8. from inary.actionsapi import shelltools
  9. from inary.actionsapi import get
  10. # Use secure delete. Even if the data is deleted with sqlite query, the traces of the deleted data still remains in the file
  11. # but cannot be seen with sqlite query. However, it can be seen by opening the file with a text editor.
  12. # SQLITE_SECURE_DELETE overwrites written data with zeros.
  13. def setup():
  14. if get.buildTYPE()=="emul32":
  15. shelltools.export("PKG_CONFIG_PATH", "/usr/lib32/pkgconfig")
  16. inarytools.cflags.add("-DSQLITE_SECURE_DELETE=1",
  17. "-DSQLITE_ENABLE_UNLOCK_NOTIFY=1",
  18. "-DSQLITE_ENABLE_COLUMN_METADATA=1",
  19. "-DSQLITE_DISABLE_DIRSYNC",
  20. "-DSQLITE_ENABLE_FTS3=1",
  21. "-DSQLITE_ENABLE_FTS4",
  22. "-DSQLITE_ENABLE_FTS5",
  23. "-DSQLITE_ENABLE_DBSTAT_VTAB=1",
  24. "-DSQLITE_ENABLE_FTS3_PARENTHESIS",
  25. "-DSQLITE_ENABLE_FTS3_TOKENIZER=1",
  26. "-DSQLITE_ENABLE_STMT_SCANSTATUS",
  27. "-DSQLITE_SOUNDEX",
  28. "-DSQLITE_ENABLE_RTREE",
  29. "-DSQLITE_ENABLE_API_ARMOR")
  30. inarytools.cflags.sub("-O[s\d]", "-O3")
  31. autotools.configure("--disable-static \
  32. --disable-editline \
  33. --enable-fts3 \
  34. --enable-fts4 \
  35. --enable-fts5 \
  36. --enable-rtree \
  37. --enable-json1 \
  38. --enable-threadsafe {}".format("--disable-tcl" if get.buildTYPE()=="emul32" else ""))
  39. def build():
  40. if get.buildTYPE()=="emul32":
  41. shelltools.export("PKG_CONFIG_PATH", "/usr/lib32/pkgconfig")
  42. autotools.make("-j1")
  43. def install():
  44. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  45. inarytools.dodoc("README*")
  46. shelltools.cd("%s/sqlite-doc-3290000" % get.workDIR())
  47. shelltools.system("pwd")
  48. inarytools.insinto("/usr/share/doc/sqlite", "../sqlite-doc-3290000/*")
  49. shelltools.system("find %s -type f -perm 755 -exec ls -lha {} \;" % get.installDIR())
  50. shelltools.system("find %s -type f -perm 755 -exec chmod 644 {} \;" % get.installDIR())
  51. shelltools.system("find %s -type f -name '*~' -exec ls -lha {} \;" % get.installDIR())
  52. shelltools.system("find %s -type d -name '*~' -exec ls -lha {} \;" % get.installDIR())
  53. shelltools.system("find %s -name '*~' -exec rm -f {} \;" % get.installDIR())
  54. shelltools.system("find %s -type f -name '.~*' -exec ls -lha {} \;" % get.installDIR())# /build/pkg/sqlite-doc/usr/share/doc/sqlite/images/fileformat/.~lock.indexpage.odg#
  55. shelltools.system("find %s -type d -name '.~*' -exec ls -lha {} \;" % get.installDIR())
  56. shelltools.system("find %s -name '.~*' -exec rm -f {} \;" % get.installDIR())