summaryrefslogtreecommitdiff
path: root/release-scripts/create-tarball
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2013-05-23 09:38:47 +1000
committerAndrew Bartlett <abartlet@samba.org>2013-05-27 11:57:04 +1000
commita153eb0d2198a774f7c046f9e96c73d55405877e (patch)
treeb2185d293f7e94ef3fa6cf9f5916954bf34c2fa2 /release-scripts/create-tarball
parent8903103bd691c3927a644ed9162d6412df9ffeea (diff)
downloadsamba-a153eb0d2198a774f7c046f9e96c73d55405877e.tar.gz
samba-a153eb0d2198a774f7c046f9e96c73d55405877e.tar.bz2
samba-a153eb0d2198a774f7c046f9e96c73d55405877e.zip
build: Remove old create-tarball release script
Releases are now done via "waf dist" and script/librelease.sh. Andrew Bartlett Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Diffstat (limited to 'release-scripts/create-tarball')
-rwxr-xr-xrelease-scripts/create-tarball235
1 files changed, 0 insertions, 235 deletions
diff --git a/release-scripts/create-tarball b/release-scripts/create-tarball
deleted file mode 100755
index e6a515f48a..0000000000
--- a/release-scripts/create-tarball
+++ /dev/null
@@ -1,235 +0,0 @@
-#!/bin/bash
-
-## option defaults
-OPT_BRANCH=""
-OPT_DOCSDIR=""
-OPT_KEYID=""
-
-TOPDIR="`dirname $0`/.."
-VER_H="${TOPDIR}/source3/include/version.h"
-
-function exitOnError
-{
- local _error="$1"
- local _msg="$2"
-
- if [ ${_error} -eq 0 ]; then
- return 0
- fi
-
- echo "FAILURE: ${_msg}"
- exit ${_error}
-}
-
-##
-## Print help usage
-##
-
-function printUsage
-{
- echo "Usage $0 [options]"
- echo " --help Print command usage"
- echo " --branch <name> Specify the branch to to create the archive file from"
- echo " --copy-docs <dir> Copy documentation from <dir> rather than building"
- echo " --keyid <email> The GnuPG key ID used to sign the release tag"
- echo ""
-}
-
-##
-## Parse the command line options
-##
-
-function parseOptions
-{
- while [ -n "$1" ]; do
- case "$1" in
- --help)
- printUsage
- exit 0
- ;;
- --branch)
- shift
- if [ -z "$1" ]; then
- printUsage
- return 1
- fi
- OPT_BRANCH="$1"
- shift
- ;;
- --copy-docs)
- shift
- if [ -z "$1" ]; then
- printUsage
- return 1
- fi
- OPT_DOCSDIR="$1"
- shift
- ;;
- --keyid)
- shift
- if [ -z "$1" ]; then
- printUsage
- return 1
- fi
- OPT_KEYID="$1"
- shift
- ;;
- *)
- printUsage
- return 1
- ;;
- esac
- done
-
- if [ -z "${OPT_BRANCH}" ]; then
- echo "You must specify a branch name!"
- printUsage
- return 1
- fi
-}
-
-##
-## Build the documentation (may be a no-op)
-##
-
-function buildDocs
-{
- if [ -n "${OPT_DOCSDIR}" ]; then
- if [ ! -d "${OPT_DOCSDIR}" ]; then
- exitOnError 1 "${OPT_DOCSDIR} does not exist. Please specify the absolute path."
- fi
-
- mkdir docs
- exitOnError $? "Failed to create docs directory"
-
- rsync -av "${OPT_DOCSDIR}"/ docs/
- exitOnError $? "Failed top copy docs from ${OPT_DOCSDIR}"
-
- cd docs/
- /bin/rm -rf test.pdf Samba4*pdf htmldocs/Samba4* htmldocs/test
- if [ -d manpages-3 ]; then
- mv manpages-3 manpages
- fi
- if [ -d htmldocs/manpages-3 ]; then
- mv htmldocs/manpages-3 htmldocs/manpages
- fi
- # Sync thanks, history and registry/ into the docs dir
- rsync -Ca --exclude=.svn ../../$OPT_BRANCH/docs-xml/registry ../docs/
- rsync -Ca --exclude=.svn ../../$OPT_BRANCH/docs-xml/archives/ ../docs/
- cd ../
-
- return 0
- fi
-
- echo "Building documentation. This may take a while. Log file in /tmp/docs-build.log.$$"
-
- ${TOPDIR}/release-scripts/build-docs 2> /tmp/docs-build.log.$$
- return $?
-
-}
-
-
-##
-## Create a release tag
-##
-function createReleaseTag
-{
- tagname="$1"
-
- if [ "x`git tag -l ${tagname}`" != "x" ]; then
- echo -n "Tag '${tagname}' exists. Do you wish to overwrite? (y/N): "
- read answer
-
- if [ "x$answer" != "xy" ]; then
- echo "Tag creation aborted."
- exit 1
- fi
- fi
-
- if [ -z "${OPT_KEYID}" ]; then
- echo -n "Enter the keyid:"
- read OPT_KEYID
- if [ -z "${OPT_KEYID}" ]; then
- exitOnError 1 "No keyid specified"
- fi
- fi
-
- git tag -u ${OPT_KEYID} ${tagname}
- exitOnError $? "Failed to create tag '${tagname}'"
-
- return 0
-}
-##
-## Main driver
-##
-function main
-{
- parseOptions "$@"
- exitOnError $? "Failed to parse options"
-
- cd $TOPDIR
-
- git checkout ${OPT_BRANCH}
- exitOnError $? "Invalid branch name \"${OPT_BRANCH}\""
-
- (cd source3 && ./script/mkversion.sh)
- if [ ! -f $VER_H ]; then
- exitOnError 1 "Failed to find ${VER_H}!"
- fi
-
- version=`grep "define SAMBA_VERSION_OFFICIAL_STRING" $VER_H | awk '{print $3}'`
- vendor_version=`grep "define SAMBA_VERSION_VENDOR_SUFFIX" $VER_H | awk '{print $3}'`
- if [ -n "$vendor_version" ]; then
- version="$version-$vendor_version"
- fi
- vendor_patch=`grep "define SAMBA_VERSION_VENDOR_PATCH_STRING" $VER_H | awk '{print $3}'`
- if [ -n "$vendor_patch" ]; then
- version="$version-$vendor_patch"
- fi
- version=`echo $version | sed 's/\"//g'`
-
- echo "Creating release tarball for Samba $version"
-
- /bin/rm -rf ../samba-${version}
- git archive --format=tar --prefix=samba-${version}/ HEAD | (cd .. && tar xf -)
- exitOnError $? "Failed to create release directory tree"
-
- pushd ../samba-${version}
-
- # Remove RFCs as they are non-free content (with a strict interpretation of
- # the DFSG)
-
- if [ -d source4 ]; then
- echo "Removing RFCs"
- find source4/ -name "rfc*.txt" -exec rm -f {} \;
- rm -f source4/ldap_server/devdocs/draft-armijo-ldap-syntax-00.txt
- rm -f source4/ldap_server/devdocs/ldapext-ldapv3-vlv-04.txt
- fi
-
- packaging/bin/update-pkginfo ${version} 1 ""
-
- buildDocs
- exitOnError $? "Failed to build documentation"
-
- ( cd source3 && ./autogen.sh )
-
- cd ..
- tar cf samba-${version}.tar --exclude=.git* --exclude=CVS --exclude=.svn samba-${version}
- exitOnError $? "Failed to create tarball from git tree"
-
- gpg --detach-sign --armor samba-${version}.tar
- ## exitOnError $? "Failed to sign tarball"
-
- gzip -9 samba-${version}.tar
- exitOnError $? "Failed to compress archive"
-
- popd
-
- createReleaseTag "samba-${version}"
- exitOnError $? "Failed to create release tag"
-
- return 0
-}
-
-main "$@"
-exit $?