Skip to content

Commit

Permalink
Update rpm spec file (#1039)
Browse files Browse the repository at this point in the history
* Update pgloader.spec
- Update from 3.3.2 to 3.6.1
- Use Requires and BuildRequires
- Variablise Source0
- Fix Prep and Files to match source tarball
- Update spec file Changelog

* link to install documentation for RedHat/CentOS. fix tab indentation of debian code block

* Update install instructions for RHEL/CentOS
  • Loading branch information
pingram3030 authored Feb 12, 2020
1 parent bbcce92 commit 2e8ce7a
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 14 deletions.
47 changes: 39 additions & 8 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,45 @@ about how to backport a recent enough SBCL here (1.2.5 or newer).

### Redhat / CentOS

You will need to install the Steel Bank Common Lisp package (sbcl) from EPEL, as
well as the freetds-devel package for some shared libraries. With RHEL/CentOS 6,
if the packaged version isn't >=1.3.6, you'll need to build it from source. With
v7, after installing freetds, you also need to create a softlink from the versioned
shared library `libsybdb.so.5` to `libsybdb.so`.

The above steps are prepared for you with `boostrap-centos.sh` and `bootstrap-centos7.sh` respectively.
Please report to us if your standard RHEL/CentOS installation required additional steps.
To build and install pgloader the Steel Bank Common Lisp package (sbcl) from EPEL,
and the freetds packages are required.

With RHEL/CentOS 6, if the packaged version of sbcl isn't >=1.3.6, you'll need
to build it from source.

It is recommended to build the RPM yourself, see below, to ensure that all installed
files are properly tracked and that you can safely update to newer versions of
pgloader as they're released.

To do an adhoc build and install run `boostrap-centos.sh` for CentOS 6 or
`bootstrap-centos7.sh` for CentOS 7 to install the required dependencies.
[Build pgloader](INSTALL.md#building-pgloader).

#### rpmbuild

The spec file in the root of the pgloader repository can be used to build your
own RPM. For production deployments it is recommended that you build this RPM on
a dedicated build box and then copy the RPM to your production environment for
use; it is considered bad practice to have compilers and build tools present in
production environments.

1. Install the [EPEL repo](https://fedoraproject.org/wiki/EPEL#Quickstart).

1. Install rpmbuild dependencies:

sudo yum -y install yum-utils rpmdevtools @"Development Tools"

1. Install pgloader build dependencies:

sudo yum-builddep pgloader.spec

1. Download pgloader source:

spectool -g -R pgloader.spec

1. Build the source and binary RPMs (see `rpmbuild --help` for other build options):

rpmbuild -ba pgloader.spec

### Mac OS X

Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,12 @@ it builds aginst current set of dependencies versions.

$ apt-get install sbcl unzip libsqlite3-dev make curl gawk freetds-dev libzip-dev
$ cd /path/to/pgloader
$ make pgloader
$ ./build/bin/pgloader --help
$ make pgloader
$ ./build/bin/pgloader --help

### Building from sources on RedHat/CentOS

See "Redhat / CentOS" in [INSTALL.md](INSTALL.md#redhat--centos)

### Building from sources on macOS

Expand Down
23 changes: 19 additions & 4 deletions pgloader.spec
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
Summary: extract, transform and load data into PostgreSQL
Name: pgloader
Version: 3.3.2
Version: 3.6.1
Release: 22%{?dist}
License: The PostgreSQL Licence
Group: System Environment/Base
Source: %{name}-%{version}.tar.gz
URL: https://github.com/dimitri/pgloader
Source0: %{url}/archive/v%{version}.tar.gz

BuildRequires: sbcl
BuildRequires: freetds-devel
BuildRequires: sqlite-devel
BuildRequires: zlib-devel
Requires: freetds
Requires: sbcl
Requires: zlib
Requires: sqlite

%description
pgloader imports data from different kind of sources and COPY it into
Expand All @@ -22,7 +31,7 @@ PostgreSQL. In the MySQL case it's possible to edit CASTing rules from the
pgloader command directly.

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

%build
%define debug_package %{nil}
Expand All @@ -35,11 +44,17 @@ mkdir -p $RPM_BUILD_ROOT/etc/prelink.conf.d
echo '-b /usr/bin/pgloader' > $RPM_BUILD_ROOT/etc/prelink.conf.d/%{name}.conf

%files
%doc README.md pgloader.1.md
%doc README.md
%{_bindir}/*
/etc/prelink.conf.d/%{name}.conf

%changelog
* Tue Sep 24 2019 Phil Ingram <[email protected]> - 3.6.1
- Release 3.6.1
- Use Requires and BuildRequires
- Variablise Source0
- Fix Files

* Thu Jan 22 2015 Dimitri Fontaine <[email protected]> - 3.2.1.preview-22
- Release 3.2.1.preview

Expand Down

0 comments on commit 2e8ce7a

Please sign in to comment.