Summary: PSGML emacs mode for SGML editing name: psgml Packager: rosalia@cygnus.com %define version 1.0.1 %define release 7 version: %{version} release: %{release} Prereq: sgml-common requires: sgml-common, emacs vendor: Cygnus Solutions Distribution: Cygnus UNSUPPORTED Internal SGML Tools copyright: Copyright (C) 1996 Karl Eichwalder, GPL # source: ftp://ftp.lysator.liu.se/pub/sgml/psgml-1.0.1.tar.gz # patch: psgml.patch source: psgml.tgz group: Applications/Editors/Emacs BuildRoot: /tmp/psgmlroot %define sgmlbase /usr %description PSGML is an emacs mode that parses SGML DTD's and lets you edit SGML files with context sensitive tag completion and automatic generation of mandatory elements. To enable it, add (load-library "psgml-init") to your .emacs file. %prep %setup -c %build # make sure we "find" etags in the installed place... cd psgml PATH=/usr/bin:$PATH ./configure make infodir=/usr/info psgmldir=/usr/share/emacs/site-lisp/psgml cat > psgml-init.el << __ELISP__ (setq load-path (append load-path '("/usr/share/emacs/site-lisp/psgml"))) (autoload 'sgml-mode "psgml" "Major mode for editing SGML." t) (if (not (getenv "SGML_CATALOG_FILES")) (defvar sgml-catalog-files '("CATALOG" "%{sgmlbase}/lib/sgml/CATALOG")) "*List of catalog entry files. The files are in the format defined in the SGML Open Draft Technical Resolution on Entity Management.") (put 'sgml-catalog-files 'sgml-type 'list) __ELISP__ %install cd psgml mkdir -p $RPM_BUILD_ROOT/usr/share/emacs/site-lisp/psgml mkdir -p $RPM_BUILD_ROOT/usr/info mkdir -p $RPM_BUILD_ROOT%{sgmlbase}/lib/sgml/cdtd touch $RPM_BUILD_ROOT/usr/info/dir make install infodir=$RPM_BUILD_ROOT/usr/info psgmldir=$RPM_BUILD_ROOT/usr/share/emacs/site-lisp/psgml rm $RPM_BUILD_ROOT/usr/info/dir cp psgml-init.el $RPM_BUILD_ROOT/usr/share/emacs/site-lisp/ %post install-info --info-dir=/usr/info /usr/info/psgml.info install-info --info-dir=/usr/info /usr/info/psgml-api.info SS=/usr/share/emacs/site-lisp/site-start.el # must version the load since the old postun runs *after* the new post... V=%{version}-%{release} if grep -q psgml-auto-setup-$V $SS then echo "psgml already in $SS" else echo "adding psgml hook to $SS" echo '(load "psgml-init") ;; psgml-auto-setup-$V' >> $SS fi %postun install-info --info-dir=/usr/info --delete /usr/info/psgml.info install-info --info-dir=/usr/info --delete /usr/info/psgml-api.info SS=/usr/share/emacs/site-lisp/site-start.el if grep -q psgml-auto-setup-1 $SS then echo "clearing psgml-init reference from $SS" grep -v psgml-auto-setup-1 $SS > $SS.new mv $SS.new $SS fi V=%{version}-%{release} if grep -q psgml-auto-setup-$V $SS then echo "clearing psgml-init reference from $SS" grep -v psgml-auto-setup-$V $SS > $SS.new mv $SS.new $SS fi %files %doc psgml/psgml.ps psgml/README.psgml /usr/share/emacs/site-lisp/psgml/* /usr/share/emacs/site-lisp/psgml-init.el /usr/info/psgml* %{sgmlbase}/lib/sgml/cdtd