diff --git a/a2ps.spec b/a2ps.spec index 3bfe0ac..f8f721c 100644 --- a/a2ps.spec +++ b/a2ps.spec @@ -1,7 +1,19 @@ +# emacs packaging macros +%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 + + Summary: Converts text and other types of files to PostScript(TM) Name: a2ps Version: 4.13b -Release: 70%{?dist} +Release: 71%{?dist} License: GPLv2+ Group: Applications/Publishing #Source0: ftp://ftp.enst.fr/pub/unix/a2ps/%{name}-%{version}.tar.gz @@ -46,7 +58,7 @@ Patch30: a2ps-psset.patch Patch31: a2ps-mb.patch Patch34: a2ps-external-libtool.patch Requires: fileutils sh-utils info -BuildRequires: emacs, flex, libtool, texinfo, groff +BuildRequires: emacs, emacs-el, flex, libtool, texinfo, groff BuildRequires: ImageMagick BuildRequires: groff-perl BuildRequires: cups @@ -56,7 +68,6 @@ BuildRequires: psutils, tetex-dvips, texinfo, tetex-latex #BuildRequires: gv Url: http://www.inf.enst.fr/~demaille/a2ps/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Requires: %{name}-libs = %{version}-%{release} Requires: psutils, ImageMagick, texinfo-tex, gzip, bzip2, groff-perl Requires: tetex-dvips, tetex-latex, tetex-fonts, file Requires(post): coreutils @@ -66,10 +77,16 @@ Obsoletes: a2ps-i18n <= 0.1-1 Provides: a2ps-i18n = 0.1-1 -%package libs -Summary: a2ps libraries -Group: System Environment/Libraries -License: GPLv2+ +%package -n emacs-%{name} +Summary: Emacs bindings for a2ps files +Group: Applications/Editors +Requires: emacs(bin) >= %{emacs_version} + + +%package -n emacs-%{name}-el +Summary: Elisp source files for emacs-%{name} under GNU Emacs +Group: Applications/Editors +Requires: emacs-%{name} = %{version}-%{release} %description @@ -79,12 +96,19 @@ number of programming languages, encodings (ISO Latins, Cyrillic, etc.), and medias. -%description libs -The libraries for a2ps. +%description -n emacs-%{name} +Postscript printing hook for a2ps and major mode for a2ps style sheets +for emacs. + + +%description -n emacs-%{name}-el +This package contains the elisp source files for emacs-%{name} under GNU +Emacs. You do not need to install this package to run emacs-%{name}. Install +the emacs-%{name} package to use emacs-%{name} with GNU Emacs. + %prep %setup -q -n %{name}-4.13 -a 1 -exit 1 # use __timestamp_configure.in to hold the configure.in timestamp touch -r configure.in __timestamp_configure.in @@ -177,6 +201,11 @@ touch -r etc/Makefile.am.etc etc/Makefile.am touch -r fonts/Makefile.in src/Makefile.in etc/Makefile.in lib/Makefile.in %build +# preset the date in README.in to avoid the timestamp of the build time +sed -e "s!@date@!`date -r NEWS`!" etc/README.in > etc/README.in.tmp +touch -r etc/README.in etc/README.in.tmp +mv etc/README.in.tmp etc/README.in + chmod 644 {po/ja.po,encoding/euc-jp.edf,README.eucJP}.euc chmod 644 encoding/euc-kr.edf.euckr EMACS=emacs %configure \ @@ -200,7 +229,10 @@ make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags} %install rm -rf %{buildroot} -make DESTDIR=%{buildroot} install +make DESTDIR=%{buildroot} install INSTALL='install -p' + +# reset the timestamp for the generated etc/README file +touch -r etc/README.in %{buildroot}%{_datadir}/a2ps/README mkdir -p %{buildroot}%{_sysconfdir}/a2ps @@ -212,14 +244,6 @@ install -p -m 0644 *.pfb %{buildroot}%{_datadir}/a2ps/fonts popd popd -### FIXME ### -inst() -{ -mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp/ -for f in contrib/emacs/*.el; do \ - install -p -m 0644 $f %{buildroot}%{_datadir}/emacs/site-lisp/ ; done -} - # Don't ship the library file or header (bug #203536). rm -f %{buildroot}%{_libdir}/*.{so,a,la} rm -f %{buildroot}%{_includedir}/* @@ -275,15 +299,23 @@ exit 0 %{_datadir}/a2ps/ps %{_datadir}/a2ps/sheets %{_datadir}/ogonkify/ -%{_datadir}/emacs/site-lisp/* %dir %{_datadir}/a2ps/afm %dir %{_datadir}/a2ps - -%files libs -%defattr(-,root,root) %{_libdir}/*.so* +%files -n emacs-%{name} +%defattr(-,root,root,-) +%{emacs_lispdir}/*.elc + +%files -n emacs-%{name}-el +%defattr(-,root,root,-) +%{emacs_lispdir}/*.el + %changelog +* Tue Feb 12 2008 Patrice Dumas 4.13b-71 +- use a predictable stamp inside the etc/README file +- follow emacs packaging guidelines + * Tue Feb 12 2008 Tim Waugh 4.13b-70 - Separate out libs sub-package for multilib (bug #340571).