-
Notifications
You must be signed in to change notification settings - Fork 1
/
lua-resty-nettle.spec
89 lines (65 loc) · 2.06 KB
/
lua-resty-nettle.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
%{!?luaver: %global luaver %(lua -e "print(string.sub(_VERSION, 5))" || echo 0)}
%global luapkgdir %{_datadir}/lua/%{luaver}
%global lualibdir %{_libdir}/lua/%{luaver}
# OpenResty is compatible with 5.1 only! We must build 5.1 version always, even on <= EL8
%global luacompatver 5.1
%global luacompatpkgdir %{_datadir}/lua/%{luacompatver}
%global luacompatlibdir %{_datadir}/lua/%{luacompatver}
%global luapkgname resty-nettle
%global gittag v%{version}
%global gittag_nov %{version}
Name: lua-%{luapkgname}
Version: 2.1
Release: 4%{?dist}
Summary: LuaJIT FFI bindings for Nettle (a low-level cryptographic library)
Group: Development/Libraries
License: BSD
URL: https://github.com/bungle/lua-resty-nettle
Source0: %{url}/archive/%{gittag}/%{name}-%{gittag}.tar.gz
%if 0%{?fedora} || 0%{?rhel} >= 7
Requires: lua(abi) = %{luaver}
%else
Requires: lua >= %{luaver}
%endif
%if 0%{?fedora} || 0%{?rhel} > 7
BuildRequires: compat-lua >= %{luacompatver}, compat-lua-devel >= %{luacompatver}
Requires: lua(abi) = %{luacompatver}
%endif
BuildArch: noarch
%description
%{summary}.
%if 0%{?fedora} || 0%{?rhel} > 7
%package -n lua%{luacompatver}-%{luapkgname}
Summary: LuaJIT FFI bindings for Nettle (a low-level cryptographic library) for Lua %{luacompatver}
%description -n lua%{luacompatver}-%{luapkgname}
%{summary}.
%endif
%prep
%autosetup -n %{name}-%{gittag_nov}
%build
# nothing to do
%install
mkdir -p $RPM_BUILD_ROOT%{luapkgdir}
cp -pr lib/* $RPM_BUILD_ROOT%{luapkgdir}
%if 0%{?fedora} || 0%{?rhel} > 7
mkdir -p $RPM_BUILD_ROOT%{luacompatpkgdir}
cp -pr lib/* $RPM_BUILD_ROOT%{luacompatpkgdir}
%endif
%check
# nothing to do
%files
%{luapkgdir}/*
# Virtually add license macro for EL6:
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README.md
%if 0%{?fedora} || 0%{?rhel} > 7
%files -n lua%{luacompatver}-%{luapkgname}
%{luacompatpkgdir}/*
# Virtually add license macro for EL6:
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README.md
%endif
%changelog
# not maintained