forked from libdfp/libdfp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-release.sh
executable file
·83 lines (61 loc) · 1.73 KB
/
make-release.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/bash
logfile=${PWD}/release.$(date +%y-%m-%d-%T).log
# This script attempts to generate a release like tarball
# of the project in the absense of full autotooling support
#
# Since the autotooling support is missing for now
# we'll create an archive with git-archive.
if [ ! -d .git ]; then
echo "Fatal: Not a git project. Bailing"
exit 1
fi
# Determine the library name and version.
PROJVER=libdfp-$(git describe --tags)
# Generate the archive.
if ! git archive --format=tar --prefix=${PROJVER}/ HEAD > ${PROJVER}.tar ; then
echo "Failed to archive"
exit 1
fi
# Generate a changelog and append it.
mkdir ${PROJVER}
./generate-changelog.sh > ${PROJVER}/ChangeLog.md
tar rf ${PROJVER}.tar ${PROJVER}/ChangeLog.md
# Remove any files which needn't exist.
tar f ${PROJVER}.tar \
--delete ${PROJVER}/{make-release.sh,generate-changelog.sh,ChangeLog.old.md}
rm -rf ${PROJVER}
gzip -f ${PROJVER}.tar
tarballs="${PROJVER}.tar.gz"
tar xf ${PROJVER}.tar.gz --warning=no-timestamp
# Attempt a VPATH build.
cd ${PROJVER}
# Update timestamps to prevent odd issues.
touch configure.ac aclocal.m4 configure Makefile.am Makefile.in
mkdir _build
cd _build
echo "Running configure"
if ! ../configure >> ${logfile} 2>&1 ; then
echo "Failed to configure"
exit 1
fi
echo "Running make"
if ! make -j8 >> ${logfile} 2>&1 ; then
echo "Failed to make"
exit 1
fi
echo "Running make check"
if ! make check >> ${logfile} 2>&1 ; then
echo "Failed to check"
fi
cd ../..
rm -rf libdfp
echo "Found tarballs: $tarballs"
# Generate some popular checksums for the tarball.
for tarball in ${tarballs}; do
for sum in sha256 md5; do
echo "Generating ${tarball}.${sum}"
${sum}sum ${tarball} > ${tarball}.${sum}
done
done
# TODO: Support signing these releases
exit 0