3 %define githash 6a8e47e
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: ec71a1da6009bf5198a6a8c736c10aab
19 Patch0: autoload.patch
20 URL: https://github.com/composer/satis
21 BuildRequires: rpm-php-pearprov >= 4.4.2-11
22 BuildRequires: rpmbuild(macros) >= 1.461
23 BuildRequires: sed >= 4.0
24 Requires: composer >= 1.0.0-18
25 Requires: php(core) >= %{php_min_version}
29 Requires: php-composer-semver >= 1.2.0-2
30 Requires: php-twig-Twig >= 1.7
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 %define _appdir %{_datadir}/%{name}
37 Simple static Composer repository generator.
39 It uses any composer.json file as input and dumps all the required
40 (according to their version constraints) packages to a Composer
44 %setup -qc -n %{name}-%{version}-%{release}
48 %{__sed} -i -e '1s,^#!.*env php,#!/usr/bin/php,' bin/*
50 cp -p %{SOURCE1} src/Composer/Satis/autoload.php
52 # move to Source dir, eases packaging
53 mv res views src/Composer/Satis
57 mv src/Composer/Satis/Compiler.php .
60 rm -rf $RPM_BUILD_ROOT
61 install -d $RPM_BUILD_ROOT{%{_bindir},%{php_data_dir}/Composer}
62 cp -a src/Composer $RPM_BUILD_ROOT%{php_data_dir}
63 install -p bin/%{name} $RPM_BUILD_ROOT%{_bindir}/%{name}
66 rm -rf $RPM_BUILD_ROOT
69 %defattr(644,root,root,755)
70 %doc README.md LICENSE
71 %attr(755,root,root) %{_bindir}/satis
72 %{php_data_dir}/Composer/Satis