Update rpm spec file (#1039)

* 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
This commit is contained in:
Phil 2020-02-13 06:32:49 +10:30 committed by GitHub
parent bbcce92418
commit 2e8ce7a83c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 63 additions and 13 deletions

View File

@ -27,14 +27,45 @@ about how to backport a recent enough SBCL here (1.2.5 or newer).
### Redhat / CentOS ### Redhat / CentOS
You will need to install the Steel Bank Common Lisp package (sbcl) from EPEL, as To build and install pgloader the Steel Bank Common Lisp package (sbcl) from EPEL,
well as the freetds-devel package for some shared libraries. With RHEL/CentOS 6, and the freetds packages are required.
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. With RHEL/CentOS 6, if the packaged version of sbcl isn't >=1.3.6, you'll need
Please report to us if your standard RHEL/CentOS installation required additional steps. 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 ### Mac OS X

View File

@ -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 $ apt-get install sbcl unzip libsqlite3-dev make curl gawk freetds-dev libzip-dev
$ cd /path/to/pgloader $ cd /path/to/pgloader
$ make pgloader $ make pgloader
$ ./build/bin/pgloader --help $ ./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 ### Building from sources on macOS

View File

@ -1,11 +1,20 @@
Summary: extract, transform and load data into PostgreSQL Summary: extract, transform and load data into PostgreSQL
Name: pgloader Name: pgloader
Version: 3.3.2 Version: 3.6.1
Release: 22%{?dist} Release: 22%{?dist}
License: The PostgreSQL Licence License: The PostgreSQL Licence
Group: System Environment/Base Group: System Environment/Base
Source: %{name}-%{version}.tar.gz
URL: https://github.com/dimitri/pgloader 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 %description
pgloader imports data from different kind of sources and COPY it into pgloader imports data from different kind of sources and COPY it into
@ -22,7 +31,7 @@ PostgreSQL. In the MySQL case it's possible to edit CASTing rules from the
pgloader command directly. pgloader command directly.
%prep %prep
%setup -q -n %{name} %setup -q -n %{name}-%{version}
%build %build
%define debug_package %{nil} %define debug_package %{nil}
@ -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 echo '-b /usr/bin/pgloader' > $RPM_BUILD_ROOT/etc/prelink.conf.d/%{name}.conf
%files %files
%doc README.md pgloader.1.md %doc README.md
%{_bindir}/* %{_bindir}/*
/etc/prelink.conf.d/%{name}.conf /etc/prelink.conf.d/%{name}.conf
%changelog %changelog
* Tue Sep 24 2019 Phil Ingram <pingram.au@gmail.com> - 3.6.1
- Release 3.6.1
- Use Requires and BuildRequires
- Variablise Source0
- Fix Files
* Thu Jan 22 2015 Dimitri Fontaine <dimitri@2ndQuadrant.fr> - 3.2.1.preview-22 * Thu Jan 22 2015 Dimitri Fontaine <dimitri@2ndQuadrant.fr> - 3.2.1.preview-22
- Release 3.2.1.preview - Release 3.2.1.preview