Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
juliogonzalez committed Aug 28, 2014
0 parents commit 40a0e25
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 0 deletions.
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
tds_fdw
=======

CentOS/RH/Amazon RPMs for tds_fdw <https://github.com/GeoffMontee/tds_fdw> and postgresql 9.3.4 or later

Tested on x64 CentOS 6.4 and Amazon Linux 2014.03

tds_fdw is a PostgreSQL foreign data wrapper that can connect to databases that use the Tabular Data Stream (TDS) protocol, such as Sybase databases and
Microsoft SQL server.

It does not yet support write operations, as added in PostgreSQL 9.3.

Requirements
------------

To build:

* freetds-devel
* postgresql93-devel
* automake
* gcc-c++
* Git
* rpmbuild

To install the RPM

* postgresql93 >= 9.3.4
* postgresql93-server >= 9.3.4
* postgresql93-libs >= 9.3.4
* freetds >= 0.91

Building fresh RPMs
-------------------

Clone the repo:

[email protected]:juliogonzalez/tds_fdw-rpm.git
cd tds_fdw-rpm


Build the tds_fdw RPM
---------------------

Build the RPMs:

./tds-fdw_rpm

And install:

rpm -Uvh RPMS/$HOSTTYPE/postgresql-93-tds_fdw-1.0.1-1.*.$HOSTTYPE.rpm
55 changes: 55 additions & 0 deletions SPECS/tds_fdw.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
Name: postgresql-93-tds_fdw
Version: 1.0.1
Release: 1%{?dist}
Summary: TDS foreing data wrapper for PostgreSQL 9.3

License: None
URL: https://github.com/GeoffMontee/tds_fdw
Source: https://github.com/GeoffMontee/tds_fdw/archive/v%{version}.tar.gz

Requires: postgresql93 >= 9.3.4
Requires: postgresql93-server >= 9.3.4
Requires: postgresql93-libs >= 9.3.4
Requires: freetds >= 0.91

BuildRequires: freetds-devel, postgresql93-devel
BuildRequires: automake, gcc-c++

%description
This is a PostgreSQL foreign data wrapper that can connect to databases that
use the Tabular Data Stream (TDS) protocol, such as Sybase databases and
Microsoft SQL server.
.
It does not yet support write operations, as added in PostgreSQL 9.3.

%global debug_package %{nil}

%prep
%setup -q -n tds_fdw-1.0.1


%build
PATH=/usr/pgsql-9.3/bin:$PATH make USE_PGXS=1

%install
rm -rf %{buildroot}
PATH=/usr/pgsql-9.3/bin:$PATH make USE_PGXS=1 install DESTDIR=%{buildroot}
mkdir %{buildroot}/usr/share/doc/%{name}-%{version}
mv %{buildroot}/usr/share/doc/pgsql/extension/README.tds_fdw.md %{buildroot}/usr/share/doc/%{name}-%{version}/README.md
rm -rf %{buildroot}/usr/share/doc/pgsql/extension/

%clean
rm -rf %{buildroot}

%files
%attr(755, root, root)/usr/pgsql-9.3/lib/tds_fdw.so
%attr(644, root, root)/usr/pgsql-9.3/share/extension/tds_fdw--1.0.1.sql
%attr(644, root, root)/usr/pgsql-9.3/share/extension/tds_fdw.control
%doc /usr/share/doc/%{name}-%{version}/README.md



%changelog

* Thu Aug 28 2014 Julio Gonzalez Gil <[email protected]> - 1.0.1
- Initial build of 1.0.1 from https://github.com/GeoffMontee/tds_fdw
2 changes: 2 additions & 0 deletions clean
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
rm -rf BUILD/* BUILDROOT/* RPMS/* SRPMS/* SOURCES/*.tar.gz
26 changes: 26 additions & 0 deletions tds_fdw-rpm
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
function check_create_dir {
if [ ! -d "./$1" ]; then
mkdir "./$1"
fi
}

# Create build environment
check_create_dir BUILD
check_create_dir BUILDROOT
check_create_dir RPMS
check_create_dir SOURCES
check_create_dir SPECS
check_create_dir SRPMS

if [ ! -f './SOURCES/v1.0.1.tar.gz' ]; then
wget 'https://github.com/GeoffMontee/tds_fdw/archive/v1.0.1.tar.gz' -O './SOURCES/v1.0.1.tar.gz'
fi

rpmbuild --define "_topdir `pwd`" -ba 'SPECS/tds_fdw.spec'

if [ $? -eq 0 ]; then
echo Your packages are available at $PWD/RPMS.
else
echo There are errors. Check your log.
fi

0 comments on commit 40a0e25

Please sign in to comment.