Skip to content

Instantly share code, notes, and snippets.

@theladyjaye
Forked from justone/build_gitolite_deb.sh
Created October 4, 2012 21:49
Show Gist options
  • Save theladyjaye/3836699 to your computer and use it in GitHub Desktop.
Save theladyjaye/3836699 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