# Install webui
IF(INSTALL_WEBUI MATCHES "ON")
INSTALL(DIRECTORY "interface/" DESTINATION ${WWWDIR} PATTERN ".git" EXCLUDE)
-ENDIF(INSTALL_WEBUI MATCHES "ON")
\ No newline at end of file
+ENDIF(INSTALL_WEBUI MATCHES "ON")
+
+ADD_CUSTOM_TARGET(dist ${CMAKE_SOURCE_DIR}/dist.sh
+ "${CMAKE_BINARY_DIR}/rspamd-${RSPAMD_VERSION}.tar.xz"
+ COMMENT "Create source distribution"
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
\ No newline at end of file
exit 1
fi
-FNAME=shift
+FNAME=$1
PREFIX=`basename $FNAME | sed -e 's/\.tar.*$//'`
OUT=""
(cd $sub && git ls-files | sed -e "s|^|$sub/|" >> $OUT)
done
-tar -c --no-recursion --transform "s|^|$PREFIX/|" -a -T $OUT -v -f $FNAME
+tar -c --exclude='.[^/]*' --exclude='*.xz' --exclude='*.gz' --no-recursion --transform "s|^|$PREFIX/|" -a -T $OUT -v -f $FNAME
rm -f $OUT