Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.5KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_upload.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_UPLOAD([command])
  8. #
  9. # DESCRIPTION
  10. #
  11. # Adds support for uploading dist files. %%s in the command will be
  12. # substituted with the name of the file. e.g:
  13. #
  14. # AX_UPLOAD([ncftpput -v upload.sourceforge.net /incoming %%s])
  15. #
  16. # To add upload support for other custom dists add upload-<TYPE> to
  17. # UPLOAD_BIN or UPLOAD_SRC, where <TYPE> is the type of dist that is being
  18. # uploaded and add a mapping from <TYPE> to the dist file name in the
  19. # format '{<TYPE>=><FILENAME>}' to UPLOAD_TARGETS. For example:
  20. #
  21. # UPLOAD_BIN += upload-foobar
  22. # UPLOAD_TARGETS += {foobar=>@PACKAGE@-@VERSION@.fb}
  23. #
  24. # You can then upload of the src distribution files by running:
  25. #
  26. # make upload-src
  27. #
  28. # all the binary distribution files by running:
  29. #
  30. # make upload-bin
  31. #
  32. # or both by running:
  33. #
  34. # make upload
  35. #
  36. # LICENSE
  37. #
  38. # Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
  39. #
  40. # Copying and distribution of this file, with or without modification, are
  41. # permitted in any medium without royalty provided the copyright notice
  42. # and this notice are preserved. This file is offered as-is, without any
  43. # warranty.
  44. #serial 13
  45. AC_DEFUN([AX_UPLOAD],
  46. [
  47. AC_MSG_NOTICE([adding upload support])
  48. AM_CONDITIONAL(USING_AX_UPLOAD, [true])
  49. AC_MSG_NOTICE([setting upload command... \`$1\`])
  50. AX_ADD_AM_MACRO_STATIC([
  51. UPLOAD_BIN =
  52. UPLOAD_SRC = upload-gzip upload-bzip2 upload-zip
  53. UPLOAD_TARGETS = \\
  54. {gzip=>$PACKAGE-$VERSION.tar.gz} \\
  55. {bzip2=>$PACKAGE-$VERSION.tar.bz2} \\
  56. {zip=>$PACKAGE-$VERSION.zip}
  57. \$(UPLOAD_BIN) \$(UPLOAD_SRC):
  58. @TYPE=\`echo ${AX_DOLLAR}@ | \$(SED) -e \'s/upload-//\'\`; \\
  59. DIST=\"dist-\$\${TYPE}\"; \\
  60. \$(MAKE) \$(AM_MAKEFLAGS) \$\${DIST}; \\
  61. list=\'\$(UPLOAD_TARGETS)\'; \\
  62. pattern=\`echo \"^{\$\${TYPE}=>\"\`; \\
  63. for dist in \$\$list; do \\
  64. echo \$\$dist | \$(EGREP) \"^{\$\${TYPE}=>\" > /dev/null 2>&1; \\
  65. if test \"\$\$?\" -eq \"0\"; then \\
  66. TARGET=\`echo \"\$\$dist\" | \$(AWK) -v pattern=\$\$pattern \'{ sub( pattern, \"\"); sub( /}\$\$/, \"\" ); print; }\'\`; \\
  67. UPLOAD_COMMAND=\`printf \"$1\" \$\$TARGET \`; \\
  68. echo \"Uploading \$\$TARGET ...\"; \\
  69. \$\$UPLOAD_COMMAND; \\
  70. fi \\
  71. done
  72. upload-src: \$(UPLOAD_SRC)
  73. upload-bin: \$(UPLOAD_BIN)
  74. upload upload-all all-upload: upload-src upload-bin
  75. ])
  76. ])