source: trunk/mktar

Last change on this file was 1007, checked in by darcy, 2 months ago

Typo. Number is 15, not 13.

  • Property svn:executable set to *
File size: 1.8 KB
RevLine 
[969]1#!/bin/sh
[178]2
[960]3VERSION=5.1
[864]4DISTDIR=/u/WEB/pyg/files
[178]5
[783]6# some safety tests
7if [ ! -d $DISTDIR ]
[178]8then
[783]9        echo "Hmmm.  Are you sure you are on the right server?"
[178]10        exit 1
11fi
[783]12if [ ! -f setup.py -o ! -f pgmodule.c -o ! -d tests -o ! -d docs ]
[710]13then
[783]14        echo "Hmmm.  Are you sure you are in the right directory?"
[710]15        exit 1
16fi
[783]17FILES="*.c *.h *.py *.cfg *.rst *.txt"
18NUMFILES=`ls $FILES | wc -l`
[1007]19if [ $NUMFILES != 15 ]
[783]20then
21    echo "Hmmm.  The number of top-level files seems to be wrong:"
22    ls $FILES
23    echo "Maybe you should do a clean checkout first."
24    echo "If something has changed, edit MANIFEST.in and mktar."
25    exit 1
26fi
27FILES="mktar mkdocs docs tests pg.py pgdb.py pgmodule.c setup.cfg"
28PERMS=`stat --printf="%a" $FILES`
[855]29if [ $? -eq 0 -a "$PERMS" != '755755755755644644644644' ]
[783]30then
31    echo "Hmmm.  File permissions are not set properly."
32    echo "Use a filesystem with permissions and do a clean checkout first."
33    exit 1
34fi
[178]35
[338]36if [ -f BETA ]
[178]37then
38        VERSION=$VERSION-pre`date +"%y%m%d"`
39        PACKAGE=pygresql.pkg-beta
[777]40        SYMLINK=PyGreSQL-beta.tar.gz
[178]41else
42        PACKAGE=pygresql.pkg
[777]43        SYMLINK=PyGreSQL.tar.gz
[178]44fi
45
[686]46# Package up as a source tarball in the distribution directory.
47
[750]48echo "Making source tarball..."
[783]49echo
[750]50
[783]51umask 0022
52
[750]53# Make sure that the documentation has been built.
54
[783]55if ! ./mkdocs
56then
57        echo "Hmmm.  The documentation could not be built."
58        exit 1
59fi
[750]60
[758]61# Package as source distribution.
[750]62
[758]63rm -rf build dist
[263]64
[783]65if ! python3 setup.py sdist
66then
67        echo "Hmmm.  The source distribution could not be created."
68        exit 1
69fi
[178]70
[758]71DF=`ls dist`
[783]72if [ $? -ne 0 -o -z "$DF" ]
73then
74        echo "Hmmm.  The source distribution could not be found."
75        exit 1
76fi
77
[758]78TF=$DISTDIR/$DF
79
[783]80if ! cp dist/$DF $TF
81then
82        echo "Hmmm.  The source distribution could not be copied."
83        exit 1
84fi
85
[178]86chmod 644 $TF
[758]87
[263]88rm -f $DISTDIR/$SYMLINK
[758]89ln -s $DF $DISTDIR/$SYMLINK
[263]90
[783]91echo
[758]92echo "$TF has been built."
Note: See TracBrowser for help on using the repository browser.