]>
Commit | Line | Data |
---|---|---|
28af8c20 | 1 | |
52d35d85 | 2 | %define rel 1 |
c5450196 | 3 | %define githash 6a8e47e |
28af8c20 | 4 | # $ git rev-list 1.0.0-alpha1..%{githash} --count |
c5450196 | 5 | %define commits 193 |
226b7f8d | 6 | %define subver alpha1 |
397b7f50 ER |
7 | %define php_min_version 5.3.4 |
8 | %include /usr/lib/rpm/macros.php | |
9 | Summary: Package Repository Generator | |
10 | Name: satis | |
13bf50ad | 11 | Version: 1.0.0 |
28af8c20 | 12 | Release: 1.%{subver}%{?commits:.%{commits}}%{?githash:.g%{githash}}.%{rel} |
397b7f50 ER |
13 | License: MIT |
14 | Group: Development/Languages/PHP | |
28af8c20 ER |
15 | #Source0: https://github.com/composer/satis/archive/%{version}-%{subver}/%{name}-%{version}%{subver}.tar.gz |
16 | Source0: https://github.com/composer/satis/archive/%{githash}/%{name}-%{version}-%{subver}-%{commits}-g%{githash}.tar.gz | |
7010c7cc | 17 | # Source0-md5: 6983a32de40172f5a1b9332c00817d68 |
ba72ef5a | 18 | Source1: autoload.php |
3988f087 | 19 | Patch0: autoload.patch |
397b7f50 | 20 | URL: https://github.com/composer/satis |
397b7f50 | 21 | BuildRequires: rpm-php-pearprov >= 4.4.2-11 |
7a5ee252 ER |
22 | BuildRequires: rpmbuild(macros) >= 1.461 |
23 | BuildRequires: sed >= 4.0 | |
c5450196 | 24 | Requires: composer >= 1.0.0-18 |
397b7f50 | 25 | Requires: php(core) >= %{php_min_version} |
a7990567 | 26 | Requires: php(hash) |
64e85856 | 27 | Requires: php(json) |
3988f087 | 28 | Requires: php(pcre) |
8a29fde4 | 29 | Requires: php-composer-semver >= 1.2.0-2 |
ba72ef5a | 30 | Requires: php-twig-Twig >= 1.7 |
397b7f50 ER |
31 | BuildArch: noarch |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
33 | ||
7a5ee252 ER |
34 | %define _appdir %{_datadir}/%{name} |
35 | ||
397b7f50 ER |
36 | %description |
37 | Simple static Composer repository generator. | |
38 | ||
39 | It uses any composer.json file as input and dumps all the required | |
40 | (according to their version constraints) packages to a Composer | |
41 | Repository file. | |
42 | ||
43 | %prep | |
28af8c20 | 44 | %setup -qc -n %{name}-%{version}-%{release} |
397b7f50 | 45 | mv %{name}-*/* . |
3988f087 | 46 | %patch0 -p1 |
7a5ee252 | 47 | |
2e947a8e | 48 | %{__sed} -i -e '1s,^#!.*env php,#!/usr/bin/php,' bin/* |
397b7f50 | 49 | |
ba72ef5a ER |
50 | cp -p %{SOURCE1} src/Composer/Satis/autoload.php |
51 | ||
3988f087 ER |
52 | # move to Source dir, eases packaging |
53 | mv res views src/Composer/Satis | |
54 | ||
2e947a8e ER |
55 | # not needed runtime |
56 | mv bin/compile . | |
57 | mv src/Composer/Satis/Compiler.php . | |
a923f529 | 58 | |
397b7f50 ER |
59 | %install |
60 | rm -rf $RPM_BUILD_ROOT | |
3988f087 | 61 | install -d $RPM_BUILD_ROOT{%{_bindir},%{php_data_dir}/Composer} |
2e947a8e | 62 | cp -a src/Composer $RPM_BUILD_ROOT%{php_data_dir} |
3988f087 | 63 | install -p bin/%{name} $RPM_BUILD_ROOT%{_bindir}/%{name} |
397b7f50 ER |
64 | |
65 | %clean | |
66 | rm -rf $RPM_BUILD_ROOT | |
67 | ||
68 | %files | |
69 | %defattr(644,root,root,755) | |
70 | %doc README.md LICENSE | |
71 | %attr(755,root,root) %{_bindir}/satis | |
2e947a8e | 72 | %{php_data_dir}/Composer/Satis |