Commit f2e4fca6 authored by Igor Gnatenko's avatar Igor Gnatenko

snippets: add rpmspec snippets (skeletons)

v2:
    fix typo in python-arch snippet name
    rename lib to library snippet

Reference: https://bugzilla.gnome.org/show_bug.cgi?id=742591Signed-off-by: default avatarIgor Gnatenko <ignatenko@src.gnome.org>
parent 2a598172
......@@ -23,6 +23,7 @@
<file>snippets/chdr.snippets</file>
<file>snippets/c-sharp.snippets</file>
<file>snippets/python.snippets</file>
<file>snippets/rpmspec.snippets</file>
<file>snippets/vala.snippets</file>
<file>snippets/xml.snippets</file>
......
snippet minimal
Name: ${1:$filename|stripsuffix}
Version: ${2:1.0}
Release: ${3:1}%{?dist}
Summary: ${4:Minimal test package}
License: ${5:Public Domain}
URL: ${6:https://fedoraproject.org/}
Source0: ${7}
BuildRequires: ${8}
Requires: ${9}
%description
${10:$4}
%prep
%setup -q
%build
%configure
make %{?_smp_mflags}
%install
%make_install
%files
%doc ${11}
${12}
%changelog
* $shortweekday $shortmonth $day $year ${13:$fullname} <${14:$email}> - $2-$3
- Initial package$0
snippet library
Name: ${1:$filename|stripsuffix}
Version: ${2:1.0}
Release: ${3:1}%{?dist}
Summary: ${4:Minimal test package}
License: ${5:Public Domain}
URL: ${6:https://fedoraproject.org/}
Source0: ${7}
BuildRequires: ${8}
Requires: ${9}
%description
${10:$4}
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%prep
%setup -q
%build
%configure --disable-static
make %{?_smp_mflags}
%install
%make_install
find %{buildroot} -name '*.la' -exec rm -f {} ';'
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%doc ${11}
%{_libdir}/${12:*}.so.*
${13}
%files devel
%doc ${14}
%{_includedir}/${15:*}
%{_libdir}/${16:$12}.so
${17}
%changelog
* $shortweekday $shortmonth $day $year ${18:$fullname} <${19:$email}> - $2-$3
- Initial package$0
snippet python-arch
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
Name: ${1:$filename|stripsuffix}
Version: ${2:1.0}
Release: ${3:1}%{?dist}
Summary: ${4:Minimal python arch-specific package}
License: ${5:Public Domain}
URL: ${6:https://fedoraproject.org/}
Source0: ${7}
BuildRequires: ${8}
Requires: ${9}
BuildArch: ${10:%{ix86} x86_64}
%description
${11:$4}
%prep
%setup -q
%build
CFLAGS=%{optflags} %{__python} setup.py build
%install
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
%files
%doc ${12}
%{python_sitearch}/${14:*}
${15}
%changelog
* $shortweekday $shortmonth $day $year ${16:$fullname} <${17:$email}> - $2-$3
- Initial package$0
snippet python-noarch
Name: ${1:$filename|stripsuffix}
Version: ${2:1.0}
Release: ${3:1}%{?dist}
Summary: ${4:Minimal python package}
License: ${5:Public Domain}
URL: ${6:https://fedoraproject.org/}
Source0: ${7}
BuildRequires: ${8}
Requires: ${9}
BuildArch: noarch
%description
${10:$4}
%prep
%setup -q
%build
%{__python} setup.py build
%install
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
%files
%doc ${12}
%{python_sitelib}/${14:*}
${15}
%changelog
* $shortweekday $shortmonth $day $year ${16:$fullname} <${17:$email}> - $2-$3
- Initial package$0
......@@ -706,6 +706,15 @@ gb_source_snippet_context_init (GbSourceSnippetContext *context)
str = g_date_time_format (dt, "%Y");
ADD_VARIABLE ("year", str);
g_free (str);
str = g_date_time_format (dt, "%b");
ADD_VARIABLE ("shortmonth", str);
g_free (str);
str = g_date_time_format (dt, "%d");
ADD_VARIABLE ("day", str);
g_free (str);
str = g_date_time_format (dt, "%a");
ADD_VARIABLE ("shortweekday", str);
g_free (str);
g_date_time_unref (dt);
str = run_command ("git config user.email");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment