-
Notifications
You must be signed in to change notification settings - Fork 0
/
creandus-package.sh
executable file
·83 lines (73 loc) · 1.66 KB
/
creandus-package.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/sh
REPODIR=${REPODIR:-${HOME}/svn/creandus/trunk}
MODULES=${MODULES:-}
WORKDIR=${WORKDIR:-$(readlink -f .)}
DISTDIR=`pwd`
MAKEOPTS=${MAKEOPTS:-"-j1"}
pushd ${WORKDIR}
if [[ -z "${MODULES}" ]] ; then
echo ">>> Building list of creandus modules: "
for i in `/bin/ls -d ${REPODIR}/*/` ; do
if [[ -d ${i} ]] ; then
i=`basename ${i/\/}`
echo " + ${i}"
MODULES="${MODULES} ${i}"
fi
done
fi
echo ">>> Removing old trees..."
for x in ${MODULES} ; do
if [[ -e "${x}" ]] ; then
chmod -R u+w ${x}
rm -rf ${x}
fi
done
echo ">>> Copying current tree..."
mkdir ${MODULES}
for i in ${MODULES} ; do
echo " + ${i}"
pushd ${i} >/dev/null
cp -r ${REPODIR}/${i}/* .
find -type d -name .svn |xargs rm -rf
popd >/dev/null
done
echo ">>> Running ./autogen.bash..."
for i in ${MODULES} ; do
test -f ${i}/autogen.bash || continue
echo " + ${i}"
pushd ${i} >/dev/null
./autogen.bash || exit ${?}
popd >/dev/null
done
echo ">>> Running ./configure..."
for i in ${MODULES} ; do
test -f ${i}/configure || continue
echo " + ${i}"
pushd ${i} >/dev/null
./configure || exit ${?}
popd >/dev/null
done
echo ">>> Running make..."
for i in ${MODULES} ; do
test -f ${i}/Makefile || continue
echo " + ${i}"
pushd ${i} >/dev/null
make ${MAKEOPTS} || exit ${?}
popd >/dev/null
done
echo ">>> Running make distcheck..."
for i in ${MODULES} ; do
test -f ${i}/Makefile || continue
echo " + ${i}"
pushd ${i} >/dev/null
make ${MAKEOPTS} distcheck || exit ${?}
popd >/dev/null
done
echo "All tests succeeded! :)"
echo ">>> Copying all distfiles to ${DISTDIR}..."
for i in ${MODULES} ; do
pushd ${i} >/dev/null
cp -v ${i}-*.tar.bz2 ${DISTDIR}
popd >/dev/null
done
# vim: ts=4 :