diff options
Diffstat (limited to 'snippets')
-rw-r--r-- | snippets/changes.json | 6 | ||||
-rw-r--r-- | snippets/spec.json | 48 |
2 files changed, 35 insertions, 19 deletions
diff --git a/snippets/changes.json b/snippets/changes.json index b1611d3..c412747 100644 --- a/snippets/changes.json +++ b/snippets/changes.json @@ -1,12 +1,12 @@ { "ch" : { - "prefix" : "ch", "body" : [ "-------------------------------------------------------------------", - "${VIM:system('LC_TIME=en_DK date "+%a %b %e %X %Z %Y"|tr -d "\n"')` - `system('rpm --eval "%{packager}"|iconv -f utf-8 -t us-ascii//TRANSLIT')}", + "${VIM:system('LC_TIME=en_DK date \"+%a %b %e %X %Z %Y\"|tr -d \"\n\"')} - ${VIM:system('rpm --eval \"%{packager}\"|iconv -f utf-8 -t us-ascii//TRANSLIT')}", "- $0", "" ], - "description" : "New entry of changelog" + "description" : "New entry of changelog", + "prefix" : "ch" } } diff --git a/snippets/spec.json b/snippets/spec.json index b8425be..9657df0 100644 --- a/snippets/spec.json +++ b/snippets/spec.json @@ -1,17 +1,33 @@ -// 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/ - { + "nopy" : { + "prefix" : "nopy", + "body" : [ + "%define skip_python2 1" + ], + "description" : "Don't build for Python 2" + }, + "sedpy" : { + "prefix" : "sedpy", + "body" : [ + "%pycache_only %{python_sitelib}/__pycache__" + ], + "description" : "Definition of Python cache files into %files" + }, + "pycache" : { + "prefix" : "pycache", + "body" : [ + "sed -i -e '1s@/usr/bin/env python@/usr/bin/python@'" + ], + "description" : "Remove env python construct" + }, + "pyc" : { + "prefix" : "pyc", + "body" : [ + "$python -m compileall -d %{$python_sitelib} {buildroot}%{$python_sitelib}/%{modname}/", + "$python -O -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/%{modname}/" + ], + "description" : "Compile Python modules" + }, "lic" : { "prefix" : "lic", "body" : [ @@ -22,16 +38,16 @@ "fdup" : { "prefix" : "fdup", "body" : [ - "%python_expand %fdupes %{buildroot}%{\$python_sitelib}" + "%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", + "# PATCH-${1|FIX,FEATURE|}-${2|OPENSUSE,SLE,UPSTREAM|} ${3:filename} ${4:bugno} mcepl@suse.com", "# this patch makes things totally awesome", - "Patch0: $1" + "Patch0: $3" ], "description" : "Patch definition" }, |