Index: Jenkins/Distribute
===================================================================
--- Jenkins/Distribute	(revision ad915e09922eebeb2d0724d3da45ebb698db76f7)
+++ Jenkins/Distribute	(revision 8e58264372ce528a9ded7d9fce84d88a761ff3cd)
@@ -15,4 +15,5 @@
 	SrcDir    = pwd tmp: false
 	Settings  = null
+	final Version
 
 	// Local variables
@@ -22,54 +23,34 @@
 	currentBuild.result = "SUCCESS"
 
-	try {
-		//Wrap build to add timestamp to command line
-		wrap([$class: 'TimestamperBuildWrapper']) {
+	//Wrap build to add timestamp to command line
+	wrap([$class: 'TimestamperBuildWrapper']) {
 
-			final commit, build
-			(commit, build) = prepare_build()
+		final commit, build
+		(commit, build) = prepare_build()
 
-			node('x64') {
-				BuildDir  = pwd tmp: true
-				SrcDir    = pwd tmp: false
-
-				Tools.Clean()
-
-				Tools.Checkout( commit )
-
-				final version = GetVersion( build )
-			}
-
-			// Update the build directories when exiting the node
+		node('x64') {
 			BuildDir  = pwd tmp: true
 			SrcDir    = pwd tmp: false
+
+			Tools.Clean()
+
+			Tools.Checkout( commit )
+
+			Version = GetVersion( build )
+
+			Configure()
+
+			Package()
+
+			Test()
+
+			Archive()
 		}
+
+		// Update the build directories when exiting the node
+		BuildDir  = pwd tmp: true
+		SrcDir    = pwd tmp: false
 	}
 
-	//If an exception is caught we need to change the status and remember to
-	//attach the build log to the email
-	// catch (Exception caughtError) {
-		// //rethrow error later
-		// err = caughtError
-
-		// echo err.toString()
-
-		// //An error has occured, the build log is relevent
-		// log_needed = true
-
-		// //Store the result of the build log
-		// currentBuild.result = "${StageName} FAILURE".trim()
-	// }
-
-	finally {
-		// //Send email with final results if this is not a full build
-		// email(log_needed)
-
-		// echo 'Distribution Completed'
-
-		// /* Must re-throw exception to propagate error */
-		// if (err) {
-		// 	throw err
-		// }
-	}
 }
 
@@ -90,4 +71,47 @@
 
 	return version
+}
+
+def Configure() {
+	Tools.BuildStage('Configure', true) {
+		// Configure must be run inside the tree
+		dir (SrcDir) {
+			// Generate the necessary build files
+			sh './autogen.sh'
+		}
+
+		// Build outside of the src tree to ease cleaning
+		dir (BuildDir) {
+			// Configure the compilation (Output is not relevant)
+			// Use the current directory as the installation target so nothing escapes the sandbox
+			// Also specify the compiler by hand
+			sh "${SrcDir}/configure CXX=g++-9 CC=gcc-9 AR=gcc-ar RANLIB=gcc-ranlib --quiet"
+
+			// Configure libcfa
+			sh 'make -j 8 --no-print-directory configure-libcfa'
+		}
+	}
+}
+
+def Package() {
+	Tools.BuildStage('Package', true) {
+		dir (BuildDir) {
+			sh "make VERSION=${Version} dist"
+		}
+	}
+}
+
+def Test() {
+	Tools.BuildStage('Package', true) {
+		dir (BuildDir) {
+			sh "make VERSION=${Version} distcheck -j 8"
+		}
+	}
+}
+
+def Archive() {
+	dir (BuildDir) {
+		archiveArtifacts artifacts: "cfa-cc-*.tar.gz", fingerprint: true
+	}
 }
 
