8 TOPDIR
="`dirname $0`/.."
9 VER_H
="${TOPDIR}/source3/include/version.h"
16 if [ ${_error} -eq 0 ]; then
20 echo "FAILURE: ${_msg}"
30 echo "Usage $0 [options]"
31 echo " --help Print command usage"
32 echo " --branch <name> Specify the branch to to create the archive file from"
33 echo " --copy-docs <dir> Copy documentation from <dir> rather than building"
34 echo " --keyid <email> The GnuPG key ID used to sign the release tag"
39 ## Parse the command line options
84 if [ -z "${OPT_BRANCH}" ]; then
85 echo "You must specify a branch name!"
92 ## Build the documentation (may be a no-op)
97 if [ -n "${OPT_DOCSDIR}" ]; then
98 if [ ! -d "${OPT_DOCSDIR}" ]; then
99 exitOnError
1 "${OPT_DOCSDIR} does not exist. Please specify the absolute path."
103 exitOnError $?
"Failed to create docs directory"
105 rsync
-av "${OPT_DOCSDIR}"/ docs
/
106 exitOnError $?
"Failed top copy docs from ${OPT_DOCSDIR}"
109 /bin
/rm -rf test.pdf Samba4
*pdf htmldocs
/Samba4
* htmldocs
/test
110 if [ -d manpages-3
]; then
111 mv manpages-3 manpages
113 if [ -d htmldocs
/manpages-3
]; then
114 mv htmldocs
/manpages-3 htmldocs
/manpages
116 # Sync thanks, history and registry/ into the docs dir
117 rsync
-Ca --exclude=.svn ..
/..
/$OPT_BRANCH/docs-xml
/registry ..
/docs
/
118 rsync
-Ca --exclude=.svn ..
/..
/$OPT_BRANCH/docs-xml
/archives
/ ..
/docs
/
124 echo "Building documentation. This may take a while. Log file in /tmp/docs-build.log.$$"
126 ${TOPDIR}/release-scripts
/build-docs
2> /tmp
/docs-build.log.$$
133 ## Create a release tag
135 function createReleaseTag
139 if [ "x`git tag -l ${tagname}`" != "x" ]; then
140 echo -n "Tag '${tagname}' exists. Do you wish to overwrite? (y/N): "
143 if [ "x$answer" != "xy" ]; then
144 echo "Tag creation aborted."
149 if [ -z "${OPT_KEYID}" ]; then
150 echo -n "Enter the keyid:"
152 if [ -z "${OPT_KEYID}" ]; then
153 exitOnError
1 "No keyid specified"
157 git tag
-u ${OPT_KEYID} ${tagname}
158 exitOnError $?
"Failed to create tag '${tagname}'"
168 exitOnError $?
"Failed to parse options"
172 git checkout
${OPT_BRANCH}
173 exitOnError $?
"Invalid branch name \"${OPT_BRANCH}\""
175 (cd source3
&& .
/script
/mkversion.sh
)
176 if [ ! -f $VER_H ]; then
177 exitOnError
1 "Failed to find ${VER_H}!"
180 version
=`grep "define SAMBA_VERSION_OFFICIAL_STRING" $VER_H | awk '{print $3}'`
181 vendor_version
=`grep "define SAMBA_VERSION_VENDOR_SUFFIX" $VER_H | awk '{print $3}'`
182 if [ -n "$vendor_version" ]; then
183 version
="$version-$vendor_version"
185 vendor_patch
=`grep "define SAMBA_VERSION_VENDOR_PATCH_STRING" $VER_H | awk '{print $3}'`
186 if [ -n "$vendor_patch" ]; then
187 version
="$version-$vendor_patch"
189 version
=`echo $version | sed 's/\"//g'`
191 echo "Creating release tarball for Samba $version"
193 /bin
/rm -rf ..
/samba-
${version}
194 git archive
--format=tar --prefix=samba-
${version}/ HEAD |
(cd ..
&& tar xf
-)
195 exitOnError $?
"Failed to create release directory tree"
197 pushd ..
/samba-
${version}
199 # Remove RFCs as they are non-free content (with a strict interpretation of
202 if [ -d source4
]; then
204 find source4/ -name "rfc*.txt" -exec rm -f {} \
;
205 rm -f source4/ldap_server
/devdocs
/draft-armijo-ldap-syntax-00.txt
206 rm -f source4/ldap_server
/devdocs
/ldapext-ldapv3-vlv-04.txt
209 packaging
/bin
/update-pkginfo
${version} 1 ""
212 exitOnError $?
"Failed to build documentation"
214 ( cd source3
&& .
/autogen.sh
)
217 tar cf samba-
${version}.
tar --exclude=.git
* --exclude=CVS
--exclude=.svn samba-
${version}
218 exitOnError $?
"Failed to create tarball from git tree"
220 gpg
--detach-sign --armor samba-
${version}.
tar
221 ## exitOnError $? "Failed to sign tarball"
223 gzip -9 samba-
${version}.
tar
224 exitOnError $?
"Failed to compress archive"
228 createReleaseTag
"samba-${version}"
229 exitOnError $?
"Failed to create release tag"