summaryrefslogtreecommitdiffstats
path: root/php-d11wtq-boris.spec
blob: 65892fd5443d44490fa05995166cbaf74e5f0889 (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
# remirepo spec file for php-d11wtq-boris, from Fedora:
#
# RPM spec file for php-d11wtq-boris
#
# Copyright (c) 2015 Shawn Iwinski <shawn.iwinski@gmail.com>
#
# License: MIT
# http://opensource.org/licenses/MIT
#
# Please preserve changelog entries
#

%global github_owner     borisrepl
%global github_name      boris
%global github_version   1.0.10
%global github_commit    31055b15e2d3fe47f31f6aa8e277f8f3fc7eb483

%global composer_vendor  d11wtq
%global composer_project boris

# "php": ">=5.3.0"
%global php_min_ver 5.3.0

%{!?phpdir:  %global phpdir  %{_datadir}/php}

Name:          php-%{composer_vendor}-%{composer_project}
Version:       %{github_version}
Release:       2%{?dist}
Summary:       A tiny, but robust REPL (Read-Evaluate-Print-Loop) for PHP

Group:         Development/Libraries
License:       MIT
URL:           https://github.com/%{github_owner}/%{github_name}
Source0:       %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz

BuildArch:     noarch
BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root
# Autoload generation
BuildRequires: %{_bindir}/phpab

# composer.json
Requires:      php-cli >= %{php_min_ver}
Requires:      php-pcntl
Requires:      php-posix
Requires:      php-readline
# phpcompatinfo (computed from version 1.0.10)
Requires:      php-pcre
Requires:      php-spl

# Composer
Provides:      php-composer(%{composer_vendor}/%{composer_project}) = %{version}

%description
Python has one. Ruby has one. Clojure has one. Now PHP has one, too. Boris is
PHP's missing REPL (read-eval-print loop), allowing developers to experiment
with PHP code in the terminal in an interactive manner. If you make a mistake,
it doesn't matter, Boris will report the error and stand to attention for
further input.

Everything you enter into Boris is evaluated and the result inspected so you
can understand what is happening. State is maintained between inputs, allowing
you to gradually build up a solution to a problem.


%prep
%setup -qn %{github_name}-%{github_commit}

: Fix \\Boris\\Boris::VERSION
: See https://github.com/borisrepl/boris/pull/106
sed 's#1.0.8#%{version}#' -i lib/Boris/Boris.php

: Modify bin autoload require
sed "s#.*autoload.php.*#require_once '%{phpdir}/Boris/autoload.php';#" \
    -i bin/boris

: Remove provided autoloader
rm -f lib/autoload.php


%build
: Generate autoloader
%{_bindir}/phpab --nolower --output lib/Boris/autoload.php lib/Boris


%install
rm -rf %{buildroot}

: Lib
mkdir -p %{buildroot}%{phpdir}
cp -pr lib/* %{buildroot}%{phpdir}/

: Bin
mkdir -p %{buildroot}%{_bindir}
install -pm 0755 bin/boris %{buildroot}%{_bindir}/


%check
: No upstream tests


%clean
rm -rf %{buildroot}


%files
%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md
%doc composer.json
%{_bindir}/boris
%{phpdir}/Boris


%changelog
* Sun May 31 2015 Remi Collet <remi@remirepo.net> - 1.0.10-2
- backport in remi repository

* Sat May 30 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.0.10-2
- php(language) => php-cli dependency change

* Fri May 22 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.0.10-1
- Initial package