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.

Revisions

  1. @justone justone revised this gist Aug 3, 2012. 2 changed files with 13 additions and 6 deletions.
    17 changes: 12 additions & 5 deletions build_gitolite_deb.sh
    Original file line number Diff line number Diff line change
    @@ -10,20 +10,27 @@ gem install fpm
    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 \
    --after-install ../../postinstall.sh \
    --before-remove ../../preuninstall.sh \
    --description "Gitolite is an access control layer on top of git." \
    --iteration 1+squeeze \
    --iteration 2+squeeze \
    --exclude "*.git*" \
    --prefix /usr/share \
    gitolite
    --prefix /usr/share/gitolite \
    .

    # move built package back to script dir
    mv *.deb ../..
    2 changes: 1 addition & 1 deletion postinstall.sh
    Original file line number Diff line number Diff line change
    @@ -2,5 +2,5 @@

    # symlink to someplace useful
    if [[ ! -e /usr/bin/gitolite || -L /usr/bin/gitolite ]]; then
    ln -sf /usr/share/gitolite/src/gitolite /usr/bin/gitolite
    ln -sf /usr/share/gitolite/gitolite /usr/bin/gitolite
    fi
  2. @justone justone revised this gist Aug 2, 2012. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions build_gitolite_deb.sh
    Original file line number Diff line number Diff line change
    @@ -19,6 +19,7 @@ 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." \
  3. @justone justone revised this gist Aug 1, 2012. 3 changed files with 12 additions and 0 deletions.
    Empty file modified build_gitolite_deb.sh
    100644 → 100755
    Empty file.
    6 changes: 6 additions & 0 deletions postinstall.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    #!/bin/bash

    # symlink to someplace useful
    if [[ ! -e /usr/bin/gitolite || -L /usr/bin/gitolite ]]; then
    ln -sf /usr/share/gitolite/src/gitolite /usr/bin/gitolite
    fi
    6 changes: 6 additions & 0 deletions preuninstall.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    #!/bin/bash

    # clean up symlink
    if [[ -L /usr/bin/gitolite ]]; then
    rm /usr/bin/gitolite
    fi
  4. @justone justone created this gist Aug 1, 2012.
    28 changes: 28 additions & 0 deletions build_gitolite_deb.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    #!/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

    # 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 -))

    fpm -s dir \
    -t deb \
    -n gitolite \
    -v "$VER.$EXTRA" \
    --after-install postinstall.sh \
    --before-remove preuninstall.sh \
    --description "Gitolite is an access control layer on top of git." \
    --iteration 1+squeeze \
    --exclude "*.git*" \
    --prefix /usr/share \
    gitolite