-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to 1.0.2 and add PostgreSQL 9.4 support
- Loading branch information
1 parent
40a0e25
commit aeceb2a
Showing
4 changed files
with
162 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Name: postgresql-93-tds_fdw | ||
Version: 1.0.1 | ||
Version: 1.0.2 | ||
Release: 1%{?dist} | ||
Summary: TDS foreing data wrapper for PostgreSQL 9.3 | ||
|
||
|
@@ -8,7 +8,7 @@ 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-server >= 9.3.4 | ||
Requires: postgresql93-libs >= 9.3.4 | ||
Requires: freetds >= 0.91 | ||
|
||
|
@@ -25,7 +25,7 @@ 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 | ||
%setup -q -n tds_fdw-1.0.2 | ||
|
||
|
||
%build | ||
|
@@ -43,13 +43,16 @@ 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--1.0.2.sql | ||
%attr(644, root, root)/usr/pgsql-9.3/share/extension/tds_fdw.control | ||
%doc /usr/share/doc/%{name}-%{version}/README.md | ||
|
||
|
||
|
||
%changelog | ||
|
||
* Sun Sep 13 2015 Julio Gonzalez Gil <[email protected]> - 1.0.2 | ||
- 1.0.2 build from https://github.com/GeoffMontee/tds_fdw | ||
|
||
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
Name: postgresql-94-tds_fdw | ||
Version: 1.0.2 | ||
Release: 1%{?dist} | ||
Summary: TDS foreing data wrapper for PostgreSQL 9.4 | ||
|
||
License: None | ||
URL: https://github.com/GeoffMontee/tds_fdw | ||
Source: https://github.com/GeoffMontee/tds_fdw/archive/v%{version}.tar.gz | ||
|
||
Requires: postgresql94 >= 9.4.1 | ||
Requires: postgresql94-server >= 9.4.1 | ||
Requires: postgresql94-libs >= 9.4.1 | ||
Requires: freetds >= 0.91 | ||
|
||
BuildRequires: freetds-devel, postgresql94-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.2 | ||
|
||
|
||
%build | ||
PATH=/usr/pgsql-9.4/bin:$PATH make USE_PGXS=1 | ||
|
||
%install | ||
rm -rf %{buildroot} | ||
PATH=/usr/pgsql-9.4/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.4/lib/tds_fdw.so | ||
%attr(644, root, root)/usr/pgsql-9.4/share/extension/tds_fdw--1.0.2.sql | ||
%attr(644, root, root)/usr/pgsql-9.4/share/extension/tds_fdw.control | ||
%doc /usr/share/doc/%{name}-%{version}/README.md | ||
|
||
|
||
|
||
%changelog | ||
|
||
* Sun Sep 13 2015 Julio Gonzalez Gil <[email protected]> - 1.0.2 | ||
- 1.0.2 build from https://github.com/GeoffMontee/tds_fdw | ||
|
||
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,92 @@ | ||
#!/bin/bash | ||
function check_create_dir { | ||
|
||
SCRIPT=$(basename ${0}) | ||
MODULE_VER="1.0.2" | ||
VERSIONS="9.3 9.4" | ||
|
||
function help() { | ||
echo "" | ||
echo "Script to build tds_fdw RPMs" | ||
echo "" | ||
echo "Syntax: " | ||
echo "" | ||
echo "${SCRIPT} -p <POSTGRESQL_MAJOR_VERSION>" | ||
echo "" | ||
echo "Where: " | ||
echo " -p <POSTGRESQL_MAJOR_VERSION> PostgreSQL major version (format X.Y)" | ||
echo "" | ||
echo "Supported major versions:" | ||
for version in ${VERSIONS}; do | ||
echo "- $version" | ||
done | ||
echo "" | ||
exit 1 | ||
} | ||
|
||
function print_invalid_syntax() { | ||
echo "Invalid syntax, use ${SCRIPT} -h" | ||
} | ||
|
||
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 | ||
function create_build_env() { | ||
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 | ||
function get_sources() { | ||
if [ ! -f "./SOURCES/v${1}.tar.gz" ]; then | ||
wget "https://github.com/GeoffMontee/tds_fdw/archive/v${1}.tar.gz" -O "./SOURCES/v${1}.tar.gz" | ||
fi | ||
} | ||
|
||
function build_rpm() { | ||
PG_SVER=$(echo ${1} | tr -d '.') | ||
rpmbuild --define "_topdir `pwd`" -ba "SPECS/tds_fdw-${PG_SVER}.spec" | ||
return ${?} | ||
} | ||
|
||
rpmbuild --define "_topdir `pwd`" -ba 'SPECS/tds_fdw.spec' | ||
# Parse options | ||
while getopts "p:h" opts; do | ||
case "${opts}" in | ||
p) PG_VER=${OPTARG} ;; | ||
h) help ;; | ||
*) print_invalid_syntax | ||
exit 1 ;; | ||
esac | ||
done | ||
shift $((OPTIND-1)) | ||
|
||
if [ -z "${PG_VER}" ]; then | ||
print_invalid_syntax | ||
exit 1 | ||
fi | ||
FOUND='FALSE' | ||
for tver in ${VERSIONS}; do | ||
if [ "${tver}" == "${PG_VER}" ]; then | ||
FOUND='TRUE' | ||
fi | ||
done | ||
if [ "${FOUND}" == 'FALSE' ]; then | ||
echo "Invalid PostgreSQL major version" | ||
exit 1 | ||
fi | ||
|
||
create_build_env | ||
get_sources ${MODULE_VER} | ||
build_rpm ${PG_VER} | ||
if [ $? -eq 0 ]; then | ||
echo Your packages are available at $PWD/RPMS. | ||
exit 0 | ||
else | ||
echo There are errors. Check your log. | ||
exit 2 | ||
fi |