build 1.3 KB

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