summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authordarmac <xiaojun2@hisilicon.com>2020-05-19 10:40:34 +0800
committerGitHub <noreply@github.com>2020-05-18 21:40:34 -0500
commit3f6164053d109f890b407360aef7c9aedc37d4b0 (patch)
tree1ec5813af295cb43a9b683ef333c788093315c6e /var
parent84889ef3a3a553171ef6418f4f5f4b22420e7749 (diff)
downloadspack-3f6164053d109f890b407360aef7c9aedc37d4b0.tar.gz
spack-3f6164053d109f890b407360aef7c9aedc37d4b0.tar.bz2
spack-3f6164053d109f890b407360aef7c9aedc37d4b0.tar.xz
spack-3f6164053d109f890b407360aef7c9aedc37d4b0.zip
Add new package: http-get (#16677)
* Add new package: http-get * refine version name
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/http-get/package.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/http-get/package.py b/var/spack/repos/builtin/packages/http-get/package.py
new file mode 100644
index 0000000000..aa05b9f355
--- /dev/null
+++ b/var/spack/repos/builtin/packages/http-get/package.py
@@ -0,0 +1,35 @@
+# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+from spack import *
+import datetime
+
+
+class HttpGet(MakefilePackage):
+ """Http_get fetches an HTTP URL and dumps the contents to stdout.
+ It does not do gopher, ftp, file, news, or any other type of URL,
+ only HTTP. It can be configured to do HTTPS fetches as well."""
+
+ homepage = "http://www.acme.com/software/http_get/"
+ url = "http://www.acme.com/software/http_get/http_get_23May2018.tar.gz"
+
+ version('2018-05-23', sha256='7d46ce25e53b6d3e27a99c1853c3054a046cc97d5e30a713a7ec986cfe7c4fe0')
+
+ def url_for_version(self, version):
+ ver = datetime.datetime.strptime(str(version), '%Y-%m-%d').date()
+ verstr = datetime.datetime.strftime(ver, '%d%b%Y')
+ return "http://www.acme.com/software/http_get/http_get_{0}.tar.gz".format(verstr)
+
+ def edit(self, spec, prefix):
+ makefile = FileFilter("Makefile")
+ makefile.filter("BINDIR =\t/usr/local/bin",
+ "BINDIR = {0}/bin".format(self.prefix))
+ makefile.filter("MANDIR =\t/usr/local/man/man1",
+ "MANDIR={0}/man/man1".format(self.prefix))
+
+ def install(self, spec, prefix):
+ mkdirp(prefix.bin)
+ mkdirp(prefix.man.man1)
+ make('install')