Make: a bit more auto-configuration for my builds
[git/dscho.git] / DoKernelOrg
blobbc0d51d5e494724f82ef80b6da974b58ecc91262
1 #!/bin/sh
3 : ${J='-l 4 -j'}
4 G=/pub/software/scm/git &&
6 HERE=$(git symbolic-ref HEAD) || exit 1
7 THIS=$(git describe HEAD)
9 d='
10 MAN_BASE_URL="http://www.kernel.org/pub/software/scm/git/docs/"
11 ASCIIDOC_NO_ROFF=YesPlease
12 ASCIIDOC8=YesPlease
13 BLK_SHA1=YesPlease
14 GNU_ROFF=YesPlease'
16 rm -f version
17 case `hostname` in
18 hera.kernel.org)
19 narch='x86_64 i386'
20 arch=x86_64 ;;
21 wing-fc*|fc*.siamese.dyndns.org)
22 eval $(rpm --showrc | sed -ne '
23 s/^-14: dist[ ]*\./dist=/p
24 s/^-14: _build_arch[ ]*/arch=/p
25 ') &&
26 test -n "$dist" && test -n "$arch" || exit 1
28 *) echo >&2 "What are you talking about???"
29 exit 1 ;;
30 esac &&
31 : >./:all.log &&
32 echo "* Building $THIS" &&
33 make $J git >./:all.log 2>&1 &&
34 V=`./git --version | sed -e 's/git version //'` &&
35 make $d rpm >>./:all.log 2>&1 &&
36 case "$narch" in
37 '')
38 # This is not the primary build machine.
39 status=$?
40 case "$status" in
42 echo >&2 "Done -- move RPMS to the master machine."
44 cd "$HOME/rpms/" &&
45 tar cf "TARBALL/$V.$arch.$dist.tar" \
46 RPMS/$arch/*-$V-*.$dist.$arch.rpm &&
47 ls -ld $HOME/rpms/TARBALL/$V.$arch.$dist.tar
48 ) &&
49 make clean
52 echo >&2 "Failed with status $status"
54 esac
55 exit $status ;;
57 make $d dist-doc >>./:all.log 2>&1 &&
58 ln -f git-$V.tar.gz $G/. &&
59 ln -f git-htmldocs-$V.tar.gz git-manpages-$V.tar.gz $G/.
61 esac >>./:all.log 2>&1 &&
62 case "$V" in
63 *.rc[0-9]* | *-rc[0-9]*)
64 mkdir -p $G/testing &&
65 for a in $narch
67 for rr in $HOME/rpms/RPMS/$a/*-$V-*.$a.rpm
69 test -f "$rr" || continue
70 ln -f "$rr" $G/testing/.
71 done
72 done &&
73 ln -f $HOME/rpms/SRPMS/git-$V-*.src.rpm $G/testing/.
76 mkdir -p $G/RPMS/$arch $G/RPMS/SRPMS &&
77 for a in $narch
79 mkdir -p "$G/RPMS/$a" &&
80 for rr in $HOME/rpms/RPMS/$a/*-$V-*.$a.rpm
82 test -f "$rr" || continue
83 ln -f "$rr" $G/RPMS/$a/.
84 done
85 done &&
86 ln -f $HOME/rpms/SRPMS/git-$V-*.src.rpm $G/RPMS/SRPMS/. &&
88 # I do not know how it exits, and I do not care much.
89 for a in $narch
91 /usr/local/bin/yummy $G/RPMS/$a
92 done
93 /usr/local/bin/yummy $G/RPMS/SRPMS
95 } >>./:all.log 2>&1 ;;
96 esac &&
97 make clean