include $(top_srcdir)/contrib/contrib-global.mk
endif
+STARBALL95 = pg_store_plans95-$(STOREPLANSVER).tar.gz
STARBALL94 = pg_store_plans94-$(STOREPLANSVER).tar.gz
-STARBALLS = $(STARBALL94)
+STARBALLS = $(STARBALL94) $(STARBALL95)
TARSOURCES = Makefile *.c *.h \
pg_store_plans--*.sql \
## These entries need running server
DBNAME = postgres
-rpms: rpm94
+rpms: rpm94 rpm95
$(STARBALLS): $(TARSOURCES)
if [ -h $(subst .tar.gz,,$@) ]; then rm $(subst .tar.gz,,$@); fi
rpm94: $(STARBALL94)
MAKE_ROOT=`pwd` rpmbuild -bb SPECS/pg_store_plans94.spec
+rpm95: $(STARBALL95)
+ MAKE_ROOT=`pwd` rpmbuild -bb SPECS/pg_store_plans95.spec
+
testfiles: all.out all.sql
all.out: all.sql
--- /dev/null
+# SPEC file for pg_store_plans
+# Copyright(C) 2016 NIPPON TELEGRAPH AND TELEPHONE CORPORATION
+
+%define _pgdir /usr/pgsql-9.5
+%define _bindir %{_pgdir}/bin
+%define _libdir %{_pgdir}/lib
+%define _datadir %{_pgdir}/share
+%if "%(echo ${MAKE_ROOT})" != ""
+ %define _rpmdir %(echo ${MAKE_ROOT})/RPMS
+ %define _sourcedir %(echo ${MAKE_ROOT})
+%endif
+
+## Set general information for pg_store_plans.
+Summary: Record executed plans on PostgreSQL 9.5
+Name: pg_store_plans95
+Version: 1.0
+Release: 1%{?dist}
+License: BSD
+Group: Applications/Databases
+Source0: %{name}-%{version}.tar.gz
+#URL: http://example.com/pg_store_plans/
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
+Vendor: NIPPON TELEGRAPH AND TELEPHONE CORPORATION
+
+## We use postgresql-devel package
+BuildRequires: postgresql95-devel
+Requires: postgresql95-libs
+
+## Description for "pg_store_plans"
+%description
+
+pg_store_plans provides capability to record statistics for every plan
+executed on PostgreSQL.
+
+Note that this package is available for only PostgreSQL 9.5.
+
+## pre work for build pg_store_plans
+%prep
+PATH=/usr/pgsql-9.5/bin:$PATH
+if [ "${MAKE_ROOT}" != "" ]; then
+ pushd ${MAKE_ROOT}
+ make clean %{name}-%{version}.tar.gz
+ popd
+fi
+if [ ! -d %{_rpmdir} ]; then mkdir -p %{_rpmdir}; fi
+%setup -q
+
+## Set variables for build environment
+%build
+PATH=/usr/pgsql-9.5/bin:$PATH
+make USE_PGXS=1 %{?_smp_mflags}
+
+## Set variables for install
+%install
+rm -rf %{buildroot}
+install -d %{buildroot}%{_libdir}
+install pg_store_plans.so %{buildroot}%{_libdir}/pg_store_plans.so
+install -d %{buildroot}%{_datadir}/extension
+install -m 644 pg_store_plans--1.0.sql %{buildroot}%{_datadir}/extension/pg_store_plans--1.0.sql
+install -m 644 pg_store_plans.control %{buildroot}%{_datadir}/extension/pg_store_plans.control
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(0755,root,root)
+%{_libdir}/pg_store_plans.so
+%defattr(0644,root,root)
+%{_datadir}/extension/pg_store_plans--1.0.sql
+%{_datadir}/extension/pg_store_plans.control
+
+# History of pg_store_plans.
+%changelog
+* Wed Apr 13 2016 Kyotaro Horiguchi
+- Support PostgreSQL 9.5
+* Fri Jun 12 2015 Kyotaro Horiguchi
+- Initial version.
+
+