Commits

Anonymous committed 5a1e5e0

"spkg-ification"

  • Participants
  • Parent commits 3193b70
  • Branches main

Comments (0)

Files changed (7)

 extractsagecode.py
 sagetexparse.py
 auto/*.el
+dist/*
+MANIFEST
+include example.pdf
+include example.tex
+include extractsagecode.py
+include makestatic.py
+include sagetexpackage.dtx
+include sagetexpackage.ins
+include sagetexpackage.pdf
+include sagetexparse.py
+include sagetex.sty
+include README.spkg
+include spkg-install
 pkg=sagetexpackage
 dest=/home/drake/texmf/tex/latex/sagetex/
+# the subdir stuff makes the tarball have the directory correct
+srcs=../sagetex/example.tex ../sagetex/README ../sagetex/sagetexpackage.dtx ../sagetex/sagetexpackage.ins
+ver=2.0
 
 all: ins
 	latex $(pkg).dtx
 
 clean: 
 	latexcleanup clean .
-	rm -fr sage-plots-for-* E2.sobj *.pyc sagetex.tar.gz sagetex.py sagetex.pyc sagetex.sty makestatic.py sagetexparse.py extractsagecode.py
+	rm -fr sage-plots-for-* E2.sobj *.pyc sagetex.tar.gz sagetex.py sagetex.pyc sagetex.sty makestatic.py sagetexparse.py extractsagecode.py dist MANIFEST
 
 install:
 	cp sagetex.py $(dest)
 	    -e 's|directory with sagetex.py|$(dest)|'\
 		-e '50,55 s/\\fi//' sagetex.sty > $(dest)/sagetex.sty
 
-dist: all
+# make a tarball suitable for CTAN uploads, or for someone who knows how
+# to handle .dtx files
+ctandist: all
 	@echo
 	@echo Did you turn off Imagemagick in example.tex?
 	@echo
-	@tar zcf sagetex.tar.gz ../sagetex/example.pdf ../sagetex/example.tex ../sagetex/README ../sagetex/sagetexpackage.dtx ../sagetex/sagetexpackage.ins ../sagetex/sagetexpackage.pdf
+	tar zcf sagetex.tar.gz $(srcs) ../sagetex/example.pdf ../sagetex/sagetexpackage.pdf
+
+# make a spkg for Sage
+spkg:
+	python setup.py sdist
+	cd dist
+	gunzip dist/sagetex-$(ver).tar.gz
+	bzip2 dist/sagetex-$(ver).tar
+	cp dist/sagetex-$(ver).tar.bz2 dist/sagetex-$(ver).spkg
+This is the SageTeX package. It allows you to embed code, results of
+computations, and plots from the Sage mathematics software suite
+(http://sagemath.org) into LaTeX documents.
+====================================================================
+
+If you're reading this, you already have Sage, so if you also have TeX
+installed, you are ready to use SageTeX!
+
+To install SageTeX, you need only make the necessary files available to
+TeX; Sage already has the necessary bits built in. The easiest thing to
+do is copy this directory to a texmf directory in your home directory;
+something like this for Linux/Unix users:
+
+  cp -r $SAGE_ROOT/local/share/texmf/ $HOME/texmf/
+
+For OS X users with TeXLive:
+
+  cp -r $SAGE_ROOT/local/share/texmf/ $HOME/Library/texmf/
+
+I don't use Windows, so I don't know what MiKTeX users should do. Let me
+know and I'll add it here!
+
+After you've copied over the necessary files, you'll need to update
+TeX's database so that it can find them. Run "texhash $HOME/texmf"
+(replace the texmf directory as appropriate) to do this.
+
+Now check out the PDF files in this directory for more information on
+using SageTeX. If you have problems or suggestions see the sage-support
+group (http://groups.google.com/group/sage-support).
+
+Enjoy!
+
+Dan Drake
-* should I switch over entirely to the Sweave strategy, where we parse a
-  file into LaTeX format?
-
-* hyperlinks in documentation between LaTeX and Python functions that
-  are interdependent
-
 * What about graphs and TikZ?
 
 * desagetexparser -- leave Sage commands in as comments? document usage!
 
 * UPDATE v2.0 date in .dtx file when it's ready!
 
-* Jason's suggestions from September
+* finish spkg-ification; don't include CTAN readme, make up a
+  README.spkg
+from distutils.core import setup
+setup(name='sagetex',
+      description='Embed Sage code and plots into LaTeX',
+      long_description="""The SageTeX package allows you to embed code,
+  results of computations, and plots from the Sage mathematics
+  software suite (http://sagemath.org) into LaTeX documents.""",
+      version='2.0',
+      author='Dan Drake',
+      author_email='ddrake@member.ams.org',
+      url='http://mathsci.kaist.ac.kr/~drake',
+      license='GPLv2+',
+      py_modules=['sagetex'],
+      data_files = [('share/texmf/tex/generic/sagetex',
+        ['example.pdf',
+         'example.tex',
+         'extractsagecode.py',
+         'makestatic.py',
+         'sagetexpackage.dtx',
+         'sagetexpackage.ins',
+         'sagetexpackage.pdf',
+         'sagetexparse.py',
+         'sagetex.sty',
+         'README.spkg'])])
+
+

File spkg-install

+#!/usr/bin/env bash
+
+if [ "$SAGE_LOCAL" = "" ]; then
+   echo "SAGE_LOCAL undefined ... exiting";
+   echo "Maybe run 'sage -sh'?"
+   exit 1
+fi
+
+python setup.py install
+
+if [ $? -ne 0 ]; then
+   echo "Error installing SageTeX."
+   exit 1
+fi
+