#!/bin/sh # Example of how to build git-lfs packages for Ubuntu 12.04 # # On newer versions of Ubuntu, you can just do e.g. # wget https://packagecloud.io/github/git-lfs/packages/ubuntu/xenial/git-lfs_1.2.1_i386.deb # but alas, there are no 12.04 packages there. # Fear not, here's how to build them. # sudo apt-get install build-essential devscripts debhelper git wget # Update dpkg (installing dh-golang requires 1.16.2 or later) wget http://archive.ubuntu.com/ubuntu/pool/main/d/dpkg/dpkg_1.17.5ubuntu5.6.tar.xz tar -xf dpkg_1.17.5ubuntu5.6.tar.xz cd dpkg-1.17 sudo apt-get build-dep dpkg sudo apt-get install liblzma-dev debuild -b -uc -us cd .. sudo dpkg -i dpkg_1.17*.deb # Build/install dh-golang (required to build golang's debian package) git clone git://anonscm.debian.org/collab-maint/dh-golang.git cd dh-golang sudo apt-get install libmodule-install-perl debuild -b -uc -us cd .. sudo dpkg -i dh-golang_1.19_all.deb # Install a bootstrap go (required to run godeb) wget https://storage.googleapis.com/golang/go1.6.3.linux-amd64.tar.gz sudo mkdir /usr/local/bootstrap sudo tar -C /usr/local/bootstrap -xzf go1.6.3.linux-amd64.tar.gz export GOROOT=/usr/local/bootstrap/go # Install go via godeb (because dh-golang requires go to be from a package) export GOPATH=$HOME/temp-gopath $GOROOT/bin/go get gopkg.in/niemeyer/godeb.v1/cmd/godeb $GOPATH/bin/godeb install 1.6.3 # Switch to go installed via godeb sudo rm -rf /usr/local/boostrap unset GOROOT unset GOPATH # Get and patch the git-lfs source slightly: git clone https://github.com/github/git-lfs.git cd git-lfs # Comment out the dependency on golang (godeb used a different package name), sed -i 's/golang-go:native (>= 1.3.0),//' debian/control sudo apt-get install ruby-ronn debuild -b -uc -us cd .. # And voila, you have a git-lfs package! ls -l git-lfs_1.2.1_amd64.deb #---- End of build recipe ---- #---- Start of how-to-use-it recipe --- # To use it, you have to install newer git (12.04's 1.7.9 isn't enough): sudo apt-get install python-software-properties sudo add-apt-repository ppa:git-core/ppa sudo apt-get update sudo apt-get install git # Finally, install the git-lfs you built: sudo dpkg -i git-lfs_1.2.1_amd64.deb # The above was terribly complicated, and is only worth it if # you're trying to put git-lfs on a lot of systems. # To do that, copy just the git package from the ppa, # and the git-lfs package you just built, # to the target systems and install them via dpkg -i. # Profit!