source: branches/4.x/mktar @ 711

Last change on this file since 711 was 711, checked in by cito, 3 years ago

Flatten the directory structure of the project

Simplified the directory structure by flattening the "module" subdirectory out
to the root directory. That way, the setup.py script can now also access the
top-level docs subdirectory, so it could also install or build the docs.
There was nothing else in the root directory anyway, except the mkdocs and
mktar scripts which could be made unnecessary through setup.py.

Also made the setup script a bit clearer. Removed the note about MinGW for
Windows since the Microsoft compiler for Python 2.7 and Visual Studio Community
are now freely available including 64bit compilers, and produce less problems.

Note that the usual structure would have been to use a "pygresql" package
directory instead of the "module" directory. But since we install PyGreSQL
as two top-level modules "pg" and "pgdb" instead of a package "pygresql",
the flattened structure reflects that much better. For historical reasons
and people don't want to rewrite import statements, we will keep it that way.

  • Property svn:executable set to *
File size: 1.3 KB
Line 
1#! /bin/sh
2
3VERSION=4.2
4DISTDIR=/u/pyg/files
5
6# small safety tests
7if [ ! -f module/pgmodule.c ]
8then
9        echo "Hmmm.  Are you sure you are in the right directory?"
10        exit 1
11fi
12if [ ! -d $DISTDIR ]
13then
14        echo "Hmmm.  Are you sure you are on the right server?"
15        exit 1
16fi
17
18if [ -f BETA ]
19then
20        VERSION=$VERSION-pre`date +"%y%m%d"`
21        PACKAGE=pygresql.pkg-beta
22        SYMLINK=PyGreSQL-beta.tgz
23else
24        PACKAGE=pygresql.pkg
25        SYMLINK=PyGreSQL.tgz
26fi
27
28# Package up as a source tarball in the distribution directory.
29# Note that this does essentially the same as "python setup.py sdist",
30# except this also makes the docs and bundles them as source and html.
31
32TD=PyGreSQL-$VERSION
33TF=$DISTDIR/$TD.tgz
34
35MODFILES="pg.py pgdb.py pgmodule.c
36          pgfs.h pgtypes.h
37          setup.py setup.cfg"
38DOCFILES="docs/Makefile docs/make.bat docs/*.rst
39          docs/contents docs/download docs/community
40          docs/_static docs/_templates"
41HTMLFILES="docs/_build/html"
42TESTFILES="tests/*.py"
43
44echo "Making source tarball..."
45
46./mkdocs
47
48rm -rf $TD
49mkdir $TD
50mkdir -p $TD/docs/_build/html
51mkdir $TD/tests
52cp $MODFILES $TD
53cp -r $DOCFILES $TD/docs
54cp -r $HTMLFILES $TD/docs/_build
55cp $TESTFILES $TD/tests
56tar -cvzf $TF $TD
57chmod 644 $TF
58rm -rf $TD
59rm -f $DISTDIR/$SYMLINK
60ln -s $TD.tgz $DISTDIR/$SYMLINK
61
62echo "$TF has been built"
Note: See TracBrowser for help on using the repository browser.