From 65635f34e43d4922a18f416523ff48fd6ffe1316 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Tue, 15 Jan 2013 21:30:09 -0500 Subject: [PATCH] PR1887: systemtap.spec to install emacs mode files --- emacs/systemtap-init.el | 3 +++ systemtap.spec | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 emacs/systemtap-init.el diff --git a/emacs/systemtap-init.el b/emacs/systemtap-init.el new file mode 100644 index 000000000..59669c92a --- /dev/null +++ b/emacs/systemtap-init.el @@ -0,0 +1,3 @@ +(autoload 'systemtap-mode "systemtap-mode.el") +(setq auto-mode-alist (append '(("\\.stp$" . systemtap-mode)) auto-mode-alist)) +(setq auto-mode-alist (append '(("\\.stpm$" . systemtap-mode)) auto-mode-alist)) diff --git a/systemtap.spec b/systemtap.spec index 790e60f0b..e4ea9d758 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -18,6 +18,7 @@ %{!?with_dyninst: %global with_dyninst 0} %endif %{!?with_systemd: %global with_systemd 0} +%{!?with_emacsvim: %global with_emacsvim 1} Name: systemtap Version: 2.1 @@ -94,6 +95,9 @@ BuildRequires: publican BuildRequires: /usr/share/publican/Common_Content/%{publican_brand}/defaults.cfg %endif %endif +%if %{with_emacsvim} +BuildRequires: emacs +%endif # Install requirements Requires: systemtap-client = %{version}-%{release} @@ -327,6 +331,10 @@ cd .. %configure %{?elfutils_config} %{dyninst_config} %{sqlite_config} %{crash_config} %{docs_config} %{pie_config} %{publican_config} %{rpm_config} --disable-silent-rules --with-extra-version="rpm %{version}-%{release}" make %{?_smp_mflags} +%if %{with_emacsvim} +%{_emacs_bytecompile} emacs/systemtap-mode.el +%endif + %install rm -rf ${RPM_BUILD_ROOT} make DESTDIR=$RPM_BUILD_ROOT install @@ -396,6 +404,14 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig install -m 644 initscript/config.stap-server $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/stap-server %endif +%if %{with_emacsvim} +mkdir -p $RPM_BUILD_ROOT%{_emacs_sitelispdir} +install -p -m 644 emacs/systemtap-mode.el* $RPM_BUILD_ROOT%{_emacs_sitelispdir} +mkdir -p $RPM_BUILD_ROOT%{_emacs_sitestartdir} +install -p -m 644 emacs/systemtap-init.el $RPM_BUILD_ROOT%{_emacs_sitestartdir}/systemtap-init.el +%endif + + %clean rm -rf ${RPM_BUILD_ROOT} @@ -577,6 +593,10 @@ exit 0 %dir %{_libdir}/%{name} %{_libdir}/%{name}/lib*.so* %endif +%if %{with_emacsvim} +%{_emacs_sitelispdir}/*.el* +%{_emacs_sitestartdir}/systemtap-init.el +%endif %files runtime -f %{name}.lang -- 2.43.5