File emacs-flymake.spec of Package emacs-flymake

#
# spec file for package emacs-flymake
#
# 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-flymake
Version:        1.3.7
Release:        0
Summary:        Emacs Syntax Checker
License:        GPL-3.0-only
URL:            https://elpa.gnu.org/packages/flymake.html
Source:         https://elpa.gnu.org/packages/flymake-%{version}.tar
BuildRequires:  emacs-nox
Requires:       emacs
BuildArch:      noarch

%description
A universal on-the-fly syntax checker

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

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

%files
%dir %{_lispdir}
%{_lispdir}/flymake.el{,c}
%{_lispdir}/flymake-pkg.el{,c}
%{_lispdir}/flymake-autoloads.el
%{_startdir}/flymake-init.el

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

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

install -pm 755 -d %{buildroot}/%{_startdir}
cat <<EOF > %{buildroot}/%{_startdir}/flymake-init.el
(add-to-list 'load-path "%{_lispdir}")
(load "flymake-autoloads")
EOF

%changelog
openSUSE Build Service is sponsored by