[sagemath] 01/01: Add sagetex to Build-Depends + pruner support
Jerome Benoit
calculus-guest at moszumanska.debian.org
Fri Aug 19 01:12:45 UTC 2016
This is an automated email from the git hooks/post-receive script.
calculus-guest pushed a commit to branch master
in repository sagemath.
commit 8e7d851d7f2413929a4d28af1c305fca139e2d17
Author: Jerome Benoit <calculus at rezozer.net>
Date: Fri Aug 19 02:11:46 2016 +0100
Add sagetex to Build-Depends + pruner support
---
debian/control | 1 +
debian/pruner/configure.ac | 4 +-
debian/pruner/m4/_ac_latex_test.m4 | 46 ++++++++++++++++++++
debian/pruner/m4/ac_latex_class.m4 | 69 ++++++++++++++++++++++++++++++
debian/pruner/m4/ac_latex_package.m4 | 83 ++++++++++++++++++++++++++++++++++++
debian/pruner/m4/ac_prog_latex.m4 | 41 ++++++++++++++++++
debian/pruner/m4/sagetex.m4 | 5 +++
7 files changed, 247 insertions(+), 2 deletions(-)
diff --git a/debian/control b/debian/control
index c575845..bda9478 100644
--- a/debian/control
+++ b/debian/control
@@ -160,6 +160,7 @@ Build-Depends:
sagemath-database-graphs,
sagemath-database-mutually-combinatorial-designs,
sagemath-database-polytopes,
+ sagetex,
scons,
sqlite3,
sympow,
diff --git a/debian/pruner/configure.ac b/debian/pruner/configure.ac
index 8ec8435..f8ec873 100644
--- a/debian/pruner/configure.ac
+++ b/debian/pruner/configure.ac
@@ -2,6 +2,7 @@ AC_INIT()
m4_include([/usr/share/aclocal/pkg.m4])
m4_include([m4/python_module.m4])
+m4_include([m4/sagetex.m4])
AC_ARG_WITH([sage-root],
[ --with-sage-root=<path> path to where sage is unpacked],
@@ -288,8 +289,7 @@ AC_SUBST(HAS_RUBIKS)
AC_CHECK_HEADERS(rw.h, HAS_RW="True", HAS_RW="False")
AC_SUBST(HAS_RW)
-# FIXME(sagetex): doesn't install, but low priority
-HAS_SAGETEX="True"
+AC_LATEX_PACKAGE(sagetex, article, has_sagetex_yesno, HAS_SAGETEX="True", HAS_SAGETEX="False")
AC_SUBST(HAS_SAGETEX)
AC_CHECK_PROG(HAS_SCONS, scons, "True", "False")
diff --git a/debian/pruner/m4/_ac_latex_test.m4 b/debian/pruner/m4/_ac_latex_test.m4
new file mode 100644
index 0000000..ceee723
--- /dev/null
+++ b/debian/pruner/m4/_ac_latex_test.m4
@@ -0,0 +1,46 @@
+#
+# Copyright (C) 2004 Boretti Mathieu
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+#
+# Internal macro to test a latex file
+#
+
+AC_DEFUN([_AC_LATEX_TEST],[
+AC_REQUIRE([AC_PROG_LATEX])
+rm -rf .tmps_latex
+mkdir .tmps_latex
+cd .tmps_latex
+ifelse($#,2,[
+$2="no"; export $2;
+cat > testconf.tex << \EOF
+$1
+EOF
+],$#,3,[
+echo "\\documentclass{$3}" > testconf.tex
+cat >> testconf.tex << \EOF
+$1
+EOF
+],$#,4,[
+echo "\\documentclass{$3}" > testconf.tex
+echo "\\usepackage{$4}" > testconf.tex
+cat >> testconf.tex << \EOF
+$1
+])
+cat testconf.tex | $latex 2>&1 1>/dev/null && $2=yes; export $2;
+cd ..
+rm -rf .tmps_latex
+])
diff --git a/debian/pruner/m4/ac_latex_class.m4 b/debian/pruner/m4/ac_latex_class.m4
new file mode 100644
index 0000000..61c571a
--- /dev/null
+++ b/debian/pruner/m4/ac_latex_class.m4
@@ -0,0 +1,69 @@
+#
+# Copyright (C) 2004 Boretti Mathieu
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+#
+# AC_LATEX_CLASS(<class>,<variable>)
+#
+# Test the presences of class and set $<variable>
+# to yes or no
+#
+#
+dnl @synopsis AC_LATEX_CLASSE(<class1>,<var>)
+dnl
+dnl Test if class1 exists
+dnl and set $var to the right value
+dnl
+dnl AC_LATEX_CLASSES([book],book)
+dnl should set $book="yes"
+dnl
+dnl AC_LATEX_CLASSES(allo,book)
+dnl should set $book="no"
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti at eig.unige.ch
+dnl
+AC_DEFUN([AC_LATEX_CLASS],[
+AC_CACHE_CHECK([for class $1],[ac_cv_latex_class_]translit($1,[-],[_]),[
+_AC_LATEX_TEST([
+\begin{document}
+\end{document}
+],[ac_cv_latex_class_]translit($1,[-],[_]),$1)
+])
+$2=$[ac_cv_latex_class_]translit($1,[-],[_]) ; export $2;
+AC_SUBST($2)
+ifelse($#,2,[],$#,3,[
+ if test "[$]$2" = "yes" ;
+ then
+ $3
+ fi
+],$#,4,[
+ ifelse($3,[],[
+ if test "[$]$2" = "no" ;
+ then
+ $4
+ fi
+ ],[
+ if test "[$]$2" = "yes" ;
+ then
+ $3
+ else
+ $4
+ fi
+ ])
+])
+
+])
\ No newline at end of file
diff --git a/debian/pruner/m4/ac_latex_package.m4 b/debian/pruner/m4/ac_latex_package.m4
new file mode 100644
index 0000000..c303608
--- /dev/null
+++ b/debian/pruner/m4/ac_latex_package.m4
@@ -0,0 +1,83 @@
+#
+# Copyright (C) 2004 Boretti Mathieu
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+#
+# AC_LATEX_PACKAGE([<packagen>],<class>,<variable>)
+#
+# Test the presences of package and set $<variable>
+# to yes or no
+#
+#
+dnl @synopsis AC_LATEX_PACKAGE(<package>,<class>,<variable>)
+dnl
+dnl This macro test if package in <class> exists
+dnl and set <variable> to the right value
+dnl
+dnl AC_LATEX_PACKAGE(varioref,book,vbook)
+dnl should set $vbook="yes"
+dnl
+dnl AC_LATEX_PACKAGE(xyz,book,vbook)
+dnl should set $vbook="no"
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti at eig.unige.ch
+dnl
+
+AC_DEFUN([AC_LATEX_PACKAGE],[
+if test "$[ac_cv_latex_class_]translit($2,[-],[_])" = "" ;
+then
+ AC_LATEX_CLASS($2,boretti_classesansparametre)
+ export boretti_classesansparametre;
+else
+ boretti_classesansparametre=$[ac_cv_latex_class_]translit($2,[-],[_]) ;
+ export boretti_classesansparemetre;
+fi;
+if test $boretti_classesansparametre = "no" ;
+then
+ AC_MSG_ERROR([Unable to find $2 class])
+fi
+AC_CACHE_CHECK([for $1 in class $2],[ac_cv_latex_]translit($1,[-],[_])[_]translit($2,[-],[_]),[
+_AC_LATEX_TEST([
+\documentclass{$2}
+\usepackage{$1}
+\begin{document}
+\end{document}
+],[ac_cv_latex_]translit($1,[-],[_])[_]translit($2,[-],[_]))
+])
+$3=$[ac_cv_latex_]translit($1,[-],[_])[_]translit($2,[-],[_]); export $3;
+AC_SUBST($3)
+ifelse($#,3,[],$#,4,[
+ if test "[$]$3" = "yes" ;
+ then
+ $4
+ fi
+],$#,5,[
+ ifelse($4,[],[
+ if test "[$]$3" = "no" ;
+ then
+ $5
+ fi
+ ],[
+ if test "[$]$3" = "yes" ;
+ then
+ $4
+ else
+ $5
+ fi
+ ])
+])
+])
diff --git a/debian/pruner/m4/ac_prog_latex.m4 b/debian/pruner/m4/ac_prog_latex.m4
new file mode 100644
index 0000000..7204471
--- /dev/null
+++ b/debian/pruner/m4/ac_prog_latex.m4
@@ -0,0 +1,41 @@
+#
+# Copyright (C) 2004 Boretti Mathieu
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+#
+# AC_PROG_LATEX
+#
+# Test for latex or elatax or lambda
+# and set $latex to the correct value.
+#
+#
+dnl @synopsis AC_PROG_LATEX
+dnl
+dnl This macro test if latex is installed. If latex
+dnl is installed, it set $latex to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti at eig.unige.ch
+dnl
+AC_DEFUN([AC_PROG_LATEX],[
+AC_CHECK_PROGS(latex,[latex elatex lambda],no)
+export latex;
+if test $latex = "no" ;
+then
+ AC_MSG_ERROR([Unable to find a LaTeX application]);
+fi
+AC_SUBST(latex)
+])
diff --git a/debian/pruner/m4/sagetex.m4 b/debian/pruner/m4/sagetex.m4
new file mode 100644
index 0000000..f07d70d
--- /dev/null
+++ b/debian/pruner/m4/sagetex.m4
@@ -0,0 +1,5 @@
+m4_include(ac_prog_latex.m4)
+m4_include(_ac_latex_test.m4)
+m4_include(ac_latex_class.m4)
+m4_include(ac_latex_package.m4)
+dnl vim:syntax=m4
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagemath.git
More information about the debian-science-commits
mailing list