]> git.donarmstrong.com Git - lilypond.git/blob - stepmake/bin/package-zip32.sh
164faa151943f21066ab9733eafb163c893abb7a
[lilypond.git] / stepmake / bin / package-zip32.sh
1 #!/bin/sh
2 # package-zip32.sh --- make a windoze formated distribution
3
4 set -x
5
6 if [ $# -lt 1 ]; then
7         echo "Usage: $0 PACKAGE_SOURCEDIR"
8         exit 2
9 fi
10
11 srcdir=$1
12 shift
13
14 . $srcdir/VERSION
15
16 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
17 if [ "x$MY_PATCH_LEVEL" != "x" ]; then
18     VERSION=$VERSION.$MY_PATCH_LEVEL
19 fi
20
21 package=`echo $PACKAGE_NAME | tr '[A-Z]' '[a-z]'`
22 name=$package-$VERSION
23 ZIP_CMD="zip -r -9"
24
25 here=`pwd`
26 cd $srcdir/.. 
27 PACKAGE_ROOTDIR=`pwd` 
28 export PACKAGE_ROOTDIR 
29 cd $here
30
31 RELEASE_DIR="$PACKAGE_ROOTDIR/bin.releases/winnt"
32 ZIP_FILE="$RELEASE_DIR/$name.bin.zip"
33
34
35 if [ ! -e $RELEASE_DIR ]; then
36     mkdir -p $RELEASE_DIR
37 fi
38
39 distdir=/tmp/${name}
40
41 rm -f ${srcdir}/config.cache
42 PYTHON=${PYTHON:-python} ${srcdir}/configure --prefix=${distdir} \
43     --srcdir=${srcdir}
44
45 if ! make ; then
46     echo "make failed"
47     exit 1
48 fi
49
50 # failure allowed
51 make -C Documentation info
52
53 if ! make install ; then
54     echo "make install failed"
55     exit 1
56 fi
57
58 if ! make -C Documentation/man WWW ; then
59     echo "make -C documentation/man WWW failed"
60     exit 1
61 fi
62
63 #
64 # Post install clean up
65 #
66 CYGWIN_LIB=$PACKAGE_ROOTDIR/distfiles/winnt/cygwin1.dll
67 if [ ! -e $CYGWIN_LIB ]; then
68     echo "Unable to locate $CYGWIN_LIB"
69     exit 1
70 fi
71
72 #
73 # copy cygwin lib into bin
74 #
75 cp $CYGWIN_LIB $distdir/bin
76
77 ASH_EXE=$PACKAGE_ROOTDIR/distfiles/winnt/ash.exe
78 if [ ! -e $ASH_EXE ]; then
79     echo "Unable to locate $ASH_EXE"
80     exit 1
81 fi
82
83 #
84 # copy ash into bin
85 #
86 cp $ASH_EXE $distdir/bin
87
88 GUILE_SCM=$PACKAGE_ROOTDIR/distfiles/winnt/ice-9
89 if [ ! -e $GUILE_SCM ]; then
90     echo "Unable to locate $GUILE_SCM"
91     exit 1
92 fi
93
94 #
95 # copy guile init files into share/lilypond
96 #
97 echo "copy $GUILE_SCM to $distdir/share/lilypond"
98 cp -r $GUILE_SCM $distdir/share/lilypond
99
100 #
101 # Rename python files to <filename>.py
102 #
103 mv $distdir/bin/ly2dvi $distdir/bin/ly2dvi.py
104 mv $distdir/bin/convert-mudela $distdir/bin/convert-mudela.py
105 mv $distdir/bin/mudela-book $distdir/bin/mudela-book.py
106
107 #
108 # copy man documentation to doc directory
109 #
110 mkdir $distdir/doc
111 cp Documentation/man/out/*.html $distdir/doc
112 cd $distdir/..
113 $ZIP_CMD $ZIP_FILE $name
114 echo "Wrote $ZIP_FILE"
115 rm -rf $name
116 exit 0
117
118