Skip to content

Commit

Permalink
Add RPM packaging for CentOS, with Vagrant provision for this OS.
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitri committed Dec 31, 2013
1 parent d5890f7 commit b9e5845
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 14 deletions.
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,26 +78,26 @@ $(PGLOADER): manifest buildapp

pgloader: $(PGLOADER) ;

new-vm:
vagrant destroy -f
vagrant up

vm:
vagrant up

vm-build: vm
vagrant ssh -c "make -C /vagrant"

test:
$(MAKE) PGLOADER=$(realpath $(PGLOADER)) -C test all

deb:
# intended for use on a debian system
mkdir -p $(DEBUILD_ROOT) && rm -rf $(DEBUILD_ROOT)/*
rsync -Ca --exclude=build/* ./ $(DEBUILD_ROOT)/
cd $(DEBUILD_ROOT) && make -f debian/rules orig
cd $(DEBUILD_ROOT) && debuild -us -uc -sa
cp -a /tmp/pgloader_* build/

rpm:
# intended for use on a CentOS or other RPM based system
mkdir -p $(DEBUILD_ROOT) && rm -rf $(DEBUILD_ROOT)/*
rsync -Ca --exclude=build/* ./ $(DEBUILD_ROOT)/
cd /tmp && tar czf $(HOME)/rpmbuild/SOURCES/pgloader-3.0.96.tar.gz pgloader
cd $(DEBUILD_ROOT) && rpmbuild -ba pgloader.spec
cp -a $(HOME)/rpmbuild/SRPMS/*rpm build
cp -a $(HOME)/rpmbuild/RPMS/x86_64/*rpm build

check: test ;

.PHONY: test
20 changes: 16 additions & 4 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,22 @@
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure("2") do |config|
config.vm.box = "wheezy64"

config.vm.provision "shell" do |s|
s.path = "bootstrap.sh"
s.privileged = false
config.vm.define "wheezy" do |wheezy|
wheezy.vm.box = "wheezy64"

config.vm.provision "shell" do |s|
s.path = "bootstrap-debian.sh"
s.privileged = false
end
end

config.vm.define "centos" do |centos|
centos.vm.box = "CentOS64"

config.vm.provision "shell" do |s|
s.path = "bootstrap-centos.sh"
s.privileged = false
end
end
end
23 changes: 23 additions & 0 deletions bootstrap-centos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

sudo yum -y install yum-utils @development-tools sbcl sqlite-devel

# SBCL 1.1.14
# http://www.mikeivanov.com/post/66510551125/installing-sbcl-1-1-on-rhel-centos-systems
sudo yum -y groupinstall "Development Tools"
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -Uvh epel-release-6*.rpm
sudo yum install -y sbcl.x86_64

wget http://downloads.sourceforge.net/project/sbcl/sbcl/1.1.14/sbcl-1.1.14-source.tar.bz2
tar xfj sbcl-1.1.14-source.tar.bz2
cd sbcl-1.1.14
./make.sh --with-sb-thread --with-sb-core-compression > /dev/null 2>&1
sudo sh install.sh
cd

# remove the old version that we used to compile the newer one.
sudo yum remove -y sbcl

# pgloader
#make -C /vagrant rpm
File renamed without changes.
43 changes: 43 additions & 0 deletions pgloader.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Summary: extract, transform and load data into PostgreSQL
Name: pgloader
Version: 3.0.96
Release: 21%{?dist}
License: The PostgreSQL Licence
Group: System Environment/Base
Source: %{name}-%{version}.tar.gz
URL: https://github.com/dimitri/pgloader

%description
pgloader imports data from different kind of sources and COPY it into
PostgreSQL.

The command language is described in the manual page and allows to describe
where to find the data source, its format, and to describe data processing
and transformation.

Supported source formats include CSV, fixed width flat files, dBase3 files
(DBF), and SQLite and MySQL databases. In most of those formats, pgloader is
able to auto-discover the schema and create the tables and the indexes in
PostgreSQL. In the MySQL case it's possible to edit CASTing rules from the
pgloader command directly.

%prep
%setup -q -n %{name}

%build
%define debug_package %{nil}
make pgloader

%install
install -m 755 -d %{buildroot}/%{_bindir}
cp build/pgloader.exe %{buildroot}/%{_bindir}/pgloader

%files
%doc README.md pgloader.1.md
%{_bindir}/*

%changelog
* Tue Dec 31 2013 Dimitri Fontaine <[email protected]> 3.0.96
- Package as an RPM

%global __os_install_post %{nil}

0 comments on commit b9e5845

Please sign in to comment.