emacs rpm spec mode is no more provided (#951101)

This commit is contained in:
Petr Hracek 2013-04-12 14:22:39 +02:00
parent c458421ef5
commit ac5768b2c2
6 changed files with 1615 additions and 1 deletions

View File

@ -3,7 +3,7 @@ Summary: GNU Emacs text editor
Name: emacs
Epoch: 1
Version: 24.2
Release: 17%{?dist}
Release: 18%{?dist}
License: GPLv3+
URL: http://www.gnu.org/software/emacs/
Group: Applications/Editors
@ -16,6 +16,12 @@ Source5: default.el
# Emacs Terminal Mode, #551949, #617355
Source6: emacs-terminal.desktop
Source7: emacs-terminal.sh
# rpm-spec-mode for XEmacs
Source10: https://bitbucket.org/xemacs/prog-modes/raw/eacc4cb30d0c/rpm-spec-mode.el
Source11: rpm-spec-mode-init.el
Patch1: rpm-spec-mode.patch
Patch2: rpm-spec-mode-utc.patch
Patch3: rpm-spec-mode-changelog.patch
# rhbz#713600
Patch7: emacs-spellchecker.patch
# rhbz#830162, fixed in org-mode upstream
@ -175,6 +181,15 @@ packages that add functionality to Emacs.
%patch100 -p1 -b .hunspell
%patch101 -p1 -b .hunspell.2
#Install site-lisp files
cp %SOURCE10 site-lisp
pushd site-lisp
%patch1 -p0
%patch2 -p0
%patch3 -p0
popd
# We prefer our emacs.desktop file
cp %SOURCE1 etc/emacs.desktop
@ -240,6 +255,10 @@ ln -s ../configure .
%{setarch} make %{?_smp_mflags}
cd ..
# Make sure patched lisp files get byte-compiled
build-gtk/src/emacs %{bytecompargs} site-lisp/*.el
# Remove versioned file so that we end up with .1 suffix and only one DOC file
rm build-{gtk,nox}/src/emacs-%{version}.*
@ -296,7 +315,11 @@ mv %{buildroot}%{_mandir}/man1/{ctags.1.gz,gctags.1.gz}
mv %{buildroot}%{_mandir}/man1/{etags.1.gz,etags.emacs.1.gz}
mv %{buildroot}%{_bindir}/{ctags,gctags}
# Install site-lisp files
install -p -m 0644 site-lisp/*.el{,c} %{buildroot}%{site_lisp}
mkdir -p %{buildroot}%{site_lisp}/site-start.d
install -p -m 0644 %SOURCE11 %{buildroot}%{site_lisp}/site-start.d
# Default initialization file
mkdir -p %{buildroot}%{_sysconfdir}/skel
@ -452,6 +475,9 @@ update-desktop-database &> /dev/null || :
%dir %{_datadir}/emacs/site-lisp/site-start.d
%changelog
* Fri Apr 12 2013 Petr Hracek <phracek@redhat.com> - 1:24.2-18
- emacs rpm spec mode is no more provided (#951101)
* Mon Apr 08 2013 Petr Hracek <phracek@redhat.com> - 1:24.2-17
- Spell checking broken by non-default dictionary (#827033)

View File

@ -0,0 +1,48 @@
diff -up rpm-spec-mode.el.orig site-lisp/rpm-spec-mode.el
--- rpm-spec-mode.el.orig 2011-11-10 17:22:20.000000000 +0100
+++ rpm-spec-mode.el 2011-11-23 15:59:13.959987280 +0100
@@ -491,6 +491,7 @@ value returned by function `user-mail-ad
(set-keymap-name rpm-spec-mode-map 'rpm-spec-mode-map))
(define-key rpm-spec-mode-map "\C-c\C-c" 'rpm-change-tag)
(define-key rpm-spec-mode-map "\C-c\C-e" 'rpm-add-change-log-entry)
+ (define-key rpm-spec-mode-map "\C-c\C-w" 'rpm-goto-add-change-log-entry)
(define-key rpm-spec-mode-map "\C-c\C-i" 'rpm-insert-tag)
(define-key rpm-spec-mode-map "\C-c\C-n" 'rpm-forward-section)
(define-key rpm-spec-mode-map "\C-c\C-o" 'rpm-goto-section)
@@ -719,10 +720,8 @@ This variable is global by default, but
If `rpm-change-log-uses-utc' is nil, \"today\" means the local time zone."
(format-time-string "%a %b %e %Y" nil rpm-change-log-uses-utc))
-(defun rpm-add-change-log-entry (&optional change-log-entry)
- "Find change log and add an entry for today."
- (interactive "sChange log entry: ")
- (save-excursion
+(defun rpm-goto-add-change-log-header ()
+ "Find change log and add header (if needed) for today"
(rpm-goto-section "changelog")
(let* ((address (rpm-spec-user-mail-address))
(fullname (or rpm-spec-user-full-name (user-full-name)))
@@ -733,8 +732,21 @@ If `rpm-change-log-uses-utc' is nil, \"t
(concat " - " (rpm-find-spec-version t))))))
(if (not (search-forward string nil t))
(insert "\n" string "\n")
- (forward-line 2))
- (insert "- " change-log-entry "\n"))))
+ (forward-line 2))))
+
+(defun rpm-add-change-log-entry (&optional change-log-entry)
+ "Find change log and add an entry for today."
+ (interactive "sChange log entry: ")
+ (save-excursion
+ (rpm-goto-add-change-log-header)
+ (insert "- " change-log-entry "\n")))
+
+(defun rpm-goto-add-change-log-entry ()
+ "Goto change log and add an header for today (if needed)."
+ (interactive)
+ (rpm-goto-add-change-log-header)
+ (insert "- \n")
+ (end-of-line '0))
;;------------------------------------------------------------

5
rpm-spec-mode-init.el Normal file
View File

@ -0,0 +1,5 @@
;; rpm-spec-mode for spec files
(autoload 'rpm-spec-mode "rpm-spec-mode" "RPM spec mode." t)
(add-to-list 'auto-mode-alist '("\\.spec\\(\\.in\\)?$" . rpm-spec-mode))
(setq-default rpm-change-log-uses-utc t)

31
rpm-spec-mode-utc.patch Normal file
View File

@ -0,0 +1,31 @@
--- rpm-spec-mode.el~ 2009-06-11 11:01:53.000000000 +0200
+++ rpm-spec-mode.el 2009-06-11 11:05:24.000000000 +0200
@@ -708,6 +708,17 @@
;;------------------------------------------------------------
+(defvar rpm-change-log-uses-utc nil
+ "*If non-nil, \\[rpm-add-change-log-entry] will use Universal time (UTC).
+If this is nil, it uses local time as returned by `current-time'.
+
+This variable is global by default, but you can make it buffer-local.")
+
+(defsubst rpm-change-log-date-string ()
+ "Return the date string for today, inserted by \\[rpm-add-change-log-entry].
+If `rpm-change-log-uses-utc' is nil, \"today\" means the local time zone."
+ (format-time-string "%a %b %e %Y" nil rpm-change-log-uses-utc))
+
(defun rpm-add-change-log-entry (&optional change-log-entry)
"Find change log and add an entry for today."
(interactive "sChange log entry: ")
@@ -715,8 +726,8 @@
(rpm-goto-section "changelog")
(let* ((address (rpm-spec-user-mail-address))
(fullname (or rpm-spec-user-full-name (user-full-name)))
- (string (concat "* " (substring (current-time-string) 0 11)
- (substring (current-time-string) -4) " "
+ (system-time-locale "C")
+ (string (concat "* " (rpm-change-log-date-string) " "
fullname " <" address ">"
(and rpm-spec-insert-changelog-version
(concat " - " (rpm-find-spec-version t))))))

1413
rpm-spec-mode.el Normal file

File diff suppressed because it is too large Load Diff

91
rpm-spec-mode.patch Normal file
View File

@ -0,0 +1,91 @@
--- rpm-spec-mode.el~ 2008-04-22 15:14:40.000000000 -0400
+++ rpm-spec-mode.el 2008-04-22 16:19:09.000000000 -0400
@@ -63,7 +63,9 @@
;;; Code:
-(defconst rpm-spec-mode-version "0.12.3x" "Version of `rpm-spec-mode'.")
+(require 'compile)
+
+(defconst rpm-spec-mode-version "0.12.3x.rh1" "Version of `rpm-spec-mode'.")
(defgroup rpm-spec nil
"RPM spec mode with Emacs/XEmacs enhancements."
@@ -189,11 +191,6 @@
:type 'boolean
:group 'rpm-spec)
-(defcustom rpm-spec-use-compilation-mode t
- "*If non-nil, build in `compilation-mode' if it's available."
- :type 'boolean
- :group 'rpm-spec)
-
(defcustom rpm-spec-default-release "1"
"*Default value for the Release tag in new spec files."
:type 'string
@@ -225,6 +222,11 @@
:type 'string
:group 'rpm-spec)
+(defcustom rpm-spec-auto-topdir nil
+ "*Automatically detect an rpm build directory tree and define _topdir."
+ :type 'boolean
+ :group 'rpm-spec)
+
(defgroup rpm-spec-faces nil
"Font lock faces for `rpm-spec-mode'."
:prefix "rpm-spec-"
@@ -1025,20 +1027,30 @@
(setq buildoptions (cons "--nodeps" buildoptions)))
(if (and rpm-spec-sign-gpg (not rpm-no-gpg))
(setq buildoptions (cons "--sign" buildoptions)))
- (save-excursion
- (set-buffer (get-buffer rpm-buffer-name))
- (and rpm-spec-use-compilation-mode
- (fboundp 'compilation-mode)
- (compilation-mode))
- (goto-char (point-max)))
- (let* ((process-environment (cons "EMACS=t" process-environment))
- (process
- (apply 'start-process rpm-spec-build-command rpm-buffer-name
- rpm-spec-build-command buildoptions)))
- (if (and rpm-spec-sign-gpg (not rpm-no-gpg))
- (let ((rpm-passwd-cache (read-passwd "GPG passphrase: ")))
- (process-send-string process (concat rpm-passwd-cache "\n"))))
- (set-process-filter process 'rpm-command-filter)))
+
+ (if rpm-spec-auto-topdir
+ (if (string-match ".*/SPECS/$" default-directory)
+ (let ((topdir (expand-file-name default-directory)))
+ (setq buildoptions
+ (cons
+ (concat "--define \"_topdir "
+ (replace-regexp-in-string "/SPECS/$" "" topdir)
+ "\"")
+ buildoptions)))))
+
+ (progn
+ (defun list->string (lst)
+ (if (cdr lst)
+ (concat (car lst) " " (list->string (cdr lst)))
+ (car lst)))
+ (compilation-start (list->string (cons rpm-spec-build-command buildoptions)) 'rpmbuild-mode))
+
+ (if (and rpm-spec-sign-gpg (not rpm-no-gpg))
+ (let ((build-proc (get-buffer-process
+ (get-buffer
+ (compilation-buffer-name "rpmbuild" nil nil))))
+ (rpm-passwd-cache (read-passwd "GPG passphrase: ")))
+ (process-send-string build-proc (concat rpm-passwd-cache "\n")))))
(defun rpm-build-prepare (&optional arg)
"Run a `rpmbuild -bp'."
@@ -1409,5 +1421,8 @@
;;;###autoload(add-to-list 'auto-mode-alist '("\\.spec\\(\\.in\\)?$" . rpm-spec-mode))
(provide 'rpm-spec-mode)
+;;;###autoload
+(define-compilation-mode rpmbuild-mode "RPM build" ""
+ (set (make-local-variable 'compilation-disable-input) t))
;;; rpm-spec-mode.el ends here