Please check the GNU Autoconf Macro Archive for Updates
AC-Archive
Autoconf Macro Archive

ac-archive.sf.net: - Project CVS - Download
Macro Index
- AM Support
- C++ Support
- C Support
- Fortran Support
- Java Support
- Cross Compilation
- Installed Packages
- Miscellaneous
- LaTeX Support
- Uncategorized
- archive macros
- adl's macros
- bkorb's macros
- guidod's macros
- latex's macros
- other's macros
- rleigh's macros
- obsoleted macros
- released macros
- search index

Documentation
- Contribute!
- History
- acincludedir m4
- acinclude (tool)
- macro howto
- ax tricks
- maintainers
- License
- Topics

generated...
2007-08-05

(C) 2007 guidod
Download the M4 Source.

ax_upload

Back to the Main Page.

Synopsis
AX_UPLOAD([command])
, 
Version

2005-01-14

Author

Tom Howard <tomhoward@users.sf.net>

License

AllPermissive
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. Users of this software should generally follow the principles of the MIT License includings its disclaimer.

Category

cryp.to ac-archive's AM Support (released)

Documentation

Adds support for uploading dist files. %%s in the command will be substituted with the name of the file. e.g:

  AX_UPLOAD([ncftpput -v upload.sourceforge.net /incoming %%s])

To add upload support for other custom dists add upload-<TYPE> to UPLOAD_BIN or UPLOAD_SRC, where <TYPE> is the type of dist that is being uploaded and add a mapping from <TYPE> to the dist file name in the format '{<TYPE>=><FILENAME>}' to UPLOAD_TARGETS. For example:

  UPLOAD_BIN += upload-foobar
  UPLOAD_TARGETS += {foobar=>@PACKAGE@-@VERSION@.fb}

You can then upload of the src distribution files by running:

  make upload-src

all the binaru distribution files by running:

  make upload-bin

or both by running:

  make upload

M4 Source Code
AC_DEFUN([AX_UPLOAD],
[
AC_MSG_NOTICE([adding upload support])
AM_CONDITIONAL(USING_AX_UPLOAD, [true])
AC_MSG_NOTICE([setting upload command... \`$1\`])
AX_ADD_AM_MACRO([[
UPLOAD_BIN =
UPLOAD_SRC = upload-gzip upload-bzip2 upload-zip
UPLOAD_TARGETS = \\
{gzip=&gt;$PACKAGE-$VERSION.tar.gz} \\
{bzip2=&gt;$PACKAGE-$VERSION.tar.bz2} \\
{zip=&gt;$PACKAGE-$VERSION.zip}

\$(UPLOAD_BIN) \$(UPLOAD_SRC):
	@TYPE=\`echo ${AX_DOLLAR}@ | \$(SED) -e \'s/upload-//\'\`; \\
	DIST=\"dist-\$\${TYPE}\"; \\
	\$(MAKE) \$(AM_MAKEFLAGS) \$\${DIST}; \\
	list=\'\$(UPLOAD_TARGETS)\'; \\
	pattern=\`echo \"^{\$\${TYPE}=&gt;\"\`; \\
	for dist in \$\$list; do \\
		echo \$\$dist | \$(EGREP) \"^{\$\${TYPE}=&gt;\" &gt; /dev/null 2&gt;&amp;1; \\
		if test \"\$\$?\" -eq \"0\"; then \\
			TARGET=\`echo \"\$\$dist\" | \$(AWK) -v pattern=\$\$pattern \'{ sub( pattern, \"\"); sub( /}\$\$/, \"\" ); print; }\'\`; \\
			UPLOAD_COMMAND=\`printf \"$1\" \$\$TARGET \`; \\
			echo \"Uploading \$\$TARGET ...\"; \\
			\$\$UPLOAD_COMMAND; \\
		fi \\
	done

upload-src: \$(UPLOAD_SRC)

upload-bin: \$(UPLOAD_BIN)

upload upload-all all-upload: upload-src upload-bin
]])
])