File markdown-mode.spec of Package markdown-mode

Name: markdown-mode
Version: 2.0+git0_b462983
Release: 1
Summary: Markdown major mode for emacs
URL: http://jblevins.org/projects/markdown-mode/
Group: Productivity/Editors/Emacs
License: GPL-2.0
Source0: %{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: emacs-nox emacs-packaging-macros


%description
%{summary}.

%files
%defattr(-,root,root,-)
%doc README.md
%dir %{_emacs_sitelispdir}/%{name}
%{_emacs_sitelispdir}/%{name}/%{name}.elc
%config %{_emacs_sitestartdir}/%{name}-init.el
%dir %{_emacs_sitestartdir}


%package el
Summary: Lisp files for %{name}
Group: Productivity/Editors/Emacs

%description el
%{summary}.

%files el
%defattr(-,root,root,-)
%{_emacs_sitelispdir}/%{name}/%{name}.el

%prep
%setup -q



%build
emacs -Q -L . -batch -f batch-byte-compile *.el


%install
mkdir -p %{buildroot}/%{_emacs_sitelispdir}/%{name}
mkdir -p %{buildroot}/%{_emacs_sitestartdir}

install -m 644 *.el{,c} %{buildroot}/%{_emacs_sitelispdir}/%{name}

cat << EOF > %{buildroot}/%{_emacs_sitestartdir}/%{name}-init.el
(add-to-list 'load-path "%{_emacs_sitelispdir}/%{name}")

(autoload 'markdown-mode "markdown-mode"
   "Major mode for editing Markdown files" t)

(add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
EOF