build 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. [% c("var/set_default_env") -%]
  3. [% IF c("var/linux") -%]
  4. # Config options for hardening-wrapper
  5. export DEB_BUILD_HARDENING=1
  6. export DEB_BUILD_HARDENING_STACKPROTECTOR=1
  7. export DEB_BUILD_HARDENING_FORTIFY=1
  8. # Since r223796 landed on GCC master enforcing PIE breaks GCC compilation.
  9. # The compiler gets built with `-fno-PIE` and linked with `-no-pie` as not
  10. # doing so would make precompiled headers (PCH) fail.
  11. # It is okay for us to omit this right now as it does not change any hardening
  12. # flags in the resulting bundles.
  13. export DEB_BUILD_HARDENING_PIE=0
  14. # We need to disable `-Werror=format-security` as GCC does not build with it
  15. # anymore. It seems it got audited for those problems already:
  16. # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48817.
  17. export DEB_BUILD_HARDENING_FORMAT=0
  18. [% END -%]
  19. distdir=/var/tmp/dist/[% project %]
  20. mkdir /var/tmp/build
  21. tar -C /var/tmp/build -xf [% project %]-[% c("version") %].tar.xz
  22. cd /var/tmp/build/[% project %]-[% c("version") %]
  23. ./configure --prefix=$distdir [% c("var/configure_opt") %]
  24. make -j[% c("num_procs") %]
  25. make install
  26. cd /var/tmp/dist
  27. [% c('tar', {
  28. tar_src => [ project ],
  29. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  30. }) %]