Continue WIP
[git/cygwin-packages/biber.git] / prereqs01 / build.sh
1 #! /bin/bash
2
3 # Run in elevated shell as kbrown-admin.
4 # Copy setup-*.exe to *.exe to avoid prompt.
5
6 SYSARCH=$(uname -m)
7 if [ ${SYSARCH} = i686 ]
8 then
9 GENINI="GEN-ini"
10 DEST_ARCH="x86"
11 else
12 GENINI="GEN-ini64"
13 DEST_ARCH="x86_64"
14 fi
15
16 setup="/c/downloads/cygwin/${DEST_ARCH}.exe"
17
18 GENINI() {
19 mksetupini --arch=${DEST_ARCH} --release=kbrown --inifile=${DEST_ARCH}/setup.ini \
20 --okmissing=required-package --okmissing=curr --releasearea .
21 cd ${DEST_ARCH}
22 xz -c setup.ini > setup.xz
23 chown kbrown setup.ini setup.xz
24 cd ..
25 }
26
27 install() {
28 local command
29 pushd /c/downloads/cygwin/myrepo
30 GENINI
31 popd
32 command="${setup} -q -X -L"
33 for m in ${mods}
34 do
35 command+=" -P ${m}"
36 done
37 echo "Running ${command}"
38 ${command}
39 }
40
41 mods="
42 perl-ExtUtils-Config
43 perl-Try-Tiny
44 "
45
46 rm -f build_failures.txt test_failures.txt
47 touch build_failures.txt test_failures.txt
48 chown kbrown build_failures.txt test_failures.txt
49
50 export cygport_no_error=1
51
52 for m in ${mods}
53 do
54 eval $(grep '^NAME=' ${m}/${m}.cygport)
55 eval $(grep '^VERSION=' ${m}/${m}.cygport)
56 eval $(grep '^RELEASE=' ${m}/${m}.cygport)
57 PVR=${NAME}-${VERSION}-${RELEASE}
58 ARCH=${SYSARCH}
59 eval $(grep '^ARCH=' ${m}/${m}.cygport)
60 if [ ${ARCH} = i686 -o ${SYSARCH} = x86_64 ]
61 then
62 echo "Entering ${m}..."
63 cd ${m} || exit 1
64 echo "Running cygport..."
65 rm -rf ${PVR}.${ARCH}
66 if cygport ${m}.cygport fetch all
67 then
68 cygport ${m}.cygport test || echo $m >> ../test_failures.txt
69 if [ ${ARCH} = noarch ]
70 then
71 dest=/c/downloads/cygwin/myrepo/noarch/release/
72 else
73 dest=/c/downloads/cygwin/myrepo/${DEST_ARCH}/release/
74 fi
75 chown -R kbrown .
76 rm -rf ${dest}/${m}
77 cp -alf ${PVR}.${ARCH}/dist/${m} ${dest}
78 else
79 echo ${m} >> ../build_failures.txt
80 chown -R kbrown .
81 fi
82 echo "Leaving ${m}."
83 cd ..
84 fi
85 done
86 install
87 if [ -n "$(cat *.txt)" ]
88 then
89 echo There were failures.
90 exit 1
91 else
92 exit 0
93 fi
94
This page took 0.03682 seconds and 5 git commands to generate.