# 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 lispdir %{emacs_lispdir}/bbdb %define texdir %{_datadir}/texmf/tex/generic/bbdb # Note on building bbdb with support for VM: 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 vmsupport 1 Name: emacs-bbdb Version: 2.35 Release: 8%{?dist} Summary: A contact management utility for use with Emacs Group: Applications/Internet License: GPLv2+ URL: http://bbdb.sourceforge.net/ Requires: emacs(bin) >= %{emacs_version} Source0: http://bbdb.sourceforge.net/bbdb-2.35.tar.gz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: emacs emacs-el texinfo-tex %if %{vmsupport} BuildRequires: emacs-vm-el %endif %description The Insidious Big Brother Database (BBDB) is a contact management utility created by Jamie Zawinski for use with Emacs. It is tightly integrated with several mail and news readers, allowing it to create database entries directly from mail and news messages. As is usual with applications for Emacs, this record creation can be configured in many ways, ranging from a boolean create/don't create setting to creation based on the result of a user-supplied function. Database records can be used to store many types of information, from name and address to URLs and X-Face images. This information can be displayed when a message from an entity named in a database record is received. In addition, messages from database members can be tagged in the Gnus Summary Buffer, and Gnus scoring can be configured based on the contents of database records. Supercite citations can even be preset through the use of records in the BBDB. %package -n %{name}-el Summary: Lisp source files for bbdb for Emacs Group: Applications/Internet Requires: %{name} = %{version}-%{release} %description -n %{name}-el This package contains the Emacs lisp source files for %{name}. %prep %setup -q -n bbdb-%{version} # Correct encoding of info file and ChangeLog for i in texinfo/bbdb.texinfo ChangeLog ; do iconv --from=ISO-8859-1 --to=UTF-8 $i > $i.new mv $i.new $i done %build %configure # Note: make %{?_smp_mflags} all fails. make all %install rm -rf $RPM_BUILD_ROOT # There is no usable install make rule - install by hand. install -d $RPM_BUILD_ROOT%{lispdir} install -p -m 0644 lisp/*.{elc,el} $RPM_BUILD_ROOT%{lispdir} install -d $RPM_BUILD_ROOT%{texdir} install -p -m 0644 tex/*.tex $RPM_BUILD_ROOT%{texdir} install -d $RPM_BUILD_ROOT%{_infodir} install -p -m 0644 texinfo/bbdb.info $RPM_BUILD_ROOT%{_infodir} # Create and install init file install -d $RPM_BUILD_ROOT%{emacs_startdir} cat > $RPM_BUILD_ROOT%{emacs_startdir}/bbdb-mode-init.el << EOF (require 'bbdb-autoloads) EOF # Remove some unpackaged files rm -f bits/make.bat rm -f utils/Makefile* # The perl scripts in the utils directory are packaged as docs, and so chmod -x # them. Also correct the hash-bang. find -name '*.pl' -exec chmod -x {} \; find -name '*.pl' -exec sed -i -e 's|#![a-z/]*|/usr/bin/perl|g' {} \; %clean rm -rf $RPM_BUILD_ROOT %post /sbin/install-info %{_infodir}/bbdb.info %{_infodir}/dir 2>/dev/null || : %preun if [ $1 -eq 0 ]; then /sbin/install-info --delete %{_infodir}/bbdb.info %{_infodir}/dir 2>/dev/null || : fi %files %defattr(-,root,root,-) %doc bits misc utils ChangeLog %doc %{_infodir}/bbdb.info.gz %{lispdir}/*.elc %{texdir}/*.tex %{emacs_startdir}/bbdb-mode-init.el %dir %{lispdir} %files el %defattr(-,root,root,-) %{lispdir}/*.el %changelog * Fri Sep 28 2007 Jonathan G. Underwood - 2.35-8 - Correct encoding of ChangeLog and info files - Correct hash bang in perl scripts which are installed as docs - correct spelling mistake in description * Sun Sep 9 2007 Jonathan G. Underwood - 2.35-7 - Add init file * Sun Sep 9 2007 Jonathan G. Underwood - 2.35-6 - Add sensible defaults for the case that there is no Emacs pkg-config file at build time * Thu Sep 6 2007 Jonathan G. Underwood - 2.35-5 - Add changes to comply with Emacs add-on packaging guidelines * Tue May 29 2007 Jonathan G. Underwood - 2.35-4 - Add BuildRequires: emacs-vm-el - Add macro to determine emacsversion at package build time - Add Requires emacs-common >= emacsversion - Add notes about bootstrapping with VM to top of spec file * Mon May 7 2007 Jonathan G. Underwood - 2.35-3 - Convert info file to correct encoding (Tom Tromey) - Use install rather than mkdir and cp to install files * Sat Feb 10 2007 Jonathan G. Underwood - 2.35-2 - Added Requires: tetex, since bbd-print requires TeX to be installed * Sat Feb 3 2007 Jonathan G. Underwood - 2.35-1 - Initial package