-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathspec.j2
133 lines (103 loc) · 3.09 KB
/
spec.j2
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
%{!?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 {{ luapkgname }}
%global gittag {{ spec_tag }}
%global gittag_nov {{ spec_tag_no_prefix }}
Name: lua-%{luapkgname}
Version: {{ version }}
Release: 4%{?dist}
Summary: {{ summary }}
Group: Development/Libraries
License: BSD
URL: https://github.com/{{ repo }}
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
{% if requires is defined and requires is iterable %}
{% for r in requires -%}
Requires: {{ r }}
{% endfor -%}
{%- endif -%}
{% if lib_requires is defined and lib_requires is iterable %}
{% for r in lib_requires -%}
Requires: lua-{{ r }}
{% endfor -%}
{%- endif -%}
{% if obsoletes is defined and obsoletes is iterable %}
{% for o in obsoletes -%}
Obsoletes: {{ o }}
{% endfor -%}
{%- endif -%}
{% if provides is defined and provides is iterable %}
{% for p in provides -%}
Provides: {{ p }}
{% endfor -%}
{%- endif -%}
BuildArch: noarch
%description
%{summary}.
%if 0%{?fedora} || 0%{?rhel} > 7
%package -n lua%{luacompatver}-%{luapkgname}
Summary: {{ summary }} for Lua %{luacompatver}
{% if requires is defined and requires is iterable %}
{% for r in requires -%}
Requires: {{ r }}
{% endfor -%}
{%- endif -%}
{% if lib_requires is defined and lib_requires is iterable -%}
{% for r in lib_requires -%}
Requires: lua%{luacompatver}-{{ r }}
{% endfor -%}
{%- endif -%}
%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}/*
{%- if license is defined and license.path|default(False) %}
# Virtually add license macro for EL6:
%{!?_licensedir:%global license %%doc}
%license {{ license.path }}
{%- endif -%}
{%- if readme and readme.path|default(False) %}
%doc {{ readme.path }}
{%- endif %}
%if 0%{?fedora} || 0%{?rhel} > 7
%files -n lua%{luacompatver}-%{luapkgname}
%{luacompatpkgdir}/*
{%- if license is defined and license.path|default(False) %}
# Virtually add license macro for EL6:
%{!?_licensedir:%global license %%doc}
%license {{ license.path }}
{%- endif -%}
{%- if readme and readme.path|default(False) %}
%doc {{ readme.path }}
{%- endif %}
%endif
%changelog
# not maintained