Advertisement
Guest User

btsync_create_deb.sh

a guest
Apr 27th, 2014
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.47 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. if [ -z $1 ]  || [ -z $2 ] || [ -z $3 ] ; then
  4.     echo 'Usage: ./btsync_create_deb.sh <btsync_version> <debian_arch> <deb_packet_version>'
  5.     exit 1
  6. fi
  7.  
  8. BT_VERSION=$1
  9. DEB_ARCH=$2
  10. DEB_PACKET_VERSION=$3
  11.  
  12. case $DEB_ARCH in
  13.     amd64)
  14.         BT_ARCH="x64"
  15.         ;;
  16.     i386)
  17.         BT_ARCH="i386"
  18.         ;;
  19. esac
  20.  
  21. DEB_VERSION=$BT_VERSION"-"$DEB_PACKET_VERSION"_"$DEB_ARCH
  22.  
  23. DEB_PACKET_NAME="btsync_"$DEB_VERSION".deb"
  24.  
  25. DISTR_NAME="btsync_"$BT_ARCH"-"$BT_VERSION
  26. DISTR_FILE=$DISTR_NAME".tar.gz"
  27. DISTR_LINK="http://download-lb.utorrent.com/endpoint/btsync/os/linux-i386/track/stable"
  28.  
  29. #download btsync
  30. wget $DISTR_LINK                                                                                                                                                                    
  31.                                                                                                                                                                                    
  32. tar xzvf $DISTR_FILE                                                                                                                                                                
  33.                                                                                                                                                                                    
  34. DEB_DISTR_NAME="btsync_"$DEB_VERSION                                                                                                                                                
  35.                                                                                                                                                                                    
  36. mkdir $DEB_DISTR_NAME                                                                                                                                                              
  37.                                                                                                                                                                                    
  38. mkdir -p $DEB_DISTR_NAME"/usr/bin"                                                                                                                                                  
  39. cp btsync $DEB_DISTR_NAME"/usr/bin"                                                                                                                                                
  40.                                                                                                                                                                                    
  41. mkdir -p $DEB_DISTR_NAME"/usr/share/doc/btsync"                                                                                                                                    
  42. cp LICENSE.TXT $DEB_DISTR_NAME"/usr/share/doc/btsync"                                                                                                                              
  43.                                                                                                                                                                                    
  44. mkdir $DEB_DISTR_NAME"/DEBIAN"                                                                                                                                                      
  45. cat <<EOF > $DEB_DISTR_NAME"/DEBIAN/control"                                                                                                                                        
  46. Package: btsync                                                                                                                                                                    
  47. Source: btsync                                                                                                                                                                      
  48. Version: $BT_VERSION                                                                                                                                                                
  49. Architecture: $DEB_ARCH                                                                                                                                                            
  50. Maintainer: Dmitry Yudin <public@akademic.name>                                                                                                                                    
  51. Section: net                                                                                                                                                                        
  52. Priority: optional                                                                                                                                                                  
  53. Homepage: http://labs.bittorrent.com/experiments/sync.html                                                                                                                          
  54. Description: BitTorrent Sync synchronizes your files using a peer-to-peer (P2P) protocol.                                                                                          
  55.  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.
  56.  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.
  57. EOF
  58.  
  59. dpkg -b $DEB_DISTR_NAME
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement