Blob Blame History Raw
# Font-lock support of message bodies was added (Source1) from 
# http://de.geocities.com/ulf_jasper/emacs.html on 10th February 2007.

# Note on building VM with support for bbdb: if support for VM in BBDB is
# required, then the source elisp for VM must be installed at build time. If
# support for BBDB is required in VM, then the BBDB source elisp must be present
# at build time. Hence there is a circular BuildRequires and bootstrapping is
# required. The way to do this is (i) build emacs-vm without BuildRequires:
# emacs-bbdb-el (ii) build emacs-bbdb with BuildRequires: emacs-vm-el (iii)
# rebuild emacs-vm with BuildRequires: emacs-bbdb-el. Or vice versa.
%define bbdbsupport 1

# If the emacs-el package has installed a pkgconfig file, use that to determine
# install locations and Emacs version at build time, otherwise set defaults.
%if %($(pkg-config emacs) ; echo $?)
%define emacs_version 22.1
%define emacs_lispdir %{_datadir}/emacs/site-lisp
%define emacs_startdir %{_datadir}/emacs/site-lisp/site-start.d
%else
%define emacs_version %(pkg-config emacs --modversion)
%define emacs_lispdir %(pkg-config emacs --variable sitepkglispdir)
%define emacs_startdir %(pkg-config emacs --variable sitestartdir)
%endif

%define pkgdir %{emacs_lispdir}/vm
%define pixmapdir %{pkgdir}/pixmaps
%define initfile %{emacs_startdir}/vm-mode-init.el

Summary: Emacs VM mailreader
Name: emacs-vm
Version: 8.0.12
Release: 3%{?dist}
License: GPLv2+
Group: Applications/Internet
URL: http://www.nongnu.org/viewmail/
Source0: http://download.savannah.nongnu.org/releases/viewmail/vm-%{version}.tgz

Patch0: vm-8.0.12-fix-missing-autoload.patch

Requires: emacs >= %{emacs_version}
Requires(pre): /sbin/install-info 
Requires(post): /sbin/install-info 
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: emacs emacs-el texinfo texinfo-tex

%if %{bbdbsupport}
BuildRequires: emacs-bbdb-el
Requires: emacs-bbdb
%endif

%description
VM (View Mail) is an Emacs subsystem that allows UNIX mail to be read
and disposed of within Emacs.  Commands exist to do the normal things
expected of a mail user agent, such as generating replies, saving
messages to folders, deleting messages and so on.  There are other
more advanced commands that do tasks like bursting and creating
digests, message forwarding, and organizing message presentation
according to various criteria. 

%package el
Group: Applications/Internet
Summary: Elisp source files for VM mailreader for emacs
Requires: %{name} = %{version}-%{release}

%description el 
The %{name}-el package contains the elisp source files for the %{name}
package. It is not necessary to install this if you want to run vm.

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

%patch0 -p1 -b .fix-missing-autoload

# Add missing entry for u-vm-color.el to lisp Makefile.in
# This shouldn't be necessary after 8.0.12 
sed -i -e '/SOURCES += tapestry.el/ a SOURCES += u-vm-color.el' lisp/Makefile.in

%build
export CFLAGS="$RPM_OPT_FLAGS"
%configure
make

%install
rm -rf %{buildroot}

install -d %{buildroot}%{_bindir}
install -d %{buildroot}%{_infodir}

make install \
  prefix=%{buildroot}%{_prefix} \
  bindir=%{buildroot}%{_bindir} \
  info_dir=%{buildroot}%{_infodir} \
  pixmapdir=%{buildroot}%{pixmapdir}

# Copy source lisp files into buildroot for emacs-vm-el sub-package
(cd lisp ; install -p -m 644 *.el %{buildroot}%{pkgdir})

