3 %define githash 48191ff
4 # $ git rev-list 1.0.0-alpha1..%{githash} --count
7 %define php_min_version 5.3.4
8 %include /usr/lib/rpm/macros.php
9 Summary: Package Repository Generator
12 Release: 1.%{subver}%{?commits:.%{commits}}%{?githash:.g%{githash}}.%{rel}
14 Group: Development/Languages/PHP
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
17 # Source0-md5: adee07882bc8c526b6bd3489812bc194
19 Patch0: autoload.patch
20 Patch1: https://github.com/composer/satis/pull/292.patch
21 # Patch1-md5: 28bbf057c6771e7ddda8ce1be14d22e5
22 URL: https://github.com/composer/satis
23 BuildRequires: composer
24 BuildRequires: rpm-php-pearprov >= 4.4.2-11
25 BuildRequires: rpmbuild(macros) >= 1.461
26 BuildRequires: sed >= 4.0
27 Requires: composer >= 1.0.0-16.alpha11
28 Requires: php(core) >= %{php_min_version}
32 Requires: php-composer-semver >= 1.2.0-2
33 Requires: php-twig-Twig >= 1.7
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 %define _appdir %{_datadir}/%{name}
40 Simple static Composer repository generator.
42 It uses any composer.json file as input and dumps all the required
43 (according to their version constraints) packages to a Composer
47 %setup -qc -n %{name}-%{version}-%{release}
52 %{__sed} -i -e '1s,^#!.*env php,#!/usr/bin/php,' bin/*
54 cp -p %{SOURCE1} src/Composer/Satis/autoload.php
56 # move to Source dir, eases packaging
57 mv res views src/Composer/Satis
61 mv src/Composer/Satis/Compiler.php .
64 rm -rf $RPM_BUILD_ROOT
65 install -d $RPM_BUILD_ROOT{%{_bindir},%{php_data_dir}/Composer}
66 cp -a src/Composer $RPM_BUILD_ROOT%{php_data_dir}
67 install -p bin/%{name} $RPM_BUILD_ROOT%{_bindir}/%{name}
70 rm -rf $RPM_BUILD_ROOT
73 %defattr(644,root,root,755)
74 %doc README.md LICENSE
75 %attr(755,root,root) %{_bindir}/satis
76 %{php_data_dir}/Composer/Satis