]> git.donarmstrong.com Git - lilypond.git/blob - buildscripts/make-cygwin-cross.sh
release: 1.3.42
[lilypond.git] / buildscripts / make-cygwin-cross.sh
1 #!@BASH@
2 # make-cygwin-cross
3 #
4 # Build and install cross-development tools for cygwin package 
5 # (binutils, compiler, flex, bison).
6 # Using this cross-development enviroment, build and install
7 # native cygwin packages (guile, lilypond).
8 #
9 # Besides being a handy script for me, currently this mainly serves
10 # as documentation for cross-building lilypond.
11 #
12 # To use this script, you need
13 #
14 #  * all development tools to build a native LilyPond, see INSTALL.txt
15 #
16 #  * RPM distribution of the cygwin pre-release sources, from:
17 #
18 #      http://appel.dyndns.org/lilypond/gnu-windows/redhat/SRPMS/
19 #
20 #    The tarballs were fetched from:
21 #
22 #      ftp://sourceware.cygnus.com/pub/cygwin/private/cygwin-net-485/
23 #
24
25 ################
26 # config section
27 ################
28
29 TARGET_OS=cygwin
30 #TARGET_OS=mingw32
31
32 if [ $TARGET_OS = cygwin ]; then
33         ROOT=/usr/src/cygwin-net-485
34         TARGET_ARCH=i686
35         TARGET_VENDOR=pc
36 else
37         ROOT=/usr/src/mingw-net-485
38         TARGET_ARCH=i386
39         TARGET_VENDOR=pc
40 fi
41 TARGET_PLATFORM=$TARGET_ARCH-$TARGET_VENDOR-$TARGET_OS
42
43 ARCH=`uname -m`
44 OS=`uname -s | tr '[A-Z]' '[a-z]'`
45 VENDOR=gnu
46 PLATFORM=$ARCH-$VENDOR-$OS
47
48 #CROSS_TARGET_PLATFORM=$ARCH-x-$TARGET_PLATFORM
49 CROSS_TARGET_PLATFORM=$PLATFORM-x-$TARGET_PLATFORM
50 cto=$OS-x-cygwin
51 tp=i686-cygwin
52
53 PREFIX=$ROOT/usr
54 NATIVE_ROOT=/Cygnus
55 NATIVE_PREFIX=$NATIVE_ROOT/usr
56 CROSS_ROOT=$NATIVE_ROOT/$cto
57 CROSS_PREFIX=$CROSS_ROOT/usr
58
59 # urg
60 DEVEL=/home/fred
61 distdir=$DEVEL/WWW/lilypond/gnu-windows/lily-w32
62 #distdir=/tmp
63
64 CYGWIN_SOURCE=$DEVEL/sourceware.cygnus.com/pub/cygwin/private/cygwin-net-485
65 cygwin_dirs=`/bin/ls -d1 $CYGWIN_SOURCE/*`
66 cygwin_source_path=`echo $CYGWIN_SOURCE $cygwin_dirs | sed s'/\$/:/g'`
67 SOURCE_PATH=$DEVEL/usr/src/releases:$DEVEL/usr/src/redhat/SRPMS:$cygwin_source_path
68
69 cygwin_binary=cygwin-20000301.tar.gz
70 mingw_binary=bin-crtdll-2000-02-03.tar.gz
71
72 #CYGWIN_DLL=cygwin1-net-485.dll
73 CYGWIN_DLL=cygwin1.dll
74 MINWG_DLL=mingwc10-net-485.dll
75
76
77 ################
78 # cross packages
79 ################
80
81 cross_rpm="
82 binutils-19990818
83 gcc-2.95.2
84 bison
85 flex
86 "
87
88 # binutils installs ok, but forgets these two
89 binutils_after_rpm='
90 cd $CROSS_PREFIX/$TARGET_PLATFORM/bin \;
91 ln -f ../../bin/$TARGET_PLATFORM-objdump objdump \;
92 ln -f ../../bin/$TARGET_PLATFORM-objcopy objcopy \;
93 mv -f ld ld-in-path-breaks-libtool
94 '
95 # burp.  gcc doesn't install any of these
96 gcc_after_rpm='
97 cd $CROSS_PREFIX/$TARGET_PLATFORM/bin \;
98 ln -f ../../bin/$TARGET_PLATFORM-gcc cc \;
99 ln -f ../../bin/$TARGET_PLATFORM-gcc gcc \;
100 ln -f ../../bin/$TARGET_PLATFORM-c++ c++ \;
101 ln -f ../../bin/$TARGET_PLATFORM-g++ g++
102 '
103
104 guile_after_rpm='cp -f $NATIVE_PREFIX/bin/*guile-config $CROSS_PREFIX/$TARGET_PLATFORM/bin'
105
106 lilypond_version=@TOPLEVEL_VERSION@
107
108 native_rpm="
109 rx-1.5
110 zlib-1.1.3
111 db-2.7.7
112 guile-1.3.4
113 bash-2.03
114 rpm-3.0.4
115 lilypond-$lilypond_version
116 "
117
118 #######################
119 # end of config section
120 #######################
121
122 ###########
123 # functions
124 ###########
125
126 expand ()
127 {(
128
129         set -
130         string=`eval echo $\`eval echo "${1}${2}"\``
131         eval echo $string
132 )
133 }
134
135 find_path ()
136 {(
137         set -
138         expr=$1
139         source_path=${2:-$SOURCE_PATH}
140         path_list=`echo $source_path | sed 's/:/ /g'`
141
142         found=
143         for i in $path_list; do
144                 found=`/bin/ls -d1 $i/$expr 2>/dev/null | head -1`
145                 if [ "$found" != "" ] && [ -e $found ]; then
146                         break
147                 fi
148         done
149         echo $found
150 )
151 }
152
153 build ()
154 {(
155         package=$1
156         name=`echo $package | sed 's/-.*//'`
157
158         if [ $type = "cross" ]; then
159                 target_platform=$CROSS_TARGET_PLATFORM
160                 a=$cto
161         else
162                 target_platform=$TARGET_PLATFORM
163                 a=$tp
164         fi
165
166         rpm_package=`find_path $name*.rpm "$topdir/RPMS/$cto:$topdir/RPMS/$tp"`
167         if [ "$rpm_package" != "" ]; then
168                 echo "$rpm_package: package exists"
169                 #echo "$rpm_package: refreshing installation only"
170                 echo "$rpm_package: just updating rpm database"
171                 rpm -ivv --justdb --ignoreos --ignorearch --nodeps --force\
172                         --dbpath $NATIVE_ROOT/var/lib/rpm \
173                         $topdir/RPMS/$a/$name*.rpm
174                 exit 0
175         fi
176
177         cd $topdir
178         found=`find_path $package*src.rpm`
179         if [ "$found" != "" ]; then
180                 rpm --root $NATIVE_ROOT -ivv $found || exit 1
181                 rpm --target=$target_platform -ba SPECS/$name*.spec || exit 1
182         else
183                 tarball=`/bin/ls -d1 SOURCES/$package*tar.gz 2>/dev/null | head -1`
184                 if [ "$name.spec" != "" ] && [ "$tarball" != "" ]; then
185                         rpm --target=$target_platform -ba SPECS/$name.spec || exit 1
186                 else
187                         found=`find_path $package*tar.gz`
188                         if [ "$found" != "" ]; then
189                                 rpm --target=$target_platform -ta $found || exit 1
190                         else
191                                 echo "$package: no such rpm or tarball"
192                                 exit 1
193                         fi
194                 fi
195         fi
196         name=`echo $package | sed 's/-.*//'`
197
198         rpm -ivv --ignoreos --ignorearch --nodeps --force\
199                 --dbpath $NATIVE_ROOT/var/lib/rpm \
200                 $topdir/RPMS/$a/$name*.rpm
201         #urg
202         name_after_rpm="`expand $name _after_rpm`"
203         `eval $name_after_rpm` || exit 1
204 )
205 }
206
207 ##################
208 # end of functions
209 ##################
210
211 #######
212 # setup
213 #######
214
215 set -x
216 mkdir -p $ROOT
217 if [ ! -d $PREFIX/bin ]; then
218         mkdir -p $PREFIX
219         cd $PREFIX
220
221         ## is this still necessary?
222         mkdir -p include lib
223         mkdir -p $TARGET_PLATFORM
224         cd $TARGET_PLATFORM && ln -s ../include .
225
226         mkdir -p $CROSS_PREFIX/$TARGET_PLATFORM
227         cd $CROSS_PREFIX/$TARGET_PLATFORM
228         ln -s $NATIVE_PREFIX/{include,lib} .
229         #ln -s $NATIVE_PREFIX/{include,lib} .
230         #ln -s $NATIVE_PREFIX/include .
231         #ln -s $CROSS_PREFIX/bin .
232         
233         cd $ROOT
234         found=`find_path $cygwin_binary`
235         if [ "$found" = "" ]; then
236                 echo "$cygwin_binary: no such tarball"
237                 exit 1
238         fi
239         tar xzf $found
240         # urg, bug in gcc's cross-make configuration
241         mkdir -p $PREFIX/lib/gcc-lib/$TARGET_PLATFORM/2.95.2
242         mkdir -p $CROSS_PREFIX/lib/gcc-lib/$TARGET_PLATFORM/2.95.2
243 else
244         echo "$PREFIX: already exists"
245         echo "$cygwin_binary: skipping"
246 fi
247
248 # mingw
249 if [ ! -d $PREFIX/$TARGET_PLATFORM ]; then
250         cd $PREFIX
251         found=`find_path $mingw_binary`
252         if [ "$found" = "" ]; then
253                 echo "$mingw_binary: no such tarball"
254                 exit 1
255         fi
256         tar xzf $found
257
258         mkdir -p $PREFIX/lib/gcc-lib/$TARGET_PLATFORM/2.95.2
259         rm -f include
260         mkdir -p $PREFIX/i386-mingw32/include
261         ln -s $PREFIX/i386-mingw32 $TARGET_PLATFORM
262         ln -s $PREFIX/$TARGET_PLATFORM/include .
263 fi
264
265 rm -f $NATIVE_ROOT
266 if [ ! -e $NATIVE_ROOT ]; then
267         ln -s $ROOT $NATIVE_ROOT || exit 1
268 fi
269
270 #mv $PREFIX/bin/cygwin1.dll $PREFIX/bin/$CYGWIN_DLL
271 #mv $PREFIX/bin/mingwc10.dll $PREFIX/bin/$MINGW_DLL
272
273 mkdir -p $ROOT/var/redhat
274 mkdir -p $PREFIX/src/redhat
275
276 native_config_site='$PREFIX/share/native-config.site'
277
278 ncs=`eval echo $native_config_site`
279 rm -f $ncs
280 mkdir -p `dirname $ncs`
281 cat > $ncs <<EOF
282 ac_cv_c_bigendian=no
283 ac_cv_sizeof_char_p=4
284 ac_cv_sizeof_int=4
285 ac_cv_sizeof_long=4
286 ac_cv_sizeof_float=4
287 ac_cv_sizeof_double=8
288 ac_cv_sys_restartable_syscalls=no
289 ac_cv_sprintf_count=yes
290 ac_cv_spinlocks=no
291 db_cv_sprintf_count=yes
292 db_cv_spinlocks=no
293 ac_cv_func_getpgrp_void=yes
294 ac_cv_func_setvbuf_reversed=no
295 ac_cv_lib_intl=no
296 # urg, lots of stuff goes wrong when configuring bash??
297 ac_cv_exeext=.exe
298 ac_cv_header_libintl_h=no
299 ac_cv_header_termcap_h=no
300 ac_cv_func_mkfifo=yes
301 bash_cv_dup2_broken=no
302 bash_cv_opendir_not_robust=no
303 bash_cv_pgrp_pipe=no
304 bash_cv_printf_declared=yes
305 bash_cv_sbrk_declared=yes
306 bash_cv_signal_vintage=posix
307 bash_cv_speed_t_in_sys_types=no
308 bash_cv_struct_timeval=yes
309 bash_cv_struct_winsize_header=ioctl_h
310 bash_cv_sys_errlist=yes
311 bash_cv_sys_named_pipes=missing
312 bash_cv_func_strcoll_broken=no
313 bash_cv_must_reinstall_sighandlers=no
314 bash_cv_getcwd_calls_popen=no
315 bash_cv_func_sigsetjmp=missing
316 bash_cv_job_control_missing=present
317 bash_cv_sys_restartable_syscalls=no
318 bash_cv_getenv_redef=yes
319 bash_cv_sys_siglist=no
320 bash_cv_type_rlimit=long
321 bash_cv_ulimit_maxfds=no
322 bash_cv_decl_under_sys_siglist=no
323 bash_cv_under_sys_siglist=no
324 EOF
325
326 #URG, stupid RPM
327 rpm_ct=$ARCH-$TARGET_OS
328 cross_rpm_dir=$CROSS_PREFIX/lib/rpm/$rpm_ct
329 cross_rpm_link=/usr/lib/rpm/$rpm_ct
330 mkdir -p $cross_rpm_dir
331 rm -f $cross_rpm_link
332 ln -s $cross_rpm_dir $cross_rpm_link
333
334 native_rpm_dir=$NATIVE_PREFIX/lib/rpm/$tp
335 native_rpm_link=/usr/lib/rpm/$tp
336 mkdir -p $native_rpm_dir
337 rm -f $native_rpm_link
338 ln -s $native_rpm_dir $native_rpm_link
339
340 cross_macros=$cross_rpm_dir/macros
341 native_macros=$native_rpm_dir/macros
342
343 base_macros=$NATIVE_PREFIX/lib/rpm/base-macros
344 rm -f $base_macros
345 cat > $base_macros <<EOF
346 %native_prefix  /Cygnus/usr
347
348 %_topdir        %{native_prefix}/src/redhat
349 %_sourcedir     %{native_prefix}/src/redhat/SOURCES
350 %_builddir      %{native_prefix}/src/redhat/BUILD
351 %_srcrpmdir     %{native_prefix}/src/redhat/SRPMS
352 %_rpmdir        %{native_prefix}/src/redhat/RPMS
353
354 #%DocDir                %{native_prefix}/doc
355 %DocDir         /Cygnus/usr/doc
356 %_docdir        /Cygnus/usr/doc
357 %_defaultdocdir /Cygnus/usr/doc
358
359 %cygwin_dll     %{native_prefix}/bin/cygwin1.dll
360
361 %__install      /bin/install
362
363 %cflags         %{optflags}
364 %cppflags       %{nil}
365
366 %sourcedir      .
367 EOF
368
369 cp -f $base_macros $cross_macros
370 cat >> $cross_macros <<EOF
371
372 %cross_prefix   /Cygnus/$cto/usr
373 %root           /Cygnus/$cto
374 %_rootbindir    /Cygnus/$cto/bin
375 #_usr           /Cygnus/$cto/usr
376 %_prefix        /Cygnus/$cto/usr
377 %prefix         /Cygnus/$cto/usr
378
379 %_rpmfilename   $cto/%%{NAME}-%%{VERSION}-%%{RELEASE}.$cto.rpm
380
381 %config_site    %{nil}
382
383 %cppflags       %{nil}
384 %cflags         %{nil}
385 %ldflags        %{nil}
386 %_target_platform $TARGET_PLATFORM
387
388 #% configure    \
389 #  %{?__libtoolize:[ -f configure.in ] \&\& %{__libtoolize} --copy --force}; \
390 %configure      \
391   CPPFLAGS="%{cppflags}" CFLAGS="%{cflags}" LDFLAGS="%{ldflags}" CONFIG_SITE=%{config_site} \
392   %{sourcedir}/configure \
393   --host=%{_host} --target=%{_target_platform} --prefix=%{cross_prefix} -v
394 EOF
395
396 cp -f $base_macros $native_macros
397 cat >> $native_macros <<EOF
398
399 %root           /Cygnus
400 %_rootbindir    /Cygnus/bin
401 #_usr           /Cygnus/usr
402 %_prefix        /Cygnus/usr
403 %prefix         /Cygnus/usr
404
405 %config_site    %{_prefix}/share/native-config.site
406 # won't work: scripts and stuff are .exe too
407 #%program_suffix .exe
408 %program_suffix %{nil}
409
410 #%_arch         i686-cygwin
411 #%_vendor       pc
412 #%_os           cygwin
413
414 %_rpmfilename   %%{ARCH}-$TARGET_OS/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}-$TARGET_OS.rpm
415
416 %__find_provides        %{native_prefix}/lib/rpm/cygwin.prov
417 %__find_requires        %{native_prefix}/lib/rpm/cygwin.req
418 %__fix_suffixes         %{native_prefix}/bin/fix-suffixes
419 %fix_suffixes   %{__fix_suffixes} \$RPM_BUILD_ROOT%{_rootbindir}/* \$RPM_BUILD_ROOT%{native_prefix}/bin/*
420
421 %cppflags       -I%{native_prefix}/include
422 %cflags         %{optflags} %{cppflags}
423 %ldflags        -L%{native_prefix}/lib %{cygwin_dll}
424
425 #%configure     \
426 #  %{?__libtoolize:[ -f configure.in ] \&\& %{__libtoolize} --copy --force}; \
427
428 %configure      \
429   CPPFLAGS="%{cppflags}" CFLAGS="%{cflags}" LDFLAGS="%{ldflags}" CONFIG_SITE=%{config_site} \
430   %{sourcedir}/configure --host=%{_host} --target=%{_target_platform} \
431   --prefix=%{native_prefix} --program-prefix=
432 #  --prefix=%{native_prefix} --program-suffix=%{program_suffix}
433 EOF
434
435 rm -f $NATIVE_PREFIX/lib/rpm/cygwin.prov
436 cat > $NATIVE_PREFIX/lib/rpm/cygwin.prov <<EOF
437 #!/bin/sh
438 while read f ; do
439        f=\`echo \$f | tr '[:upper:]' '[:lower:]'\`
440        case \$f in
441        *.dll)  basename \$f
442                ;;
443        esac
444 done | sort -u
445 EOF
446 chmod 755 $NATIVE_PREFIX/lib/rpm/cygwin.prov
447
448 rm -f $NATIVE_PREFIX/lib/rpm/cygwin.req
449 cat > $NATIVE_PREFIX/lib/rpm/cygwin.req <<EOF
450 #!/bin/sh
451
452 while read f ; do
453        case \$f in
454        *.dll|*.exe)    objdump -p \$f | grep "DLL Name:" | cut -f3 -d" " | tr '[:upper:]' '[:lower:]'
455                        ;;
456        esac
457 done | sort -u
458
459 EOF
460 chmod 755 $NATIVE_PREFIX/lib/rpm/cygwin.req
461
462 rm -f $NATIVE_PREFIX/bin/fix-suffixes
463 cat > $NATIVE_PREFIX/bin/fix-suffixes <<EOF
464 #!/bin/sh
465 ## duh, rename executables,
466 ## for people that use a dumb shell instead of bash
467
468
469 if [ \$# -le 0 ]; then
470         echo "Usage: fix-suffixes [FILE]..."
471         exit 2
472 fi
473
474 fix_extension ()
475 {
476         path=\$1
477         ext=\$2
478         expr="\$3"
479         dir=\`dirname \$path\`
480         file=\`basename \$path\`
481         base=\`basename \$file \$ext\`
482         if [ \$base\$ext != \$file ]; then
483                 type="\`file \$path\`"
484                 if expr "\$type" : "\$expr"; then
485                         mv -f \$path \$dir/\$base\$ext
486                 fi
487         fi
488 }
489
490 for i in \`/bin/ls -d1 \$*\`; do
491         fix_extension \$i .exe '.*Windows.*\(executable\).*'
492         fix_extension \$i .py '.*\(python\).*'
493 done
494
495 EOF
496 chmod 755 $NATIVE_PREFIX/bin/fix-suffixes
497 set -x
498 type=rpm
499 rm -rf $NATIVE_ROOT/var/lib/rpm
500 mkdir -p $NATIVE_ROOT/var/lib/rpm
501 rpm --root $NATIVE_ROOT --initdb
502
503 topdir=$NATIVE_PREFIX/src/redhat
504 mkdir -p $topdir/{BUILD,RPMS/{$tp,$cto},SOURCES,SPECS,SRPMS}
505
506 ##############
507 # end of setup
508 ##############
509
510 OLDPATH=$PATH
511 # building x-gcc requires to have x-ar in path
512 # x-gcc will find $prefix/x/bin/as by itself
513 PATH=$CROSS_PREFIX/bin:$PATH
514
515 mkdir -p $PREFIX/src
516 cd $PREFIX/src
517 type=cross
518 for i in $cross_rpm; do
519         if build $i; then
520                 true
521         else
522                 echo "$i: rpm build failed"
523                 exit 1
524         fi
525 done
526
527 PATH=$CROSS_PREFIX/$TARGET_PLATFORM/bin:$PATH
528
529 cd $PREFIX/src
530 type=native
531 for i in $native_rpm; do
532         if build $i; then
533                 true
534         else
535                 echo "$i: rpm build failed"
536                 exit 1
537         fi
538 done
539
540 ##############
541 # Distribution
542 ##############
543
544 PATH=$OLDPATH
545
546 mkdir -p $distdir
547
548 cat > $distdir/setup.sh <<EOF
549 #!/bin/bash
550 set -x
551 ROOT=/Cygnus
552 PREFIX=\$ROOT/usr
553 gunzip rpm.gz || exit 1
554 #dll=\$ROOT/net-485
555 #mkdir -p \$dll
556 #gzip -dc cygwin.dll.gz > \$dll/cygwin1.dll
557 ## this won't work: must be done outside of cygwin
558 #old_dll=\`which cygwin1.dll\`
559 #mv -f \$old_dll \$old_dll.orig\$\$
560 #gunzip cygwin1.dll.gz
561 #cp -f cygwin1.dll \$old_dll
562 echo > rpmrc
563 mkdir -p \$ROOT/var/lib
564 mkdir -p \$ROOT/bin
565 rem # touch \$ROOT/bin/rpm \$ROOT/bin/rpm.exe
566 echo > \$ROOT/bin/rpm; echo > \$ROOT/bin/rpm.exe
567 ./rpm --root \$ROOT --rcfile rpmrc --initdb
568 ./rpm --root \$ROOT --rcfile rpmrc --nodeps --ignorearch --ignoreos -Uhv \\
569         RPMS/$tp/rpm-*.$tp.rpm \\
570         RPMS/$tp/*.$tp.rpm
571 done
572 EOF
573
574 cat > $distdir/setup.bat <<EOF
575 del dll olddll
576 rem # old_dll=\`which cygwin1.dll\`
577 rem # urg, should dist bash too, then we don't need usertools!
578 rem #   cp -f \`which bash\` /bin;
579 bash -c 'mkdir -p /bin;
580         cp -f bash /bin/bash.exe;
581         cp -f /bin/bash /bin/sh.exe;
582         dll=\`which cygwin1.dll\`;
583         wdll=\`./cygpath -w \$dll\`;
584         echo cygwin1.dll \$wdll > newdll; echo \$wdll \$wdll.orig\$\$ > olddll'
585 if not errorlevel 0 goto nobash
586 rem # mv -f \$old_dll \$old_dll.orig\$\$
587 rem # gunzip cygwin1.dll.gz
588 rem # cp -f cygwin1.dll \$old_dll
589 copy < olddll 
590 copy < newdll 
591 bash setup.sh
592 if not errorlevel 0 goto nobash
593 goto :exit
594 :nobash
595 @echo "setup.bat: can't find bash"
596 rem # @echo "setup.bat: please install usertools from"
597 rem # @echo "setup.bat: http://sourceware.cygnus.com/cygwin/"
598 :exit
599 EOF
600
601 cat > $distdir/lilypond.sh <<EOF
602 #!/bin/bash
603 ROOT=/Cygnus
604 PREFIX=\$ROOT/usr
605 \$ROOT/bin/lilypond \$*
606 EOF
607
608 cat > $distdir/midi2ly.sh <<EOF
609 #!/bin/bash
610 ROOT=/Cygnus
611 PREFIX=\$ROOT/usr
612 \$ROOT/bin/midi2ly \$*
613 EOF
614
615 cat > $distdir/lilypond.bat <<EOF
616 bash lilypond.sh %1 %2 %3 %4 %5 %6 %7 %8 %9
617 EOF
618
619 cat > $distdir/midi2ly.bat <<EOF
620 bash midi2ly.sh %1 %2 %3 %4 %5 %6 %7 %8 %9
621 EOF
622
623 cd $distdir
624 rm -f $CYGWIN_DLL.gz
625 cp -f $PREFIX/bin/$CYGWIN_DLL
626 rm -f rpm.gz
627 cp -f `/bin/ls -d1 $ROOT/bin/rpm* |head -1` rpm
628
629 rm -f bash.gz
630 cp -f `/bin/ls -d1 $ROOT/bin/bash* |head -1` bash
631
632 rm -f cygpath.gz
633 cp -f `/bin/ls -d1 $ROOT/bin/cygpath* |head -1` cygpath
634
635 distbase=`basename $distdir`
636 rm -f RPMS
637 ln -s ../redhat/RPMS .
638
639 www=`dirname $distdir`
640 cd $www
641 for i in bash-2 guile-1 rpm-3 lilypond; do
642         rpm=`find_path $i*.rpm $distbase/RPMS/$tp`
643         dist_rpms="$dist_rpms $rpm"
644 done
645
646 rm -f $www/setup.zip
647 cd $www && zip setup.zip lily-w32 $distbase/* $dist_rpms
648
649 # make small zip dist available
650 #
651 zipdir=$www/zip
652 mkdir -p $zipdir
653
654 rm -f $zipdir/$CYGWIN_DLL.zip
655 cd $ROOT/bin && zip $zipdir/$CYGWIN_DLL.zip $CYGWIN_DLL
656
657 for i in bash-2 guile-1 rpm-3 lilypond; do
658         found=`find_path $i*.rpm $distdir/RPMS/$tp`
659         if [ "$found" = "" ]; then
660                 echo "$i: no such .rpm"
661         else
662                 base=`basename $found`
663                 package=`echo $base | sed "s/\.$tp.rpm//"`
664                 dir=/tmp/$i-rpm2zip
665                 rm -rf $dir
666                 mkdir -p $dir
667                 cd $dir || exit 1
668                 rpm2cpio $found | cpio -id
669                 zip -ry $zipdir/$package.zip .
670                 rm -rf $dir
671         fi
672 done
673
674 cd $distdir
675 gzip -f $CYGWIN_DLL
676 gzip -f rpm
677 gzip -f bash
678 gzip -f cygpath
679
680
681
682