]>
Commit | Line | Data |
---|---|---|
df5364cd ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # build without tests | |
4 | ||
df5364cd | 5 | Summary: fpm - package building and mangling |
73f35394 | 6 | Name: fpm |
7561eb44 | 7 | Version: 1.10.2 |
3bc92f8c | 8 | Release: 2 |
a2e7f0b9 | 9 | License: MIT-like |
df5364cd | 10 | Group: Development/Languages |
beabb477 | 11 | Source0: https://github.com/jordansissel/fpm/archive/v%{version}/%{name}-%{version}.tar.gz |
7561eb44 | 12 | # Source0-md5: 32f3982154a2bb3f00bf99357a3e792c |
ded550f8 | 13 | Source1: filesystem_list |
1459f1e6 | 14 | Patch0: templates.patch |
18532f9c | 15 | Patch1: tmppath.patch |
c978479a | 16 | Patch2: config-attrs.patch |
94ae8157 | 17 | Patch3: pld-init.d-dir.patch |
5d12b484 | 18 | Patch4: optional-packages.patch |
7ba9fb89 | 19 | Patch5: relax-deps.patch |
df5364cd ER |
20 | URL: https://github.com/jordansissel/fpm |
21 | BuildRequires: rpm-rubyprov | |
cdc18754 | 22 | BuildRequires: rpmbuild(macros) >= 1.665 |
df5364cd ER |
23 | BuildRequires: sed >= 4.0 |
24 | %if %{with tests} | |
72329b5a | 25 | BuildRequires: ruby-insist >= 0.0.6 |
df5364cd | 26 | BuildRequires: ruby-pry |
a2e7f0b9 ER |
27 | BuildRequires: ruby-rspec < 3.1 |
28 | BuildRequires: ruby-rspec >= 3.0.0 | |
b02e0e5b | 29 | BuildRequires: ruby-stud |
df5364cd | 30 | %endif |
ea9475af | 31 | Suggests: rpm-build |
73f35394 | 32 | Obsoletes: ruby-fpm <= 1.4.0-2 |
df5364cd ER |
33 | BuildArch: noarch |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
2a24ca30 ER |
36 | # skip python dependency generator |
37 | %define _noautoreqfiles %{ruby_vendorlibdir}/%{name}/package/pyfpm/get_metadata.py | |
38 | ||
df5364cd ER |
39 | %description |
40 | Convert directories, rpms, python eggs, rubygems, and more to rpms, | |
41 | debs, solaris packages and more. Win at package management without | |
42 | wasting pointless hours debugging bad rpm specs! | |
43 | ||
df5364cd | 44 | %prep |
73f35394 | 45 | %setup -q |
1459f1e6 | 46 | %patch0 -p1 |
18532f9c | 47 | %patch1 -p1 |
c978479a | 48 | %patch2 -p1 |
94ae8157 | 49 | %patch3 -p1 |
5d12b484 | 50 | %patch4 -p1 |
7ba9fb89 | 51 | %patch5 -p1 |
df5364cd ER |
52 | %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/* |
53 | ||
ded550f8 ER |
54 | # replace filesystem_list with pld version |
55 | cp -p %{SOURCE1} templates/rpm/filesystem_list | |
56 | ||
44e2d7b0 ER |
57 | # cleanup backups after patching |
58 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
59 | ||
cdc18754 | 60 | %build |
beabb477 ER |
61 | # make gemspec self-contained |
62 | ruby -r rubygems -e 'spec = eval(File.read("%{name}.gemspec")) | |
63 | File.open("%{name}-%{version}.gemspec", "w") do |file| | |
64 | file.puts spec.to_ruby_for_cache | |
65 | end' | |
cdc18754 | 66 | |
cb102ddc ER |
67 | %if %{with tests} |
68 | rspec | |
69 | %endif | |
70 | ||
df5364cd ER |
71 | %install |
72 | rm -rf $RPM_BUILD_ROOT | |
cdc18754 | 73 | install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir},%{_bindir}} |
df5364cd ER |
74 | cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir} |
75 | cp -a bin/* $RPM_BUILD_ROOT%{_bindir} | |
73f35394 ER |
76 | cp -a templates $RPM_BUILD_ROOT%{ruby_vendorlibdir}/%{name} |
77 | cp -p %{name}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir} | |
df5364cd ER |
78 | |
79 | %clean | |
80 | rm -rf $RPM_BUILD_ROOT | |
81 | ||
82 | %files | |
83 | %defattr(644,root,root,755) | |
84 | %attr(755,root,root) %{_bindir}/fpm | |
73f35394 ER |
85 | %{ruby_vendorlibdir}/%{name}.rb |
86 | %{ruby_vendorlibdir}/%{name} | |
87 | %{ruby_specdir}/%{name}-%{version}.gemspec |