# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit elisp versionator PV_A=($(get_version_components)) # 4.5.1-r3 -> 4.51 MY_P="${PN}-${PV_A[0]}.${PV_A[1]}${PV_A[2]}" FLK=2.6a ADF=0.1 DESCRIPTION="X-Symbol package for XEmacs (semi WYSIWYG for LaTeX, HTML)" HOMEPAGE="http://x-symbol.sourceforge.net" SRC_URI="mirror://sourceforge/${PN}/${MY_P}-src.tar.gz mirror://sourceforge/${PN}/x-font-lock-${FLK}.tar.gz mirror://sourceforge/${PN}/${PN}-additional-fonts-${ADF}.tar.gz" LICENSE="GPL" SLOT="0" KEYWORDS="x86 ~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc" IUSE="examples doc" DEPEND="virtual/emacs" RDEPEND=" ${DEPEND} sys-apps/sed x11-apps/bdftopcf x11-apps/mkfontdir dev-lang/perl doc? (virtual/latex-base sys-apps/texinfo app-text/texi2html)" S="${WORKDIR}/${PN}" SITEFILE=79${PN}-gentoo.el DATADIR="${SITELISP}/${PN}/etc" src_unpack() { cd "${S}" unpack "${MY_P}-src.tar.gz" unpack "x-font-lock-${FLK}.tar.gz" } src_compile() { if true ; then cd "${S}"/lisp sed -i -e "s/# install_el/install_el #/" \ -e "/echo [^'].*elcdir/s/[\$](elcdir)/@SITELISP@/" Makefile fi if true ; then cd "${S}"/../x-font-lock/lisp elisp-compile x-font-lock.el || die "x-font-lock.el compile failed" fi if true ; then cd "${S}"/fonts sed -i -e "s/-xset/-echo xset/" Makefile emake all || die "making fonts failed" fi if use doc ; then cd "${S}"/man sed -i -e "s/ x-symbol.init/# x-symbol.init/" Makefile has_version > ${startupfile} fi elisp-site-file-install "${startupfile}" || die "installing site file failed" if true ; then cd "${S}"/.. elisp-install "${PN}" x-font-lock/lisp/x-font-lock.el{,c} || die "installing x-font-lock failed" fi if true ; then cd "${S}" dodir "${SITELISP}/etc/${PN}" || die "creating data-directory failed" insinto "${DATADIR}" doins etc/* || die "copying data-directory failed" for d in {,orig,gen}fonts pcf; do dodir "${DATADIR}/${d}" || die "creating fonts' data-directories failed" insinto "${DATADIR}/${d}" doins ${d}/* || die "copying ${d} fonts' directory failed" done fi if use doc ; then cd "${S}"/man { \ doinfo ${PN}.info; \ dodoc ${PN}.{pdf,ps,texi}; \ dohtml ${PN}/*.html; \ dodoc ../ChangeLog* ../README; \ } || die "copying documentation failed" fi if use examples ; then dodoc "${S}/lisp/x-symbol-site.el" || die "copying an example initialisation file failed" fi if true ; then insinto "/usr/share/doc/${PF}" doins "${DISTDIR}/${PN}-additional-fonts-${ADF}.tar.gz" || die "copying additional fonts failed" fi } pkg_postinst() { elisp-site-regen einfo einfo "To enable X-Symbol on Emacs startup, add" einfo " (require 'x-symbol-hooks)" einfo " (x-symbol-initialize)" einfo " (require 'x-font-lock)" einfo "to your ~/.emacs file." einfo einfo "There are additional fonts you may use in" einfo "/usr/share/doc/${PF}/${PN}-additional-fonts-${ADF}.tar.gz" if use doc ; then elog elog "You may consult /usr/share/doc/${PF}" elog "for further documentation on X-Symbol." elog "Or point your browser to /usr/share/doc/${PF}/html/index.html." elog "There is also an info page available: do \`info ${PN}'." fi if use examples ; then elog elog "Please visit /usr/share/doc/${PF}/x-symbol-site.el" elog "for how to configure X-Symbol from your ~/.emacs file." fi einfo }