OSDN Git Service

Change target version to PG11 and fix the SPEC file REL11_1_3_2
authorKyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Tue, 13 Nov 2018 01:29:17 +0000 (10:29 +0900)
committerKyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Tue, 13 Nov 2018 07:01:35 +0000 (16:01 +0900)
Change targetr version to PG11. SPEC file was changed so that genearte
a subpackage llvmjit, which installs a bitcode file needed for JIT
compilation.

Makefile
SPECS/pg_hint_plan11.spec [moved from SPECS/pg_hint_plan10.spec with 71% similarity]

index 7102e94..1fa305a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -22,8 +22,8 @@ PG_CONFIG = pg_config
 PGXS := $(shell $(PG_CONFIG) --pgxs)
 include $(PGXS)
 
-STARBALL10 = pg_hint_plan10-$(HINTPLANVER).tar.gz
-STARBALLS = $(STARBALL10)
+STARBALL11 = pg_hint_plan11-$(HINTPLANVER).tar.gz
+STARBALLS = $(STARBALL11)
 
 TARSOURCES = Makefile *.c  *.h COPYRIGHT* \
        pg_hint_plan--*.sql \
@@ -35,7 +35,7 @@ LDFLAGS+=-Wl,--build-id
 
 installcheck: $(REGRESSION_EXPECTED)
 
-rpms: rpm10
+rpms: rpm11
 
 # pg_hint_plan.c includes core.c and make_join_rel.c
 pg_hint_plan.o: core.c make_join_rel.c # pg_stat_statements.c
@@ -50,7 +50,7 @@ $(STARBALLS): $(TARSOURCES)
        tar -chzf $@ $(addprefix $(subst .tar.gz,,$@)/, $^)
        rm $(subst .tar.gz,,$@)
 
-rpm10: $(STARBALL10)
-       MAKE_ROOT=`pwd` rpmbuild -bb SPECS/pg_hint_plan10.spec
+rpm11: $(STARBALL11)
+       MAKE_ROOT=`pwd` rpmbuild -bb SPECS/pg_hint_plan11.spec
 
 
similarity index 71%
rename from SPECS/pg_hint_plan10.spec
rename to SPECS/pg_hint_plan11.spec
index 5f7aac6..8fd9d1d 100644 (file)
@@ -1,10 +1,11 @@
 # SPEC file for pg_store_plans
 # Copyright(C) 2018 NIPPON TELEGRAPH AND TELEPHONE CORPORATION
 
-%define _pgdir   /usr/pgsql-10
+%define _pgdir   /usr/pgsql-11
 %define _bindir  %{_pgdir}/bin
 %define _libdir  %{_pgdir}/lib
 %define _datadir %{_pgdir}/share
+%define _bcdir %{_libdir}/bitcode/pg_hint_plan
 
 %if "%(echo ${MAKE_ROOT})" != ""
   %define _rpmdir %(echo ${MAKE_ROOT})/RPMS
@@ -12,8 +13,8 @@
 %endif
 
 ## Set general information for pg_store_plans.
-Summary:    Optimizer hint on PostgreSQL 10
-Name:       pg_hint_plan10
+Summary:    Optimizer hint on PostgreSQL 11
+Name:       pg_hint_plan11
 Version:    1.3.2
 Release:    1%{?dist}
 License:    BSD
@@ -24,8 +25,8 @@ BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
 Vendor:     NIPPON TELEGRAPH AND TELEPHONE CORPORATION
 
 ## We use postgresql-devel package
-BuildRequires:  postgresql10-devel
-Requires:  postgresql10-libs
+BuildRequires:  postgresql11-devel
+Requires:  postgresql11-server
 
 ## Description for "pg_hint_plan"
 %description
@@ -33,11 +34,19 @@ Requires:  postgresql10-libs
 pg_hint_plan provides capability to tweak execution plans to be
 executed on PostgreSQL.
 
-Note that this package is available for only PostgreSQL 10.
+Note that this package is available for only PostgreSQL 11.
+
+%package llvmjit
+Requires: postgresql11-server, postgresql11-llvmjit
+Requires: pg_hint_plan11 = 1.3.1
+Summary:  Just-in-time compilation support for pg_hint_plan11
+
+%description llvmjit
+Just-in-time compilation support for pg_hint_plan11
 
 ## pre work for build pg_hint_plan
 %prep
-PATH=/usr/pgsql-10/bin:$PATH
+PATH=/usr/pgsql-11/bin:$PATH
 if [ "${MAKE_ROOT}" != "" ]; then
   pushd ${MAKE_ROOT}
   make clean %{name}-%{version}.tar.gz
@@ -48,7 +57,7 @@ if [ ! -d %{_rpmdir} ]; then mkdir -p %{_rpmdir}; fi
 
 ## Set variables for build environment
 %build
-PATH=/usr/pgsql-10/bin:$PATH
+PATH=/usr/pgsql-11/bin:$PATH
 make USE_PGXS=1 %{?_smp_mflags}
 
 ## Set variables for install
@@ -59,6 +68,8 @@ install pg_hint_plan.so %{buildroot}%{_libdir}/pg_hint_plan.so
 install -d %{buildroot}%{_datadir}/extension
 install -m 644 pg_hint_plan--1.3.2.sql %{buildroot}%{_datadir}/extension/pg_hint_plan--1.3.2.sql
 install -m 644 pg_hint_plan.control %{buildroot}%{_datadir}/extension/pg_hint_plan.control
+install -d %{buildroot}%{_bcdir}
+install -m 644 pg_hint_plan.bc %{buildroot}%{_bcdir}/pg_hint_plan.bc
 
 %clean
 rm -rf %{buildroot}
@@ -70,10 +81,16 @@ rm -rf %{buildroot}
 %{_datadir}/extension/pg_hint_plan--1.3.2.sql
 %{_datadir}/extension/pg_hint_plan.control
 
+%files llvmjit
+%defattr(0755,root,root)
+%{_bcdir}
+%defattr(0644,root,root)
+%{_bcdir}/pg_hint_plan.bc
+
 # History of pg_hint_plan.
 %changelog
 * Tue Nov 13 2018 Kyotaro Horiguchi
-- Support PostgreSQL 11. Version 1.3.1.
+- Support PostgreSQL 11. Version 1.3.2.
 * Tue Jun 08 2018 Kyotaro Horiguchi
 - Fixed a crash bug. Version 1.3.1.
 * Tue Oct 10 2017 Kyotaro Horiguchi