From 2e8ce7a83c92d3f4aed2b7a1de94cbc98e6add59 Mon Sep 17 00:00:00 2001 From: Phil Date: Thu, 13 Feb 2020 06:32:49 +1030 Subject: [PATCH] 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 --- INSTALL.md | 45 ++++++++++++++++++++++++++++++++++++++------- README.md | 8 ++++++-- pgloader.spec | 23 +++++++++++++++++++---- 3 files changed, 63 insertions(+), 13 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 3b96ad1..661f2f9 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -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`. +To build and install pgloader the Steel Bank Common Lisp package (sbcl) from EPEL, +and the freetds packages are required. -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. +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 diff --git a/README.md b/README.md index c2d6d7d..a6b8c21 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/pgloader.spec b/pgloader.spec index 7725b45..9198968 100644 --- a/pgloader.spec +++ b/pgloader.spec @@ -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 @@ -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} @@ -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 - 3.6.1 +- Release 3.6.1 +- Use Requires and BuildRequires +- Variablise Source0 +- Fix Files + * Thu Jan 22 2015 Dimitri Fontaine - 3.2.1.preview-22 - Release 3.2.1.preview