Created
August 1, 2012 23:47
-
-
Save justone/3231632 to your computer and use it in GitHub Desktop.
gitolite v3 debian package
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/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 ../.. |
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/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 |
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/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