File epgsql.spec of Package epgsql
%def_enable check
%define bname epgsql
Name: %bname
Version: 4.7.1
Release: 7
Summary: Erlang PostgreSQL database client
License: BSD-3-Clause
Group: Development/Tools/Other
URL: https://github.com/%bname/%bname
Source: %bname-%version.tar.xz
#Patch0: %bname-%version-git.patch
Patch12: 0012-epgsql_codec_boolean-improve-encode-2-for-support-in.patch
Patch15: %bname-4.6.1-stacktrace.patch
Patch16: %bname-scram-crypto.patch
BuildArch: noarch
Provides: erlang-%bname = %version-%release
BuildRequires: rpm-macros-erlang rpm-build-erlang
BuildRequires: rebar >= 2.6.1-7
%if_enabled check
BuildRequires: epmd
BuildRequires: erlang-public_key erlang-public_key-devel
BuildRequires: erlang-common_test erlang-common_test-devel erlang-eunit ct_run
BuildRequires: erlexec >= 1.1
BuildRequires: cth_readable >= 1.4.0
BuildRequires: hostname
BuildRequires: postgresql-server-implementation >= 13
BuildConflicts: postgresql-server-implementation >= 14
%endif
%description
%summary.
%package devel
Summary: Headers of %bname
Group: Development/Tools/Other
Provides: erlang-%bname-devel = %version-%release
Conflicts: %name < 3.3.0-6
%description devel
Headers of %bname.
%package doc
Summary: Documentation of %bname
Group: Documentation/HTML
Provides: erlang-%bname-doc = %version-%release
Conflicts: %name < 3.3.0-6
%description doc
Documentation of %bname.
%prep
%setup -q -n %bname-%version
#patch0 -p1
%patch12 -p1
%patch15 -p1
%patch16 -p1
# disbale hstore
sed -i '/^CREATE EXTENSION hstore;/s/^/-- /;/^CREATE TABLE/,/;/s/c_hstore/-- &/' test/data/test_schema.sql
sed -i '/^groups()/,/\./s/\hstore_type/%% &/;s/Select(hstore,/%% &/' test/epgsql_SUITE.erl
# disable postgis
sed -i -r '/^CREATE EXTENSION postgis;/s/^/-- /;/^CREATE TABLE/,/;/s/c_(point|geometry)/-- &/' test/data/test_schema.sql
sed -i -r '/^groups()/,/\./s/(point|geometry)_type/%% &/' test/epgsql_SUITE.erl
# disable sslinfo
sed -i '/^CREATE EXTENSION sslinfo;/s/^/-- /' test/data/test_schema.sql
sed -i -r '/^groups()/,/\./s/ c.*_(ssl|client_cert)/ %%&/' test/epgsql_SUITE.erl
sed -i -r '/^groups()/,/\./s/( incremental_sock_active_n),$/\1/' test/epgsql_SUITE.erl
sed -i -r '/^groups()/,/\./s/ incremental_sock_active_n_ssl/ %%&/' test/epgsql_SUITE.erl
# relax lc_message
sed -i '/^-define(TIMEOUT_ERROR,/,/\./s|\(message = <<\).*>>|\1_/binary>>|' test/epgsql_SUITE.erl
# disable replication
rm -f test/epgsql_replication_SUITE.erl
%build
erl -noshell -eval '
{ok, L} = file:consult("rebar.config"),
file:write_file("%bname.rebar.config",
lists:map(fun(E) -> [io_lib:print(E), ".\n"] end,
lists:keystore(edoc_opts, 1, lists:keydelete(deps, 1, L),
{edoc_opts, [{preprocess, true}]})),
[raw]),
init:stop().'
ERL_COMPILER_OPTIONS="[inline,verbose]" rebar %{?_smp_mflags} -C %bname.rebar.config compile -v
rebar %{?_smp_mflags} -C %bname.rebar.config doc -v
%install
install -d -m 0755 %buildroot%_otplibdir/%bname-%version/ebin
install -p -m 0644 ebin/* %buildroot%_otplibdir/%bname-%version/ebin/
install -d -m 0755 %buildroot%_otplibdir/%bname-%version/include
install -p -m 0644 include/* %buildroot%_otplibdir/%bname-%version/include/
ln -sf epgsql.hrl %buildroot%_otplibdir/%bname-%version/include/pgsql.hrl
install -d -m 0755 %buildroot%_otplibdir/%bname-%version/doc
install -p -m 0644 doc/*.{css,html,png} %buildroot%_otplibdir/%bname-%version/doc/
install -d -m 0755 %buildroot%_docdir/%name
ln -sf %_otplibdir/%bname-%version/doc %buildroot%_docdir/%name/html
install -p -m 0644 CHANGES LICENSE TODO *.md %buildroot%_docdir/%name/
%if_enabled check
%check
cat > test/epgsql_tests.hrl <<__EOF__
-define(TEST_DATA_DIR, "$PWD/test/data").
__EOF__
ERL_COMPILER_OPTIONS="[inline,verbose]" rebar %{?_smp_mflags} -C %bname.rebar.config eunit -v
install -d -m 0755 ./logs
if postgres --version | cut -d ' ' -f3 | grep -E -q '^(9\.[6-9]|1[[:digit:]])\.'; then
LANG=C \
ct_run -noshell -pa $PWD/.eunit -include $PWD/include \
-name test$(printf %%05d $(od -vAn -N2 -tu2 < /dev/urandom))@$(hostname -f) \
-logdir $PWD/logs -dir test \
-ct_hooks epgsql_cth \
-env TEST_DIR $PWD/test
else
echo "Need PostgreSQL >= 9.6" > logs/test.log
fi
%endif
%files
%defattr(-,root,root)
%_otplibdir/*
%exclude %_otplibdir/%bname-*/include
%exclude %_otplibdir/%bname-*/doc
%files devel
%defattr(-,root,root)
%dir %_otplibdir/%bname-*
%_otplibdir/%bname-*/include
%files doc
%defattr(-,root,root)
%doc %_docdir/%name
%doc %dir %_otplibdir/%bname-*
%doc %_otplibdir/%bname-*/doc
%changelog
* Thu Jun 15 2023 Led <ledest@gmail.com> 4.7.1-7
- enable common test
* Thu Jun 15 2023 Led <ledest@gmail.com> 4.7.1-6
- enable incremental_sock_active_n test
* Thu Jun 15 2023 Led <ledest@gmail.com> 4.7.1-5
- enable common test for Elang/OTP 24
* Sat Jun 03 2023 Led <ledest@gmail.com> 4.7.1-4
- fix disabling common test for Elang/OTP > 23
* Sat Jun 03 2023 Led <ledest@gmail.com> 4.7.1-3
- disable common test for Elang/OTP > 23
* Sat Jun 03 2023 Led <ledest@gmail.com> 4.7.1-2
- update %%check
* Sat Jun 03 2023 Led <ledest@gmail.com> 4.7.1-1
- 4.7.1
- remove patches:
+ 0001-Fix-issue-with-columns-in-multiple-squery-response.patch
+ 0002-Reset-decoder-in-epgsql_cmd_squery-state.patch
+ epgsql-4.4.0-fix-gitignore.patch
* Sat May 20 2023 Led <ledest@gmail.com> 4.6.1-3
- add patches:
+ 0001-Fix-issue-with-columns-in-multiple-squery-response.patch
+ 0002-Reset-decoder-in-epgsql_cmd_squery-state.patch
* Fri Feb 17 2023 Led <ledest@gmail.com> 4.6.1-2
- update patches:
+ epgsql-4.6.1-stacktrace.patch
* Fri Feb 17 2023 Led <ledest@gmail.com> 4.6.1-1
- 4.6.1
- remove patches:
+ 0001-Fix-Dialyzer-error-with-epgsql-get_parameter-2.patch
+ 0002-Make-dialyzer-warn-about-use-of-unknown-types-fix-so.patch
+ 0003-Fix-if-OTP_RELEASE-was-missing-question-mark.patch
+ 0004-Fix-typos.patch
* Fri Feb 17 2023 Led <ledest@gmail.com> 4.5.0-1
- 4.5.0
- remove patches:
+ 0002-switch-to-crypto-mac-4-since-crypto-hmac-3-is-deprec.patch
- add patchs:
+ 0002-Make-dialyzer-warn-about-use-of-unknown-types-fix-so.patch
- update patches:
+ 0004-Fix-typos.patch
* Fri Feb 17 2023 Led <ledest@gmail.com> 4.4.0-1
- 4.4.0
- remove patches:
+ 0001-Fix-typo.patch
+ 0004-fix-range-codecs.patch
+ 0005-Fix-describe-_-portal-_-add-tests.patch
+ 0006-Document-epgsql-cancel-1-.-Fixes-220.patch
+ 0007-Minor-corrections.patch
+ 0008-Send-Terminate-mesage-when-performing-gracefull-shut.patch
+ 0009-Add-guards-to-not-silently-truncate-integer-when-ove.patch
+ 0011-epgsql_binary-fix-null-undefined-encoding-193.patch
+ epgsql-4.3.0-doc.patch
- update patches:
+ epgsql-4.4.0-fix-gitignore.patch
- add patches:
+ 0004-Fix-typos.patch
* Fri Feb 17 2023 Led <ledest@gmail.com> 4.3.0-1
- 4.3.0
- update patches:
+ epgsql-4.3.0-doc.patch
- add patches:
+ 0004-fix-range-codecs.patch
+ 0005-Fix-describe-_-portal-_-add-tests.patch
+ 0006-Document-epgsql-cancel-1-.-Fixes-220.patch
+ 0007-Minor-corrections.patch
+ 0008-Send-Terminate-mesage-when-performing-gracefull-shut.patch
+ 0009-Add-guards-to-not-silently-truncate-integer-when-ove.patch
+ 0010-Fix-Dialyzer-error-with-epgsql-get_parameter-2.patch
* Sat Feb 04 2023 Led <ledest@gmail.com> 4.2.1-9
- remove fix tests with PostgreSQL >= 14
- test with PostgreSQL 13.x
* Sat Jun 11 2022 Led <ledest@gmail.com> 4.2.1-8
- update BuildRequires
* Sat Jun 11 2022 Led <ledest@gmail.com> 4.2.1-7
- fix tests with PostgreSQL >= 14
* Sat Aug 14 2021 Led <ledest@gmail.com> 4.2.1-6
- add patches:
+ epgsql-scram-crypto.patch
* Sat Aug 14 2021 Led <ledest@gmail.com> 4.2.1-5
- add patches:
+ 0002-switch-to-crypto-mac-4-since-crypto-hmac-3-is-deprec.patch
+ 0003-Fix-if-OTP_RELEASE-was-missing-question-mark.patch
* Fri Dec 27 2019 Led <ledest@gmail.com> 4.2.1-4
- git eb83f84
- update patches:
+ epgsql-4.2.1.1-doc.patch
* Fri Dec 27 2019 Led <ledest@gmail.com> 4.2.1-3
- git d0a6853
* Tue Nov 12 2019 Led <ledest@gmail.com> 4.2.1-2
- add patches:
+ 0001-Fix-typo.patch
* Tue Oct 22 2019 Led <ledest@gmail.com> 4.2.1-1
- 4.2.1
- remove patches:
+ 0001-Bugfix-decoding-of-nested-records-and-arrays.patch
+ 0002-Fix-typo-on-README.patch
- add patches:
+ epgsql-4.2.1-stacktrace.patch
- update patches:
+ epgsql-4.2.1-doc.patch
* Wed Sep 04 2019 Led <ledest@gmail.com> 4.1.0-3
- add patches:
+ 0012-epgsql_codec_boolean-improve-encode-2-for-support-in.patch
* Wed Jul 24 2019 Led <ledest@gmail.com> 4.1.0-2
- add patches:
+ 0011-epgsql_binary-fix-null-undefined-encoding-193.patch
* Wed Jul 24 2019 Led <ledest@gmail.com> 4.1.0-1
- 4.1.0
* Wed Jul 24 2019 Led <ledest@gmail.com> 4.0.1-2
- add patches:
+ 0001-Bugfix-decoding-of-nested-records-and-arrays.patch
+ 0002-Fix-typo-on-README.patch
* Wed Jul 24 2019 Led <ledest@gmail.com> 4.0.1-1
- 4.0.1
- git 245c5fe
- remove patches:
+ 0001-Add-with_transaction-3.-Fixes-135-29-111.patch
+ 0002-Fix-typo-in-typespec-plus-minor-cleanup.patch
+ 0003-Fix-rebar3-edoc-.-Cleanup-and-fix-README.-Fixes-146.patch
- add patches:
+ epgsql-4.0.1-doc.patch
* Mon Jun 10 2019 Led <ledest@gmail.com> 3.4.1-5
- don't test when Postgresql < 9.6
* Sun Jun 09 2019 Led <ledest@gmail.com> 3.4.1-4
- enable %%check
* Sat Jun 08 2019 Led <ledest@gmail.com> 3.4.1-3
- add %%check (disabled)
* Fri Jun 07 2019 Led <ledest@gmail.com> 3.4.1-2
- add patches:
+ 0001-Add-with_transaction-3.-Fixes-135-29-111.patch
+ 0002-Fix-typo-in-typespec-plus-minor-cleanup.patch
* Wed Apr 24 2019 Led <ledest@gmail.com> 3.4.1-1
- 3.4.1
- remove patches:
+ 0001-Fix-for-Erlang-OTP-20.0.patch
+ 0002-Fix-r19-dialyzer-warnings.patch
+ 0003-Fix-broken-Markdown-headings.patch
+ 0004-Fix-undesired-change.patch
+ 0005-Add-link-to-streaming-replication-doc-to-readme.patch
+ gitignore-replace-rebar-to-.rebar.patch
+ epgsql-3.3.0-doc.patch
- add patches:
+ 0001-Fix-rebar3-edoc-.-Cleanup-and-fix-README.-Fixes-146.patch
+ epgsql-3.4.1-fix-gitignore.patch
* Thu Jun 07 2018 Led <ledest@gmail.com> 3.3.0-8
- add patches:
+ 0002-Fix-r19-dialyzer-warnings.patch
+ 0003-Fix-broken-Markdown-headings.patch
+ 0004-Fix-undesired-change.patch
+ 0005-Add-link-to-streaming-replication-doc-to-readme.patch
* Fri Feb 02 2018 Led <ledest@gmail.com> 3.3.0-7
- remove patches:
+ 0002-add-symlink-include-pgsql.hrl-epgsql.hrl.patch
+ 0003-epgsql_binary-add-clause-with-binary-argument-to-enc.patch
+ 0004-epgsql_binary-add-clause-with-list-argument-to-encod.patch
* Wed Nov 15 2017 Led <ledest@gmail.com> 3.3.0-6
- move docs to separate subpackage
- move headers to separate subpackage
* Thu Jun 22 2017 Led <ledest@gmail.com> 3.3.0-5
- add patches:
+ 0001-Fix-for-Erlang-OTP-20.0.patch
* Sun May 21 2017 Led <ledest@gmail.com> 3.3.0-4
- add {preprocess, true} to edoc_opts
* Sun May 21 2017 Led <ledest@gmail.com> 3.3.0-3
- revert BuildRequires
* Sat May 20 2017 Led <ledest@gmail.com> 3.3.0-2
- update BuildRequires
* Sun Jan 22 2017 Led <ledest@gmail.com> 3.3.0-1
- 3.3.0
- update patches:
+ epgsql-3.3.0-doc.patch
* Sat May 14 2016 Led <ledest@gmail.com> 3.2.0-2
- disable debug_info
* Thu May 05 2016 Led <ledest@gmail.com> 3.2.0-1
- 3.2.0
- remove patches:
+ 0001-support-for-postgresql-json-jsonb-type.patch
+ 0002-Fix-jsonb-encode-decode-wire-format.patch
* Fri Apr 29 2016 Led <ledest@gmail.com> 3.1.1-5
- add patches:
+ 0001-.gitignore-replace-rebar-to-.rebar.patch
+ 0002-add-symlink-include-pgsql.hrl-epgsql.hrl.patch
+ 0003-epgsql_binary-add-clause-with-binary-argument-to-enc.patch
+ 0004-epgsql_binary-add-clause-with-list-argument-to-encod.patch
* Thu Apr 28 2016 Led <ledest@gmail.com> 3.1.1-4
- add patches:
+ 0001-support-for-postgresql-json-jsonb-type.patch
+ 0002-Fix-jsonb-encode-decode-wire-format.patch
* Wed Mar 23 2016 Led <ledest@gmail.com> 3.1.1-3
- add headers
* Mon Mar 21 2016 Led <ledest@gmail.com> 3.1.1-2
- clean up BuildRequires
* Mon Nov 30 2015 Led <ledest@gmail.com> 3.1.1-1
- 3.1.1
- remove patches:
+ epgsql-3.1.0-git.patch
* Sat Jun 06 2015 Led <ledest@gmail.com> 3.1.0-5
- add docs
- add patches:
+ epgsql-3.1.0-doc.patch
* Sat Jun 06 2015 Led <ledest@gmail.com> 3.1.0-4
- add patches:
+ epgsql-3.1.0-git.patch
* Sun Apr 12 2015 Led <ledest@gmail.com> 3.1.0-3
- clean ups
* Sun Apr 05 2015 Led <ledest@gmail.com> 3.1.0-2
- cosmetic fixes
* Fri Mar 20 2015 Led <ledest@gmail.com> 3.1.0-1
- initial build