-
Notifications
You must be signed in to change notification settings - Fork 0
/
php-pecl-LuaSandbox.spec
71 lines (56 loc) · 1.85 KB
/
php-pecl-LuaSandbox.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
%global pecl_name LuaSandbox
%global basepkg %{getenv:PHP}
Summary: LuaSandbox is an extension to allow safely running untrusted Lua 5.1 code from within PHP
Name: %{basepkg}-pecl-%{pecl_name}
Version: %{getenv:VER}
Release: 1%{dist}
License: MIT
Group: Development/Languages
URL: https://www.mediawiki.org/wiki/LuaSandbox
# You can download this from gerrit or github
# github allows linking to tags, though.
Source0: https://github.com/wikimedia/mediawiki-php-luasandbox/archive/%{version}/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: %{basepkg}-devel
BuildRequires: lua-devel
BuildRequires: automake
BuildRequires: gcc
Requires: php(zend-abi) = %{php_zend_api}
Requires: php(api) = %{php_core_api}
Provides: php-pecl(hexmode/%{pecl_name}) = %{version}
Provides: php-pecl(hexmode/%{pecl_name})%{?_isa} = %{version}
%description
LuaSandbox is an extension for PHP to allow safely running untrusted
Lua 5.1 code from within PHP, which will generally be faster than
shelling out to a Lua binary and using inter-process communication.
%prep
%setup -n mediawiki-php-luasandbox-%{version}
phpize
./configure
%build
make test NO_INTERACTION=1
%install
rm -rf $RPM_BUILD_ROOT
make install INSTALL_ROOT=$RPM_BUILD_ROOT
# Drop in the bit of configuration
%{__mkdir_p} %{buildroot}%{php_inidir}
%{__cat} > %{buildroot}%{php_inidir}/luasandbox.ini << 'EOF'
; Enable luasandbox extension module
extension = luasandbox.so
EOF
%clean
rm -rf $RPM_BUILD_ROOT
%post
%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
%postun
if [ $1 -eq 0 ] ; then
%{pecl_uninstall} %{pecl_name} >/dev/null || :
fi
%files
%defattr(-,root,root,-)
%doc
/usr/lib64/php/modules/luasandbox.so
%config /etc/php.d/luasandbox.ini
%changelog
* Thu Nov 1 2018 Mark A. Hershberger <[email protected]> - php-pecl-LuaSandbox
- Initial build.