Quote:
Originally Posted by ram_rajavarapu
How to know which rpm to be placed in BuildRequires & Requires in spec file.
|
BuildRequires are the names of the packages required to
build the package you're building, think of the checks done at the './configure' stage, and Requires are the dependencies, the names of the packages required to
run your packages contents. Please read
How to create an RPM package as its the best doc around IMHO.
Quote:
Originally Posted by ram_rajavarapu
How to place which files be in "files"
|
At the end of the "%install" stage use
Code:
find $RPM_BUILD_ROOT -not -type d -printf "%%%attr(%%m,root,root) %%p\n" | sed -e "s|$RPM_BUILD_ROOT||g" > %{_tmppath}/%{name}_contents.txt
and then at "%files" refer to it as
Code:
%files -f %{_tmppath}/%{name}_contents.txt
Note the "%files" section can also take a
Code:
%defattr(-,root,root)
Quote:
Originally Posted by ram_rajavarapu
and what permissions should they have.
|
That depends on the purpose of the item. If you'r rebuilding a RPM please have a look at the .spec file from the .src.rpm, else what sane defaults your system provides and else create your own sane defaults and test:
Code:
%files
%defattr(-,root,root)
%doc faq/* README ChangeLog QUICKSTART doc/*
%attr(755,root,root) /usr/local/bin/item
%attr(644,root,root) /usr/local/etc/item.conf
Quote:
Originally Posted by ram_rajavarapu
Can we upgrade the rpm which was already installed by rpm that will be made from spec file.
|
In theory yes but in practice "it depends". For example you should not mess with custom built packages that overwrite items vital to a system like the kernel, glibc (or Python on RHEL or equivalent) unless there's no alternative, and until you're well-versed and will offer support during installation / use of your package(s). You better not mess with custom built (replacement) packages especially if the system comes with licensed vendor support. You should test installing RPM packages in a staging area and not on Production. Think you can do that? OK, then do read this paragraph again and let the implications of what you're about to do sink in good before proceeding.