Skip to content

Commit bc0cff0

Browse files
committed
Create spec file
1 parent 0bb8d37 commit bc0cff0

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

pg_crash.spec

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
%global sname pg_crash
2+
3+
%{!?llvm:%global llvm 1}
4+
5+
Summary: Periodically crash your PostgreSQL database
6+
Name: %{sname}_%{pgmajorversion}
7+
Version: 0.2
8+
Release: 1PGDG%{?dist}
9+
License: PostgreSQL
10+
Source0: https://github.com/cybertec-postgresql/%{sname}/archive/refs/tags/v%{version}.tar.gz
11+
URL: https://github.com/cybertec-postgresql/%{sname}
12+
BuildRequires: postgresql%{pgmajorversion}-devel
13+
Requires: postgresql%{pgmajorversion}-server
14+
15+
%description
16+
If your database is too reliable - pg_crash can kill it for you. pg_crash is
17+
an extension to PostgreSQL that periodically crashes your database
18+
infrastructure by sending kill (or other) signals to your DB processes and
19+
make them fail. It is ideal for HA and failover testing.
20+
21+
%if %llvm
22+
%package llvmjit
23+
Summary: Just-in-time compilation support for pg_crash
24+
Requires: %{name}%{?_isa} = %{version}-%{release}
25+
%if 0%{?suse_version} >= 1500
26+
BuildRequires: llvm17-devel clang17-devel
27+
Requires: llvm17
28+
%endif
29+
%if 0%{?fedora} || 0%{?rhel} >= 8
30+
BuildRequires: llvm-devel >= 17.0 clang-devel >= 17.0
31+
Requires: llvm => 17.0
32+
%endif
33+
34+
%description llvmjit
35+
This package provides JIT support for pg_crash
36+
%endif
37+
38+
%prep
39+
%setup -q -n %{sname}-%{version}
40+
41+
%build
42+
USE_PGXS=1 PATH=%{pginstdir}/bin/:$PATH %{__make} %{?_smp_mflags}
43+
44+
%install
45+
%{__rm} -rf %{buildroot}
46+
USE_PGXS=1 PATH=%{pginstdir}/bin/:$PATH %{__make} %{?_smp_mflags} install DESTDIR=%{buildroot}
47+
%{__mkdir} -p %{buildroot}%{pginstdir}/doc/extension/
48+
%{__cp} README.md %{buildroot}%{pginstdir}/doc/extension/README-%{sname}.md
49+
50+
%files
51+
%license LICENSE
52+
%doc %{pginstdir}/doc/extension/README-%{sname}.md
53+
%defattr(644,root,root,755)
54+
%{pginstdir}/lib/%{sname}.so
55+
56+
57+
%if %llvm
58+
%files llvmjit
59+
%{pginstdir}/lib/bitcode/%{sname}*.bc
60+
%{pginstdir}/lib/bitcode/%{sname}/*.bc
61+
%endif
62+
63+
%changelog
64+
* Fri Jun 13 2025 Christoph Berg <myon@debian.org> - 0.2-1PGDG
65+
- Initial RPM packaging

0 commit comments

Comments
 (0)