--- /dev/null
+;; site-init for pariemacs
+
+(add-to-list 'load-path "/usr/share/emacs/site-lisp/pariemacs")
+(autoload 'gp-mode "pari" nil t)
+(autoload 'gp-script-mode "pari" nil t)
+(autoload 'gp "pari" nil t)
+(autoload 'gpman "pari" nil t)
--- /dev/null
+diff -r -U2 pariemacs.orig/Makefile pariemacs/Makefile
+--- pariemacs.orig/Makefile 2017-12-05 18:54:54.000000000 +0700
++++ pariemacs/Makefile 2018-01-13 19:15:31.095946659 +0700
+@@ -5,19 +5,8 @@
+
+ # Path to pari.cfg file.
+-# Several possibilites:
+-PARI_CFG=/usr/local/lib/pari/pari.cfg
+-# For Debian (package "libpari-dev") install:
+-#PARI_CFG=/usr/lib/pari/pari.cfg
+-# For some other install, the architecture is mentioned
+-# (see https://wiki.ubuntu.com/MultiarchSpec):
+-#PARI_CFG=/usr/lib/i386-linux-gnu/pari/pari.cfg
+-#PARI_CFG=/usr/lib/x86_64-linux-gnu/pari/pari.cfg
+-
+-# In case, you cannot find it, you can use the following default file
+-# (but edit this file first):
+-#PARI_CFG=./pari.cfg-default
++PARI_CFG=./pari.cfg
+
+ # Where to install ourselves ?
+-INSTALL=/usr/local/share/emacs/site-lisp/pari
++INSTALL=/usr/share/emacs/site-lisp/pari
+
+ # Path to 'emacs' binary
+@@ -34,8 +23,4 @@
+ TARFILE=$(DIR).tar
+
+-install: pari-conf.el elc
+- mkdir -p $(INSTALL)
+- cp *.elc *.el README CHANGES COPYING $(INSTALL)
+-
+ pari-conf.el:
+ @if test ! -f $(PARI_CFG); then \
+@@ -52,16 +37,4 @@
+ -f batch-byte-compile *.el
+
+-distrib:
+- @if test -d $(DIR); then \
+- echo "Remove $(DIR) before building a new release"; exit 1; \
+- fi
+- @tar cf $(TARFILE) $(FILES)
+- @mkdir $(DIR) && mv $(TARFILE) $(DIR)
+- @cd $(DIR) && tar xf $(TARFILE) && rm -f $(TARFILE)
+- @tar cf $(TARFILE) $(DIR)
+- @rm -rf $(DIR)
+- @rm -f $(TARFILE).gz
+- @gzip $(TARFILE)
+-
+ clean:
+ rm -f *.elc pari-conf.el
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci-mathematics@gentoo.org</email>
+ <name>Gentoo Mathematics Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ Emacs modes to edit gp scripts and to run gp in emacs.
+ </longdescription>
+</pkgmetadata>
--- /dev/null
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit elisp
+
+DESCRIPTION="sci-mathematics/pari emacs mode"
+HOMEPAGE="http://iml.univ-mrs.fr/~ramare/ServeurPerso/GP-PARI/"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+SRC_URI="http://iml.univ-mrs.fr/~ramare/ServeurPerso/GP-PARI/latest-pari-distrib/${P}.tar.gz"
+
+RDEPEND="sci-mathematics/pari"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}"
+SITEFILE="64${PN}-gentoo.el"
+DOCS="README CHANGES"
+
+src_prepare() {
+ eapply "${FILESDIR}"/${P}-makefile.patch
+ eapply_user
+ cp /usr/share/doc/pari-*/pari.cfg.bz2 . || die "pari.cfg.bz2 not found"
+ bunzip2 pari.cfg.bz2
+}
+
+src_compile() {
+ make pari-conf.el
+ make elc
+}