]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_with tests # build without tests | |
4 | ||
5 | Summary: fpm - package building and mangling | |
6 | Name: fpm | |
7 | Version: 1.10.2 | |
8 | Release: 2 | |
9 | License: MIT-like | |
10 | Group: Development/Languages | |
11 | Source0: https://github.com/jordansissel/fpm/archive/v%{version}/%{name}-%{version}.tar.gz | |
12 | # Source0-md5: 32f3982154a2bb3f00bf99357a3e792c | |
13 | Source1: filesystem_list | |
14 | Patch0: templates.patch | |
15 | Patch1: tmppath.patch | |
16 | Patch2: config-attrs.patch | |
17 | Patch3: pld-init.d-dir.patch | |
18 | Patch4: optional-packages.patch | |
19 | Patch5: relax-deps.patch | |
20 | URL: https://github.com/jordansissel/fpm | |
21 | BuildRequires: rpm-rubyprov | |
22 | BuildRequires: rpmbuild(macros) >= 1.665 | |
23 | BuildRequires: sed >= 4.0 | |
24 | %if %{with tests} | |
25 | BuildRequires: ruby-insist >= 0.0.6 | |
26 | BuildRequires: ruby-pry | |
27 | BuildRequires: ruby-rspec < 3.1 | |
28 | BuildRequires: ruby-rspec >= 3.0.0 | |
29 | BuildRequires: ruby-stud | |
30 | %endif | |
31 | Suggests: rpm-build | |
32 | Obsoletes: ruby-fpm <= 1.4.0-2 | |
33 | BuildArch: noarch | |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
36 | # skip python dependency generator | |
37 | %define _noautoreqfiles %{ruby_vendorlibdir}/%{name}/package/pyfpm/get_metadata.py | |
38 | ||
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 | ||
44 | %prep | |
45 | %setup -q | |
46 | %patch0 -p1 | |
47 | %patch1 -p1 | |
48 | %patch2 -p1 | |
49 | %patch3 -p1 | |
50 | %patch4 -p1 | |
51 | %patch5 -p1 | |
52 | %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/* | |
53 | ||
54 | # replace filesystem_list with pld version | |
55 | cp -p %{SOURCE1} templates/rpm/filesystem_list | |
56 | ||
57 | # cleanup backups after patching | |
58 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
59 | ||
60 | %build | |
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' | |
66 | ||
67 | %if %{with tests} | |
68 | rspec | |
69 | %endif | |
70 | ||
71 | %install | |
72 | rm -rf $RPM_BUILD_ROOT | |
73 | install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir},%{_bindir}} | |
74 | cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir} | |
75 | cp -a bin/* $RPM_BUILD_ROOT%{_bindir} | |
76 | cp -a templates $RPM_BUILD_ROOT%{ruby_vendorlibdir}/%{name} | |
77 | cp -p %{name}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir} | |
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 | |
85 | %{ruby_vendorlibdir}/%{name}.rb | |
86 | %{ruby_vendorlibdir}/%{name} | |
87 | %{ruby_specdir}/%{name}-%{version}.gemspec |