path_replacer.sh.in 1017 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. # Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC")
  3. #
  4. # This Source Code Form is subject to the terms of the Mozilla Public
  5. # License, v. 2.0. If a copy of the MPL was not distributed with this
  6. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  7. #
  8. # This script replaces @prefix@, @localstatedir@ and other automake/autoconf
  9. # variables with their actual content.
  10. #
  11. # Invocation:
  12. #
  13. # ./path_replacer.sh input-file.in output-file
  14. #
  15. # This script is initially used to generate configuration files, but it is
  16. # generic and can be used to generate any text files.
  17. #
  18. prefix=@prefix@
  19. sysconfdir=@sysconfdir@
  20. localstatedir=@localstatedir@
  21. echo "Replacing \@prefix\@ with ${prefix}"
  22. echo "Replacing \@sysconfdir\@ with ${sysconfdir}"
  23. echo "Replacing \@localstatedir\@ with ${localstatedir}"
  24. echo "Input file: $1"
  25. echo "Output file: $2"
  26. sed -e "s@SEP@\@localstatedir\@@SEP@${localstatedir}@SEP@g; s@SEP@\@prefix\@@SEP@${prefix}@SEP@g; s@SEP@\@sysconfdir\@@SEP@${sysconfdir}@SEP@g" $1 > $2