diff --git a/buildpackages.sh b/buildpackages.sh
index 10e1eac9c5b5a9edf86d3cf85274244623fa35fa..21dc8ab882c833ea609c2892fb9d3bb2a5bd3957 100755
--- a/buildpackages.sh
+++ b/buildpackages.sh
@@ -13,7 +13,13 @@ cd "$(dirname "$BASH_SOURCE")/.."
 
 FAILED_TESTS=""
 
-for DISTRIBUTION in stretch xenial; do
+DISTRIBUTIONS=( stretch xenial trusty )
+
+if [ -n "$1" ]; then
+	DISTRIBUTIONS=( "$@" )
+fi
+
+for DISTRIBUTION in "${DISTRIBUTIONS[@]}"; do
 	rm -rf libshadertoy-$LIBVERSION-$DISTRIBUTION
 	mkdir -p libshadertoy-$LIBVERSION-$DISTRIBUTION