summaryrefslogtreecommitdiffstats
path: root/php-bolt.spec
blob: 7f158cf22e67e5b0f0c2350e6b04fcec2273658a (plain)
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
# remirepo spec file for php-bolt
#
# Copyright (c) 2024 Remi Collet
# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
%{?scl:%scl_package   php-bolt}

%global extname       bolt
%global debug_package %{nil}
%global __debug_install_post /bin/true
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
%global _build_id_links none
%endif
%global with_zts      0
%global ininame       40-%{extname}.ini

Name:          %{?scl_prefix}php-bolt
Summary:       Protect PHP Source Code
Version:       1.0.5
Release:       1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License:       Distribuable

URL:           https://phpbolt.com/
# see https://phpbolt.com/download-phpbolt/
Source0:       https://phpbolt.com/wp-content/uploads/2024/03/phpBolt-extension-%{version}.zip
Source1:       https://raw.githubusercontent.com/arshidkv12/phpBolt/master/encryption.php
# Message from upstream: "You can redistribute"
Source2:       message.eml

ExclusiveArch: x86_64
BuildRequires: %{?scl_prefix}php-devel >= 7.0
BuildRequires: %{?scl_prefix}php-devel <  8.4

# ABI check
Requires:      %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires:      %{?scl_prefix}php(api) = %{php_core_api}



%description
Protect PHP Source Code

* Encrypt and decrypt php source code.
* Ensure only licensed people are using.
* Free for small and medium companies.
* Encode and run PHP files.
* Ioncube alternative (free)

Encode php source code from your php server. No need any additianal installation.

Package built for PHP %(%{__php} -n -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}.


%prep
%setup -q -c

cp %{SOURCE1} .
cp %{SOURCE2} .

cat << 'EOF' | tee %{ininame}
; Enable "%{SUMMARY}" extension module
extension = %{extname}.so
EOF


%build
: Nothing to build as tarball provides binaries


%install
: configuration file
install -D -m 644 %{ininame} %{buildroot}%{php_inidir}/%{ininame}

: PHP extension
ver=$(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')
cd phpBolt-extension-%{version}/linux*64/*$ver

if [ -f %{extname}.so ]; then

  install -D -pm 755 %{extname}.so    %{buildroot}%{php_extdir}/%{extname}.so

else
  : Module for PHP $ver not provided
  exit 1
fi


%check
: simple NTS module load test
%{__php} --no-php-ini \
    --define extension=%{buildroot}%{php_extdir}/%{extname}.so \
    --ri %{extname}

%{__php} --no-php-ini \
    --define extension=%{buildroot}%{php_extdir}/%{extname}.so \
    --modules | grep -E '^[Bb]olt$'

%if %{with_zts}
: simple ZTS module load test
%{__ztsphp} --no-php-ini \
    --define extension=%{buildroot}%{php_ztsextdir}/%{extname}.so \
    --modules | grep -E '^[Bb]olt$'
%endif


%files
%{!?_licensedir:%global license %%doc}
%license message.eml
%doc encryption.php

%config(noreplace) %{php_inidir}/%{ininame}
%{php_extdir}/%{extname}.so

%if %{with_zts}
%config(noreplace) %{php_ztsinidir}/%{ininame}
%{php_ztsextdir}/%{extname}.so
%endif


%changelog
* Fri Mar 22 2024 Remi Collet <remi@remirepo.net> - 1.0.5-1
- update to 1.0.5

* Fri Mar 15 2024 Remi Collet <remi@remirepo.net> - 1.0.4-1
- initial package