Skip to content

Instantly share code, notes, and snippets.

@NaanProphet
Created May 12, 2017 15:08
Show Gist options
  • Save NaanProphet/cdf69bc6ac1ea504ac6f7110d595bab4 to your computer and use it in GitHub Desktop.
Save NaanProphet/cdf69bc6ac1ea504ac6f7110d595bab4 to your computer and use it in GitHub Desktop.
OS X script that compiles rsync binary from source with detect-renamed patch
#!/bin/sh
# rsync 3.1.2 patched with additional options
# detect-renamed
# detect-renamed-lax
# detect-moved options
# special thanks to:
# https://moderncaveman.org/projects/modern/rsync-detect-renamed/patching-rsync-for-renamed.html
# note: the improved 3.0.9 from the above URL is already part of 3.1.x
COMPILE_DIR=rsync-compile
VERSION=3.1.2
mkdir -p ${COMPILE_DIR}
cd ${COMPILE_DIR}
# only download if not present
if [ ! -f rsync-${VERSION}.tar.gz ]; then
wget https://download.samba.org/pub/rsync/src/rsync-${VERSION}.tar.gz
fi
if [ ! -f rsync-patches-${VERSION}.tar.gz ]; then
wget https://download.samba.org/pub/rsync/src/rsync-patches-${VERSION}.tar.gz
fi
# clear old working folder, if exists
rm -rf rsync-${VERSION} 2> /dev/null
tar xzvf rsync-${VERSION}.tar.gz
tar xzvf rsync-patches-${VERSION}.tar.gz
cd rsync-${VERSION}
patch -p1 <patches/detect-renamed.diff
patch -p1 <patches/detect-renamed-lax.diff
./configure --quiet
make --quiet
make install --quiet
echo "COMPILATION COMPLETE: ${COMPILE_DIR}/rsync-${VERSION}/rsync"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment