Mercurial > libpst
annotate package @ 64:2c6040b6e8f8
packaging for Fedora (#434727)
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Tue, 26 Feb 2008 17:06:33 -0800 |
parents | b4f025d95441 |
children |
rev | line source |
---|---|
12
3f627519a92d
properly ignore (second block zero) errors. that will just drop some unknown attachments, but the rest of the data is still found
carl
parents:
diff
changeset
|
1 #!/bin/bash |
3f627519a92d
properly ignore (second block zero) errors. that will just drop some unknown attachments, but the rest of the data is still found
carl
parents:
diff
changeset
|
2 |
59
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
3 find . -name '*~' | while read a; do rm -f "$a"; done |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
4 |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
5 # setup environment |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
6 T=`grep AC_INIT configure.in | cut -d'(' -f2` |
18 | 7 NAME=`echo $T | cut -d, -f1` |
59
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
8 VER=`echo $T | cut -d, -f2` |
18 | 9 BALL=$NAME-$VER.tar.gz |
10 web=/home/httpd/html/510sg/$NAME | |
11 distlog=/tmp/distcheck | |
59
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
12 repo=/usr/hg-repository/$NAME |
61
b4f025d95441
bump the version number in configure.in
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
13 oldone=$web/packages/$BALL |
b4f025d95441
bump the version number in configure.in
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
14 |
b4f025d95441
bump the version number in configure.in
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
15 if [ -f $oldone ]; then |
b4f025d95441
bump the version number in configure.in
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
16 echo "$oldone already exists, did you update the version in configure.in?" |
b4f025d95441
bump the version number in configure.in
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
17 exit 0 |
b4f025d95441
bump the version number in configure.in
Carl Byington <carl@five-ten-sg.com>
parents:
60
diff
changeset
|
18 fi |
18 | 19 |
59
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
20 # check for uncommitted changes |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
21 a=$(hg status) |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
22 if [ -n "$a" ]; then |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
23 hg status |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
24 echo "fix those first with 'hg commit'" |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
25 exit 0 |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
26 fi |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
27 |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
28 # check for changesets pending push to global repository |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
29 hg outgoing $repo | grep 'no changes found' >/dev/null |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
30 if [ $? -ne 0 ]; then |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
31 hg outgoing $repo |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
32 echo "fix those first with 'hg push $repo'" |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
33 exit 0 |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
34 fi |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
35 |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
36 # get a new clean copy from source control |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
37 orig=$(pwd) |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
38 pack=$orig/../$NAME-package |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
39 [ -d "$pack" ] && rm -rf "$pack" |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
40 mkdir "$pack" |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
41 cd "$pack" |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
42 hg clone $repo |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
43 cd $NAME |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
44 |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
45 # build the package |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
46 mkdir -p $web |
12
3f627519a92d
properly ignore (second block zero) errors. that will just drop some unknown attachments, but the rest of the data is still found
carl
parents:
diff
changeset
|
47 chown --recursive root:root * |
18 | 48 make -f *cvs |
49 ./configure >/dev/null | |
50 (cd xml; make; make distclean) | |
24 | 51 cp -a html/*html $web |
18 | 52 make distcheck >$distlog 2>&1 |
53 | |
24 | 54 if [ $? -eq 0 ]; then |
55 if [ -f $BALL ]; then | |
56 # expand locally to see the tarball | |
57 rm -rf junk | |
58 mkdir junk | |
59 cd junk | |
60 tar xfz ../$BALL | |
61 cd $NAME-$VER | |
62 ./configure >/dev/null | |
63 make >/dev/null | |
64 cd .. | |
65 cd .. | |
66 | |
67 # build rpm on target | |
31 | 68 target5=pmg2 |
69 scp $BALL $target5:/tmp | |
70 ssh $target5 "cd /tmp; rpmbuild -ta $BALL" | |
71 | |
72 # build rpm on target | |
73 target4=host62 | |
74 scp $BALL $target4:/tmp | |
75 ssh $target4 "cd /tmp; rpmbuild -ta $BALL" | |
12
3f627519a92d
properly ignore (second block zero) errors. that will just drop some unknown attachments, but the rest of the data is still found
carl
parents:
diff
changeset
|
76 |
24 | 77 # add packages to the web site |
78 wp=$web/packages | |
79 wp4=$wp/centos4 | |
31 | 80 wp5=$wp/centos5 |
81 mkdir -p $wp4 $wp5 | |
24 | 82 rp=/usr/src/redhat |
83 mv -f $BALL $wp | |
31 | 84 scp $target4:$rp/SRPMS/$NAME-$VER*rpm $wp |
85 scp $target4:$rp/RPMS/i386/$NAME-$VER*rpm $wp4 | |
86 scp $target5:$rp/RPMS/i386/$NAME-$VER*rpm $wp5 | |
87 (cd $web; chown --recursive web:web *; ls -alR) | |
24 | 88 rpm -ql -p $wp4/$NAME-$VER*6.rpm |
31 | 89 rpm -ql -p $wp5/$NAME-$VER*6.rpm |
24 | 90 fi |
91 else | |
92 tail -10 $distlog | |
93 fi | |
59
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
94 |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
95 # throw away the packaging directory |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
96 cd "$pack/.." |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
97 rm -rf $NAME-package |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
32
diff
changeset
|
98 cd "$orig" |