# Create initialization file.
install -d %{buildroot}/%{emacs_startdir}
cat > %{buildroot}/%{initfile} <<EOF
;; Startup settings for VM
(setq vm-toolbar-pixmap-directory "%{pixmapdir}")
(setq vm-image-directory "%{pixmapdir}")
(require 'vm-autoloads)

;; Settings for u-vm-color.el 
(require 'u-vm-color)
(add-hook 'vm-summary-mode-hook 'u-vm-color-summary-mode)
(add-hook 'vm-select-message-hook 'u-vm-color-fontify-buffer)

(defadvice vm-fill-paragraphs-containing-long-lines
    (after u-vm-color activate)
    (u-vm-color-fontify-buffer))
EOF

%clean
rm -rf %{buildroot}

%post 
/sbin/install-info %{_infodir}/vm.info.gz %{_infodir}/dir 2>/dev/null || :

%preun
if [ "$1" = "0" ] ; then 
 /sbin/install-info --delete %{_infodir}/vm.info.gz %{_infodir}/dir 2>/dev/null || :
fi

%files
%defattr(-,root,root,-)
%doc README COPYING
%doc %{_infodir}/*
%{_bindir}/*
%{pixmapdir}
%{pkgdir}/*.elc
%{initfile}
%dir %{pkgdir}

%files el
%defattr(-,root,root,-)
%{pkgdir}/*.el

%changelog
* Wed Dec  5 2008 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.12-3
- Add patch to make vm-decode-postponed-mime-message autoloaded (BZ 474728)

* Wed Nov 19 2008 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.12-2
- Re-add u-vm-color.el to lisp/Makefile.in
- Fix spec file typo in install command that installs the uncompiled lisp files

* Fri Nov  7 2008 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.12-1
- Update to version 8.0.12
- Remove u-vm-color.el (now included with upstream VM)
- Remove hack to add vm-revno.el to lisp files
- Drop devo number stuff, since upstream seems to have stopped using the
  revision number in the release tarball name (finally!) 

* Mon Sep 29 2008 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.11.581-2
- Add vm-revno.el to lisp files

* Sat Sep 27 2008 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.11.581-1
- Update to 8.0.11-581

* Wed Jul 30 2008 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.10.575-1
- Update to version 8.0.10-575
- Update BuildRoot to preferred mktemp variant

* Sun Mar 23 2008 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.9.544-1
- Update to 8.0.9-544
- Update u-vm-color.el to version 2.10
- Remove patch needed for 8.0.7

* Tue Feb 12 2008 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.7.522-2
- Bump release and rebuild for GCC 4.3

* Sun Jan 13 2008 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.7.522-1
- Update to version 8.0.7-522
- Add patch to fix correct display of redistributed flag (BZ #428248)

* Sun Nov 18 2007 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.5.504-2
- Add -p option to install when copying source elisp files into buildroot to
  preserve mtimes (BZ #389081)

* Sun Nov 11 2007 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.5.504-1
- Update to version 8.0.5
- Remove patch to fix Makefile from 8.0.3

* Sat Oct 13 2007 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.3.495-7
- Fix typo in emacs_startdir macro
- Add ability to build with BBDB support

* Sun Sep  9 2007 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.3.495-6
- Fix typo with start file creation

* Sun Sep  9 2007 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.3.495-5
- Add BuildRequires: emacs since emacs-el doesn't pull this in

* Sat Sep  8 2007 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.3.495-4
- Update for agreement with packaging guidelines - add versioned
  emacs requirement
- If no pkg-config is found, revert to sensible defaults

* Thu Aug 30 2007 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.3.495-3
- Fix problem with vm-autoloads.el RH BZ #262361 

* Wed Aug 22 2007 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.3.495-2
- Add BuildRequires: texinfo-tex to ensure building of pdf docs

* Tue Aug 21 2007 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.3.495-1
- Update to release 8.0.3

* Mon Aug  6 2007 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.2.482-4
- Bump release
- Fix previous changelog entry

* Sat Aug  4 2007 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.2.482-3
- Clarify license

* Wed Jul 25 2007 Jesse Keating <jkeating@redhat.com> - 8.0.2.482-2
- Rebuild for RH #249435

* Sun Jul 22 2007 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.2.482-1
- Update to bugfix release 8.0.2

* Thu Jun 28 2007 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.1.465-1
- Update to bugfix release 8.0.1 (fixes BZ #245780)

* Tue Jun 26 2007 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.0.453-1
- Ensure files in /usr/bin have exec bit set properly (BZ #245740)

* Tue Jun 19 2007 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 8.0.0.453-1
- Update to version 8.0.0 devo 453 which removes the need for thr vmrf patch
- No longer need to bundle vcard stuff as that is included upstream
- Spec file cleanups
- No longer use separate pixmaps

* Thu May 17 2007 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 7.19.devo282-11
- Fix missnaming of startup file
- Fix changelog entry

* Sun Mar 18 2007 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 7.19.devo282-10
- Fixed error in specification of Source0

* Sun Mar 18 2007 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 7.19.devo282-9
- Redefine version to include vmrf patch version (devo282)
- Remove pointless %%{pkg} macro
- Add new pixmaps with better sizing (still ugly though)
- Renamed the vmrf patch to include the version

* Sat Feb 10 2007 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 7.19-8
- Added u-vm-color.el from http://de.geocities.com/ulf_jasper/emacs.html
- Added vcard support from http://www.splode.com/users/friedman/software/emacs-lisp/
- Fixed name of info files in pre and post scripts

* Sat Feb  3 2007 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 7.19-5
- Add patch from http://www.robf.de/Hacking/elisp/ (resolves bug 224501)
- Ensure CFLAGS="$RPM_OPT_FLAGS" (bug 225101)

* Mon Aug 28 2006 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 7.19-4
- Bump release for FC-6 mass rebuild

* Tue Jun 20 2006 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 7.19-3
- Change group to Applications/Internet
- Add release tag to the Requires for the -el package

* Tue May 23 2006 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 7.19-2
- Clean up spec file

* Fri Sep  2 2005 Jonathan Underwood <jonathan.underwood@gmail.com> - 7.19-1.fc4.jgu
- Initial build
- Generate vm-mode-init.el
- Separate out *.el files into -el package
- Added patch to remove warnings in the decode and encode programs