actions.py 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. def setup():
  11. shelltools.system("sed -i '/skipping/d' util/packer.c")
  12. autotools.autoreconf("-vfi")
  13. autotools.configure("--with-default-dict=/usr/share/cracklib/pw_dict \
  14. --prefix=/usr \
  15. PYTHON={} \
  16. --with-python \
  17. --disable-static".format(
  18. "python2" if get.buildTYPE()=="rebuild_python" else "python3.7"))
  19. # for unused
  20. inarytools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ")
  21. def build():
  22. autotools.make("all")
  23. def install():
  24. if get.buildTYPE()=="rebuild_python":
  25. autotools.rawInstall("DESTDIR={}/python2".format(get.installDIR()))
  26. shelltools.move("{}/python2/usr/lib/python2.7".format(get.installDIR()),
  27. "{}/usr/lib/python2.7".format(get.installDIR()))
  28. shelltools.unlinkDir("{}/python2/".format(get.installDIR()))
  29. return
  30. autotools.install()
  31. shelltools.system("install -v -m644 -D ../cracklib-words-2.9.7.gz \
  32. {}/usr/share/dict/cracklib-words.gz".format(get.installDIR()))
  33. shelltools.system("gunzip -v {}/usr/share/dict/cracklib-words.gz".format(get.installDIR()))
  34. shelltools.system("ln -v -sf cracklib-words {}/usr/share/dict/words".format(get.installDIR()))
  35. shelltools.system("echo $(hostname) >> {}/usr/share/dict/cracklib-extra-words".format(get.installDIR()))
  36. shelltools.system("install -v -m755 -d {}/lib/cracklib".format(get.installDIR()))
  37. # Create dictionary files
  38. shelltools.system("create-cracklib-dict {0}/usr/share/dict/cracklib-words \
  39. {0}/usr/share/cracklib/pw_dict".format(get.installDIR()))
  40. inarytools.domo("po/tr.po","tr","cracklib.mo")
  41. inarytools.dodoc("ChangeLog", "README*", "NEWS", "COPYING.LIB", "AUTHORS")