diff --git a/Makefile b/Makefile index c9cc76b..19a2cdf 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,9 @@ EXTENSION = toastinfo DATA = toastinfo--1.sql REGRESS = toastinfo +ifndef PG_CONFIG PG_CONFIG = pg_config +endif + PGXS = $(shell $(PG_CONFIG) --pgxs) include $(PGXS) diff --git a/SPECS/PGDG/README b/SPECS/PGDG/README new file mode 100644 index 0000000..53ab303 --- /dev/null +++ b/SPECS/PGDG/README @@ -0,0 +1,9 @@ +The SPEC file found here is intended to be +used with PGDG PostgreSQL packages. To build a +toastinfo package, you have to specify the target +PostgreSQL PGDG release and the installation directory, +where the packages can be found. + +Example: + +rpmbuild -D"pgdgversion 10" -D "pginstdir /usr/pgsql-10/" -ba toastinfo.spec diff --git a/SPECS/PGDG/toastinfo.spec b/SPECS/PGDG/toastinfo.spec new file mode 100644 index 0000000..75f8838 --- /dev/null +++ b/SPECS/PGDG/toastinfo.spec @@ -0,0 +1,42 @@ +Name: toastinfo +Version: 1.0 +Release: 1%{?dist} +Summary: A PostgreSQL extension module to view toast value information. + +Group: database +License: BSD +URL: https://github.com/credativ/toastinfo +Source0: https://github.com/credativ/toastinfo/archive/v%{version}.tar.gz + +BuildRequires: postgresql%{pgdgversion}-devel +Requires: postgresql%{pgdgversion} + +%description +This PostgreSQL extension exposes the internal storage structure of variable-length datatypes, called varlena. + +%prep +%setup -q + + +%build +PG_CONFIG=%{pginstdir}/bin/pg_config USE_PGXS=1 make %{?_smp_mflags} + +%install +rm -rf $RPM_BUILD_ROOT +PG_CONFIG=%{pginstdir}/bin/pg_config USE_PGXS=1 make install DESTDIR=$RPM_BUILD_ROOT + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root,-) +%{pginstdir}/lib/toastinfo.so +%{pginstdir}/share/extension/toastinfo--1.sql +%{pginstdir}/share/extension/toastinfo.control + + +%changelog +* Tue Apr 03 2018 - Bernd Helmle 1.0-1 +- Upstream release 1.0