From 95af3dc1bb19c66ce29cf928782bae4f545247e9 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Sat, 17 Apr 2021 19:35:56 +0200 Subject: feat(snippets): change snippets from vim-snippets to VSCode format --- snippets/spec.json | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 snippets/spec.json (limited to 'snippets/spec.json') diff --git a/snippets/spec.json b/snippets/spec.json new file mode 100644 index 0000000..b8425be --- /dev/null +++ b/snippets/spec.json @@ -0,0 +1,81 @@ +// snippet sedpy +// sed -i -e '1s@/usr/bin/env python@/usr/bin/python@' +// +// snippet nopy +// %define skip_python2 1 +// +// snippet pycache +// %pycache_only %{python_sitelib}/__pycache__ +// +// snippet pyc +// $python -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/hypothesis/ +// $python -O -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/hypothesis/ + +{ + "lic" : { + "prefix" : "lic", + "body" : [ + "%{?!license:%define license %doc}" + ], + "description" : "Missing definition of %license" + }, + "fdup" : { + "prefix" : "fdup", + "body" : [ + "%python_expand %fdupes %{buildroot}%{\$python_sitelib}" + ], + "description" : "Deduplication" + }, + "patch" : { + "prefix" : "patch", + "body" : [ + "# PATCH-{FIX|FEATURE}-{OPENSUSE|SLE|UPSTREAM} ${1:filename} ${2:bugno} mcepl@suse.com", + "# this patch makes things totally awesome", + "Patch0: $1" + ], + "description" : "Patch definition" + }, + "alt" : { + "prefix" : "alt", + "body" : [ + "Requires(post): update-alternatives", + "Requires(postun): update-alternatives", + "%python_clone -a ${1:execname}", + "%post", + "%python_install_alternative $1", + "", + "%postun", + "%python_uninstall_alternative $1" + ], + "description" : "configuration of alternatives" + }, + "multi" : { + "prefix" : "multi", + "body" : [ + "%global flavor @BUILD_FLAVOR@%{nil}", + "%if \"%{flavor}\" == \"test\"", + "%define psuffix -test", + "%bcond_without test", + "%else", + "%define psuffix %{nil}", + "%bcond_with test", + "%endif", + "Name: python-${1:name}%{psuffix}" + ], + "description" : "configuration of multibuild" + }, + "ghurl" : { + "prefix" : "ghurl", + "body" : [ + "Source: https://github.com/XXX/%{modname}/archive/v%{version}.tar.gz#/%{modname}-%{version}.tar.gz" + ], + "description" : "URL of the upstream tarball on GitHub" + }, + "pyurl" : { + "prefix" : "pyurl", + "body" : [ + "Source: https://files.pythonhosted.org/packages/source/XXX/%{modname}/%{modname}-%{version}.tar.gz" + ], + "description" : "URL of the upstream tarball on PyPI" + } +} -- cgit