rpm-spec

How to package a .tar.gz file into rpm package

守給你的承諾、 提交于 2019-12-21 20:00:12
问题 I worked on Redhat Linux, I have a tar.gz file. I want to package this tar.gz file to a rpm package file. In the rpm package phase, I just want to extract the tar.gz file and package all of the staff into the rpm package, when I install the rpm package in linux server, it will just simply copy all of the files into the destination folder. I have tried a lot. Here goes some code for my SPEC file, but it has problems: %prep %build pwd %install rm -rf /usr/local/sample mkdir /usr/local/sample cd

Python RPM I built won't install

陌路散爱 提交于 2019-12-20 09:37:13
问题 Because I have to install multiple versions of Python on multiple Oracle Linux servers which are built via a kickstart process, I wanted to build a python rpm for our yum repository. I was able to build Python manually using 'make altinstall' which doesn't install over your default system Python installation, so I thought that would be the way to go. After much trial and error, I managed to build an rpm starting with a .bz2 python 2.7 package - but now when I try to install it, I get an error

How to abort the installation of an rpm package if some conditions are not met in specfile?

那年仲夏 提交于 2019-12-20 03:24:14
问题 There are some more things that the Requires tag does not satisfy. So i wrote a script to verify these things but where do I place them ? And if not found then i want to quit installation prompting user to do the steps before attempting to install this rpm again. writing exit 1 in %install tag fails to build the rpm using rpmbuild. says %install has a bad exit code. EDIT: let me provide you an example. What i initially wanted to test was is if Oracle Java 6 is present. If not then provide the

RPM conditional Requires in spec file possible

╄→гoц情女王★ 提交于 2019-12-20 03:17:10
问题 As the subject reads, I wonder whether it is possible in the RPM spec file to make required packages dependent on a condition? For instance check in a shell statement if on the install target e.g. the host is using bonding interfaces and only if have the Require become effective. 回答1: As an answer to your original question - Yes this is possible, but what you can implement depends what you want to use as a condition, and those are written to the package during build-time of the package, not

What does the || : in this line of bash script from an rpm spec file do?

北城以北 提交于 2019-12-19 21:23:48
问题 ln -s /var/log/$SERVICE_NAME $RPM_INSTALL_PREFIX/logs || : In the rpm spec file every line ends with || : What is the significance of the || : and why is it there? 回答1: It causes any error to be ignored so that the rpm operation isn't canceled. || causes the next command to run if the previous command failed, and : always succeeds. 回答2: It swallows the exit code. || does the thing after it if the thing before it fails (i.e., has a non-zero exit code). : is the “do nothing” command. Put them

How to pass user defined parameters to rpmbuild to fill variables

送分小仙女□ 提交于 2019-12-18 01:56:09
问题 is it possible to pass parameters to rpmbuild to fill user defined variables that are called inside the spec file? Example: The user defined variable %{foobar} which is called in the .spec file (but empty) should be filled with the variable which is passed when executing the rpmbuild command rpmbuild -bb --foobar="Foo" somespecfile.spec 回答1: rpmbuild -bb --define '_foobar Foo' somespecfile.spec and refer it within the spec as %{_foobar} (the _ is a convention, not a must) 回答2: The closest you

How to pass user defined parameters to rpmbuild to fill variables

[亡魂溺海] 提交于 2019-12-18 01:53:09
问题 is it possible to pass parameters to rpmbuild to fill user defined variables that are called inside the spec file? Example: The user defined variable %{foobar} which is called in the .spec file (but empty) should be filled with the variable which is passed when executing the rpmbuild command rpmbuild -bb --foobar="Foo" somespecfile.spec 回答1: rpmbuild -bb --define '_foobar Foo' somespecfile.spec and refer it within the spec as %{_foobar} (the _ is a convention, not a must) 回答2: The closest you

prefix and reloctable rpm package according to an other rpm prefix

坚强是说给别人听的谎言 提交于 2019-12-13 22:02:36
问题 I have install sample.rpm in /opt. I want samplw2.rpm find the relocation path of sample.rpm ad install itself in same place. is there any command or macro in spec file which check it befor installation or not? 回答1: I'm pretty sure this isn't possible; the file locations are fixed. The easiest solution would be to put them in a known location, and then set up a symlink in your %post , e.g. linking /opt/sample2 to /usr/local/sample2 where the latter is where the RPM puts the files. 来源: https:/

How to install two different versions of same rpm and make them work parallely

孤人 提交于 2019-12-13 19:00:40
问题 Currently I am trying to install a rpm secured_soft_2.0.0.rpm and i am unable to install it as we already have secured_soft_1.3.0 installed. Requirement is that we need to have both the versions installed. Complexities : These package inturn have dependent rpm's (lot of them ) and all these interdependent rpm's also have versions ex: secured_soft_1.3.0 works only with packages which are of version 1.3, and secured_soft_2.0.0.rpm work only with dependecies of version 2.0 only. So all these

Adding Qt Dependencies to spec file in rpmbuild

早过忘川 提交于 2019-12-13 10:21:28
问题 I'm using Ubuntu 14.04 and I am updating the rpmbuild spec file of an application that now uses Qt. The packages that I need are the following: sudo apt-get build-essential sudo apt-get install mesa-common-dev -y sudo apt-get install libglu1-mesa-dev -y sudo apt-get qt5-default sudo apt-get qtwebengine5-dev I know the spec file has "BuildRequires" and "Requires" dependency tags...any help in writing this as well as some examples would be helpful. I have a working spec file I just need to add