I'm trying to build an RPM, but the source file from the vendor has a space in the filename, and there doesn't seem to be any good way to escape the filename so that it builds.
I've tried putting a \
in front of the spaces. I've tried replacing them with %20
. I tried +
. I've tried putting "
s around it, I've tried '
around it.
For now, I'm working around it by renaming the source file from the vendor to not have spaces, but I really prefer to leave original vendor source filenames intact whenever possible.
With no escaping or quoting, I get:
+ unzip .../Foo Bar.zip
unzip: cannot find or open .../Foo, .../Foo.zip or .../Foo.ZIP.
With \
, the unzip works, but then:
error: Bad file: .../Foo\ Bar.zip: No such file or directory
Here is a fully functional test.spec file (I did zip "Foo Bar.zip" test.spec
to get a sample zipfile):
Summary: Test
Name: test
Version: 1
Release: 1
License: Whatever
URL: http://www.example.com/
Source1: Foo Bar.zip
%description
Just a test of escaping stuff...
%prep
%build
%install
%{__install} -d -m0755 %{buildroot}/foo
cd %{buildroot}/foo
unzip %SOURCE1
%clean
%{__rm} -rf %{buildroot}
%files
/foo
%changelog
* Wed May 8 2013 Example <[email protected]>
- Whatever