]> source.dussan.org Git - rspamd.git/commitdiff
Support dist on FreeBSD and Darwin.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 30 Jun 2015 13:50:31 +0000 (14:50 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 30 Jun 2015 13:50:31 +0000 (14:50 +0100)
CMakeLists.txt
dist.sh

index eae70929632631187200a91208a1ea95b306c84c..dfe9bcfeb07096eed59c224f96d94fc9e2ccb44e 100644 (file)
@@ -421,6 +421,7 @@ IF(NOT BUILD_CPU_MODE)
 ENDIF(NOT BUILD_CPU_MODE)
 
 SET(POE_LOOP "Loop::IO_Poll")
+SET(TAR "tar")
 
 # Platform specific configuration
 IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
@@ -452,6 +453,7 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
                ENDIF(_LIBUTIL_H)
        ENDIF(LIBUTIL_LIBRARY)
        SET(POE_LOOP "Loop::Kqueue")
+       SET(TAR "gtar")
 ENDIF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
 
 IF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
@@ -461,7 +463,7 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
                SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pagezero_size 10000 -image_base 100000000")
        ENDIF(ENABLE_LUAJIT MATCHES "ON")
        MESSAGE(STATUS "Configuring for Darwin")
-
+       SET(TAR "gnutar")
 ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
 
 IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
@@ -1186,7 +1188,7 @@ IF(INSTALL_WEBUI MATCHES "ON")
 ENDIF(INSTALL_WEBUI MATCHES "ON")
 
 ADD_CUSTOM_TARGET(dist ${CMAKE_SOURCE_DIR}/dist.sh
-       "${CMAKE_BINARY_DIR}/rspamd-${RSPAMD_VERSION}.tar.xz"
+       "${CMAKE_BINARY_DIR}/rspamd-${RSPAMD_VERSION}.tar.xz" "${TAR}"
        COMMENT "Create source distribution"
        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
 
diff --git a/dist.sh b/dist.sh
index af4e14e9e024e188a92d48fc4241fdc5cf1696c5..e2ecd8e19aeae6b264cf53f4cc15fb80ecd8c07a 100755 (executable)
--- a/dist.sh
+++ b/dist.sh
@@ -1,7 +1,9 @@
 #!/bin/sh
 
-if [ $# -ne 1 ] ; then
-       echo "Usage: dist.sh <filename>"
+TAR=${2:-"tar"}
+
+if [ $# -lt 1 ] ; then
+       echo "Usage: dist.sh <filename> [tar_command]"
        exit 1
 fi
 
@@ -21,5 +23,5 @@ for sub in $SUBMODULES ; do
        (cd $sub && git ls-files | sed -e "s|^|$sub/|" >> $OUT)
 done
 
-tar -c --exclude='.[^/]*' --exclude='*.xz' --exclude='*.gz' --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