File emacs-vcard.spec of Package emacs-vcard
#
# spec file for package emacs-vcard
#
# 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-vcard
Version: 0.2.2
Release: 0
Summary: Emacs VCard
License: GPL-3.0-or-later
URL: https://elpa.gnu.org/packages/vcard.html
Source: https://elpa.gnu.org/packages/vcard-%{version}.tar
Source1: README
BuildRequires: emacs-nox
Requires: emacs
BuildArch: noarch
Patch: Make-vcard-parser-more-robust-to-invalid-vcards.patch
%description
Package for handling vCard files
%define _sitedir %{_datadir}/emacs/site-lisp
%define _lispdir %{_sitedir}/vcard
%define _startdir %{_sitedir}/site-start.d
%prep
%setup -q -n vcard-%{version}
%autopatch -p1
%files
%doc %{basename %{S:1}}
%dir %{_lispdir}
%{_lispdir}/vcard.el{,c}
%{_lispdir}/vcard-mode.el{,c}
%{_lispdir}/vcard-parse.el{,c}
%{_lispdir}/vcard-autoloads.el
%{_startdir}/vcard-init.el
%build
emacs -Q -L . -batch -f batch-byte-compile ./vcard.el ./vcard-{mode,parse}.el
emacs -Q -L . -batch --eval "(require 'package)" --eval "(package-generate-autoloads \"vcard\" \"$PWD\")"
%install
cp %{S:1} .
install -pm 755 -d %{buildroot}/%{_lispdir}
install -m 644 vcard.el{,c} %{buildroot}/%{_lispdir}
install -m 644 vcard-{mode,parse}.el{,c} %{buildroot}/%{_lispdir}
install -m 644 vcard-autoloads.el %{buildroot}/%{_lispdir}
install -pm 755 -d %{buildroot}/%{_startdir}
cat <<EOF > %{buildroot}/%{_startdir}/vcard-init.el
(add-to-list 'load-path "%{_lispdir}")
(load "vcard-autoloads")
EOF
%changelog