Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Commit

Permalink
Fix scripts for building deb package
Browse files Browse the repository at this point in the history
  • Loading branch information
seven1m committed Sep 26, 2015
1 parent 37cd4ea commit 1355a82
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -28,3 +28,4 @@ script/package
Vagrantfile.local
.gem
coverage
cache.tar.gz
2 changes: 0 additions & 2 deletions .pkgr.yml
Expand Up @@ -3,8 +3,6 @@ homepage: https://church.io/onebody
description: private member portal for churches, built with Ruby on Rails
changelog: RELEASES.md
license: AGPL
version: 3.5.0-pre

dependencies:
- mysql-server
- libxml2
Expand Down
11 changes: 9 additions & 2 deletions Vagrantfile
Expand Up @@ -113,9 +113,13 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |global_config|

global_config.vm.define "deb" do |deb|
deb.vm.box = "debian/jessie64"
deb.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
end
deb.vm.provision :shell, inline: <<-SCRIPT
set -e
apt-get install -y git ruby2.1 ruby2.1-dev rubygems
apt-get update
apt-get install -y git ruby2.1 ruby2.1-dev rubygems libmysqlclient-dev libpq-dev libevent-dev libxml2-dev libxslt1-dev libreadline-dev build-essential
cd /opt
if [[ -d pkgr ]]; then
cd pkgr
Expand All @@ -124,9 +128,12 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |global_config|
git clone https://github.com/seven1m/pkgr.git
cd pkgr
fi
chown -R vagrant /opt/pkgr
gem install bundler --no-rdoc --no-ri
bundle install
ln -sf /opt/pkgr/bin/pkgr /usr/bin/pkgr
grep "pkgr" /home/vagrant/.bashrc || echo "PATH=/opt/pkgr/bin:\\$PATH" >> /home/vagrant/.bashrc
mkdir -p /tmp/pkgr-cache
chown -R vagrant /tmp/pkgr-cache
SCRIPT
end
end
22 changes: 17 additions & 5 deletions build/deb_build
@@ -1,12 +1,24 @@
#!/bin/bash

RUBY_VERSION=2.2.3
ONEBODY_VERSION=$(cat ../VERSION | tr -d '\n')
set -e

DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd $DIR/..

mkdir -p /tmp/pkgr-cache

sed -i "1iruby '$RUBY_VERSION'" ../Gemfile
RUBY_VERSION=$(cat .ruby-version | tr -d '\n')
ONEBODY_VERSION=$(cat VERSION | tr -d '\n')

# explicitly set the ruby version, and tell bundler how to build nokogiri...
sed -i "1iruby '$RUBY_VERSION'" Gemfile
bundle config --local build.nokogiri "--use-system-libraries --with-xml2-include=/usr/include/libxml2"
bundle config --local build.nokogumbo "--use-system-libraries --with-xml2-include=/usr/include/libxml2"

pkgr package .. --version=$ONEBODY_VERSION
# build the package!
pkgr package . --version=$ONEBODY_VERSION

sed -i '/^ruby/d' ../Gemfile
# put configs back like they were...
sed -i '/^ruby/d' Gemfile
bundle config --delete build.nokogiri
bundle config --delete build.nokogumbo

0 comments on commit 1355a82

Please sign in to comment.