File emacs-yasnippet.spec of Package emacs-yasnippet-mode

#
# spec file for package emacs-yasnippet-mode
#
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           emacs-yasnippet
Version:        0.14.0
Release:        0
Summary:        Emacs  Template System
License:        GPL-3.0-or-later
URL:            https://github.com/joaotavora/yasnippet
Source:         https://github.com/joaotavora/yasnippet/archive/refs/tags/%{version}.tar.gz#/yasnippet-%{version}.tar.gz
BuildRequires:  emacs-nox
Requires:       emacs
BuildArch:      noarch
Obsoletes:      emacs-yasnippet-mode <= %version

%description
YASnippet is a template system for Emacs.
It allows you to type an abbreviation and automatically
expand it into function templates. Bundled language
templates include: C, C++, C#, Perl, Python, Ruby, SQL,
LaTeX, HTML, CSS and more.

%define _sitedir %{_datadir}/emacs/site-lisp
%define _lispdir %{_sitedir}/go-mode
%define _startdir %{_sitedir}/site-start.d

%prep
%setup -q -n yasnippet-%{version}

%files
%doc NEWS CONTRIBUTING.md README.mdown
%dir %{_lispdir}
%{_lispdir}/yasnippet-debug.el{,c}
%{_lispdir}/yasnippet-tests.el{,c}
%{_lispdir}/yasnippet.el{,c}
%{_startdir}/yasnippet-init.el{,c}
%{_lispdir}/yasnippet-autoloads.el

%build
emacs -Q -L . -batch -f batch-byte-compile *.el
emacs -Q -L . -batch --eval "(require 'package)" --eval "(package-generate-autoloads \"yasnippet\" \"$PWD\")"

%install
install -pm 755 -d %{buildroot}/%{_lispdir}
install -m 644 *.el{,c} %{buildroot}/%{_lispdir}
install -m 644 yasnippet-autoloads.el %{buildroot}/%{_lispdir}

install -pm 755 -d %{buildroot}/%{_startdir}
cat << EOF > %{buildroot}/%{_startdir}/yasnippet-init.el
(add-to-list 'load-path "%{_lispdir}")
(require 'yasnippet)
(yas-global-mode 1)
EOF

%changelog
openSUSE Build Service is sponsored by