Skip to content

Instantly share code, notes, and snippets.

@justone
Created August 1, 2012 23:47
Show Gist options
  • Save justone/3231632 to your computer and use it in GitHub Desktop.
Save justone/3231632 to your computer and use it in GitHub Desktop.
gitolite v3 debian package
#!/bin/bash
# install rvm
aptitude install -y curl libz-dev
curl -L https://get.rvm.io | bash -s stable --ruby
source /usr/local/rvm/scripts/rvm
gem install fpm
# git clone
aptitude install -y git
git clone https://github.com/sitaramc/gitolite.git
# generate version info (this writes a VERSION file)
./gitolite/install
# create package
DESC=$(cd gitolite; git describe --tags --long)
VER=$(echo $DESC | cut -f 1 -d - | cut -d v -f 2)
EXTRA=$(printf "%02d" $(echo $DESC | cut -f 2 -d -))
cd gitolite/src
fpm -s dir \
-t deb \
-n gitolite \
-v "$VER.$EXTRA" \
-d git \
--after-install ../../postinstall.sh \
--before-remove ../../preuninstall.sh \
--description "Gitolite is an access control layer on top of git." \
--iteration 2+squeeze \
--exclude "*.git*" \
--prefix /usr/share/gitolite \
.
# move built package back to script dir
mv *.deb ../..
#!/bin/bash
# symlink to someplace useful
if [[ ! -e /usr/bin/gitolite || -L /usr/bin/gitolite ]]; then
ln -sf /usr/share/gitolite/gitolite /usr/bin/gitolite
fi
#!/bin/bash
# clean up symlink
if [[ -L /usr/bin/gitolite ]]; then
rm /usr/bin/gitolite
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment