/[gentoo-projects]/portage-utils/make-tarball.sh
Gentoo

Contents of /portage-utils/make-tarball.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.21 - (show annotations) (download) (as text)
Sun Dec 18 20:34:36 2011 UTC (2 years, 6 months ago) by vapier
Branch: MAIN
Changes since 1.20: +15 -6 lines
File MIME type: text/x-sh
include a final summary once tests have passed

1 #!/bin/bash
2
3 set -e
4
5 if ! . /etc/init.d/functions.sh 2>/dev/null ; then
6 einfo() { echo " * $*"; }
7 eerror() { echo " * $*" 1>&2; }
8 fi
9
10 v() { printf '\t%s\n' "$*"; "$@"; }
11
12 : ${MAKE:=make}
13
14 if [[ $# -ne 1 ]] ; then
15 eerror "Usage: $0 <ver>" 1>&2
16 exit 1
17 fi
18
19 ver="$1"
20 [[ "$ver" == "snap" ]] && ver=$(date -u +%Y%m%d)
21 p="portage-utils-$ver"
22
23 rm -rf "${p}"
24 mkdir "${p}"
25
26 einfo "Checking out clean cvs sources ..."
27 cp -a CVS "${p}"/
28 cd "${p}"
29 v cvs -Q up
30
31 einfo "Building autotools ..."
32 sed -i "/^AC_INIT/s:cvs:${ver}:" configure.ac
33 sed -i "1iPV := ${ver}" Makefile
34 LC_ALL=C ${MAKE} -s autotools >/dev/null
35 rm -rf autom4te.cache
36 cd ..
37
38 einfo "Generating tarball ..."
39 find "${p}" -type d -name CVS -prune -print0 | xargs -0 rm -rf
40 tar cf - "${p}" | xz > "${p}".tar.xz
41 rm -r "${p}"
42 du -b "${p}".tar.*
43
44 einfo "Checking tarball (simple) ..."
45 tar xf "${p}".tar.*
46 pushd "${p}" >/dev/null
47 v ${MAKE} -s
48 v ${MAKE} -s check
49 popd >/dev/null
50 rm -rf "${p}"
51
52 einfo "Checking tarball (autotools) ..."
53 tar xf "${p}".tar.*
54 pushd "${p}" >/dev/null
55 v ./configure -q
56 v ${MAKE} -s
57 v ${MAKE} -s check
58 popd >/dev/null
59 rm -rf "${p}"
60
61 echo
62 einfo "All ready for distribution!"
63 du -b "${p}".tar.*
64
65 exit 0

  ViewVC Help
Powered by ViewVC 1.1.20