Skip to content

Commit

Permalink
add md5hash
Browse files Browse the repository at this point in the history
  • Loading branch information
Vonng committed May 5, 2024
1 parent 3e9b729 commit 59ff5f7
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
Binary file added SOURCES/md5hash-1.0.1.tar.gz
Binary file not shown.
82 changes: 82 additions & 0 deletions SPECS/md5hash.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
%global pname md5hash
%global sname md5hash
%global pginstdir /usr/pgsql-%{pgmajorversion}

%ifarch ppc64 ppc64le s390 s390x armv7hl
%if 0%{?rhel} && 0%{?rhel} == 7
%{!?llvm:%global llvm 0}
%else
%{!?llvm:%global llvm 1}
%endif
%else
%{!?llvm:%global llvm 1}
%endif

Name: %{sname}_%{pgmajorversion}
Version: 1.0.1
Release: 1PIGSTY%{?dist}
Summary: A custom data type for storing MD5 hashes (instead of the native TEXT varlena type).
License: BSD 2-Claus
URL: https://github.com/tvondra/%{sname}
Source0: https://github.com/dftvondra/%{sname}/nosuchdownload/md5hash-1.0.1.tar.gz

BuildRequires: postgresql%{pgmajorversion}-devel pgdg-srpm-macros >= 1.0.27
Requires: postgresql%{pgmajorversion}-server

%description
This extension provides a simple data type storing 128-bit values (e.g. MD5 hashes) in a bit more efficient way - in a fixed-length columns and inline.

The extension defines the 'md5hash' type itself, casts, operators and an operator class for btree indexes. It's fairly straightforward and simple to add more operators or classes.

%if %llvm
%package llvmjit
Summary: Just-in-time compilation support for %{sname}
Requires: %{name}%{?_isa} = %{version}-%{release}
%if 0%{?rhel} && 0%{?rhel} == 7
%ifarch aarch64
Requires: llvm-toolset-7.0-llvm >= 7.0.1
%else
Requires: llvm5.0 >= 5.0
%endif
%endif
%if 0%{?suse_version} >= 1315 && 0%{?suse_version} <= 1499
BuildRequires: llvm6-devel clang6-devel
Requires: llvm6
%endif
%if 0%{?suse_version} >= 1500
BuildRequires: llvm15-devel clang15-devel
Requires: llvm15
%endif
%if 0%{?fedora} || 0%{?rhel} >= 8
Requires: llvm => 13.0
%endif

%description llvmjit
This packages provides JIT support for %{sname}
%endif


%prep
%setup -q -n %{sname}-%{version}

%build
PATH=%{pginstdir}/bin:$PATH %{__make} %{?_smp_mflags}

%install
%{__rm} -rf %{buildroot}
PATH=%{pginstdir}/bin:$PATH %{__make} %{?_smp_mflags} install DESTDIR=%{buildroot}

%files
%doc README.md
%{pginstdir}/lib/%{pname}.so
%{pginstdir}/share/extension/%{pname}.control
%{pginstdir}/share/extension/%{pname}*sql
%if %llvm
%files llvmjit
%{pginstdir}/lib/bitcode/*
%endif
%exclude /usr/lib/.build-id/*

%changelog
* Sun May 5 2024 Vonng <rh@vonng.com> - 1.0.1
- Initial RPM release, used by Pigsty <https://pigsty.io>

0 comments on commit 59ff5f7

Please sign in to comment.