I am adding some sources to an existing rpm .spec
file by URL and don't have them downloaded yet. Is there a way to get rpmbuild
to download the sources rather than doing it manually?
相关问题
- RPM spec %post doesn't execute in rpmbuild
- Building with rpmbuild under Ubuntu
- Rpm-build limitaitons
- What's the rule for the Name-Version-Release o
- “Missing” lib for rpm install when it is present i
相关文章
- python distutils not include the SWIG generated mo
- Distributing a python package along with module de
- How to set the rpmbuild destination folder
- Displaying information on non-installed RPM packag
- Application can't find python library installe
- How to abort the installation of an rpm package if
- What does the || : in this line of bash script fro
- How to exit rpm install in case of an error
In the spec file, you can place
%undefine _disable_source_fetch
anywhere before the source URL.For security purposes, you should also specify the sha256sum, and check it in the
%prep
section prior to setup.Here is a working example:
Credits
@YaroslavFedevych for undefine _disable_source_fetch.
For posterity, there is another way to do it, which does not need any additional tools or downloads:
Downloading sources automatically is forbidden by default because RPM lacks built-in integrity checks for the source archives. The network has to be trusted, and any checksums and signatures checked. This restriction makes sense for package maintainers, as they are responsible for shipping trusted code.
However, when you know what you are doing and understand the risks, you may just forcibly lift the restriction.
The
spectool
utility from therpmdevtools
package can do this. Just installrpmdevtools
and pointspectools
at the.spec
like so:It will download any missing sources into rpm's
%{_sourcedir}
(usuallySOURCES
) directory.If you are getting sources from a (git) hosting service (github, etc..) there is support for automatically checking it out already built-in, when combined with _disable_source_fetch...
https://fedoraproject.org/wiki/Packaging:SourceURL
For example, for a specific githash from github: