summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authordarmac <xiaojun2@hisilicon.com>2020-05-19 23:56:22 +0800
committerGitHub <noreply@github.com>2020-05-19 10:56:22 -0500
commit05aacb584e0a4ea22ae33b0e657bafab71cce1b8 (patch)
treeb8fb70c1f326e445cab2cc92483d6e7ba81c8fda /var
parentb1f1f5dddbb141d64e02c88985aa74365228d59b (diff)
downloadspack-05aacb584e0a4ea22ae33b0e657bafab71cce1b8.tar.gz
spack-05aacb584e0a4ea22ae33b0e657bafab71cce1b8.tar.bz2
spack-05aacb584e0a4ea22ae33b0e657bafab71cce1b8.tar.xz
spack-05aacb584e0a4ea22ae33b0e657bafab71cce1b8.zip
Add new package: http-ping (#16675)
* Add new package: http-ping * refine version name
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/http-ping/package.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/http-ping/package.py b/var/spack/repos/builtin/packages/http-ping/package.py
new file mode 100644
index 0000000000..7cf731e019
--- /dev/null
+++ b/var/spack/repos/builtin/packages/http-ping/package.py
@@ -0,0 +1,34 @@
+# 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 HttpPing(MakefilePackage):
+ """http_ping is like the regular ping command, except that it sends
+ HTTP requests instead of ICMP echo requests."""
+
+ homepage = "http://www.acme.com/software/http_ping/"
+ url = "http://www.acme.com/software/http_ping/http_ping_09Mar2016.tar.gz"
+
+ version('2016-03-09', sha256='6bdc570c776a760d2c08f7d18e00b0edd74cf603400929c66c512801b6bb5871')
+
+ 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_ping/http_ping_{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')