s4-winbindd: Do not ask for a tree that we will not use
[ira/wip.git] / release-scripts / create-tarball
index 3e80cd1f07a1fafcad08cd52387b363315654107..e6a515f48a646c57777c983c4b7895695000871b 100755 (executable)
@@ -3,7 +3,6 @@
 ## option defaults
 OPT_BRANCH=""
 OPT_DOCSDIR=""
-OPT_TAG=""
 OPT_KEYID=""
 
 TOPDIR="`dirname $0`/.."
@@ -32,7 +31,6 @@ function printUsage
     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 "    --tag <name>       Tag name for release"
     echo "    --keyid <email>    The GnuPG key ID used to sign the release tag"
     echo ""
 }
@@ -67,15 +65,6 @@ function parseOptions
                OPT_DOCSDIR="$1"
                shift
                ;;
-           --tag)
-               shift
-               if [ -z "$1" ]; then
-                   printUsage
-                   return 1
-               fi
-               OPT_TAG="$1"
-               shift
-               ;;
            --keyid)
                shift
                if [ -z "$1" ]; then
@@ -100,7 +89,7 @@ function parseOptions
 }
 
 ##
-## Build the dopcumentation (may be a no-op)
+## Build the documentation (may be a no-op)
 ##
 
 function buildDocs
@@ -116,6 +105,19 @@ function buildDocs
        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
 
@@ -132,13 +134,10 @@ function buildDocs
 ##
 function createReleaseTag
 {
-    if [ -z "${OPT_TAG}" ]; then
-       echo "Tagging disabled"
-       return 0
-    fi
+    tagname="$1"
 
-    if [ "x`git tag -l ${OPT_TAG}`" != "x" ]; then
-       echo -n "Tag exists.  Do you wish to overwrite? (y/N): "
+    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
@@ -155,8 +154,8 @@ function createReleaseTag
        fi
     fi
 
-    git tag -u ${OPT_KEYID} ${OPT_TAG}
-    exitOnError $? "Failed to create tag"
+    git tag -u ${OPT_KEYID} ${tagname}
+    exitOnError $? "Failed to create tag '${tagname}'"
 
     return 0
 }
@@ -183,7 +182,7 @@ function main
     if [ -n "$vendor_version" ]; then
        version="$version-$vendor_version"
     fi
-    vendor_patch=`grep "define SAMBA_VERSION_VENDOR_PATCH" $VER_H | awk '{print $3}'`
+    vendor_patch=`grep "define SAMBA_VERSION_VENDOR_PATCH_STRING" $VER_H | awk '{print $3}'`
     if [ -n "$vendor_patch" ]; then
        version="$version-$vendor_patch"
     fi
@@ -197,6 +196,16 @@ function main
 
     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
@@ -216,7 +225,7 @@ function main
 
     popd
 
-    createReleaseTag
+    createReleaseTag "samba-${version}"
     exitOnError $? "Failed to create release tag"
 
     return 0