-
-
Save akademic/5597838 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ -z $1 ] || [ -z $2 ] || [ -z $3 ] ; then | |
echo 'Usage: ./btsync_create_deb.sh <btsync_version> <debian_arch> <deb_packet_version>' | |
exit 1 | |
fi | |
BT_VERSION=$1 | |
DEB_ARCH=$2 | |
DEB_PACKET_VERSION=$3 | |
case $DEB_ARCH in | |
amd64) | |
BT_ARCH="x64" | |
;; | |
i386) | |
BT_ARCH="i386" | |
;; | |
esac | |
DEB_VERSION=$BT_VERSION"-"$DEB_PACKET_VERSION"_"$DEB_ARCH | |
DEB_PACKET_NAME="btsync_"$DEB_VERSION".deb" | |
DISTR_NAME="btsync_"$BT_ARCH"-"$BT_VERSION | |
DISTR_FILE=$DISTR_NAME".tar.gz" | |
DISTR_LINK="http://syncapp.bittorrent.com/"$BT_VERSION"/"$DISTR_FILE | |
#download btsync | |
wget $DISTR_LINK | |
tar xzvf $DISTR_FILE | |
DEB_DISTR_NAME="btsync_"$DEB_VERSION | |
mkdir $DEB_DISTR_NAME | |
mkdir -p $DEB_DISTR_NAME"/usr/bin" | |
cp btsync $DEB_DISTR_NAME"/usr/bin" | |
mkdir -p $DEB_DISTR_NAME"/usr/share/doc/btsync" | |
cp LICENSE.TXT $DEB_DISTR_NAME"/usr/share/doc/btsync" | |
mkdir $DEB_DISTR_NAME"/DEBIAN" | |
cat <<EOF > $DEB_DISTR_NAME"/DEBIAN/control" | |
Package: btsync | |
Source: btsync | |
Version: $BT_VERSION | |
Architecture: $DEB_ARCH | |
Maintainer: Dmitry Yudin <public@akademic.name> | |
Section: net | |
Priority: optional | |
Homepage: http://labs.bittorrent.com/experiments/sync.html | |
Description: BitTorrent Sync synchronizes your files using a peer-to-peer (P2P) protocol. | |
This protocol is very effective for transferring large files across multiple devices, and is very similar to the powerful protocol used by applications like µTorrent and BitTorrent. | |
The data is transferred in pieces from each of the syncing devices, and BitTorrent Sync chooses the optimal algorithm to make sure you have a maximum download and upload speed during the process. | |
EOF | |
dpkg -b $DEB_DISTR_NAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment