rpmbuild

How to exit rpm install in case of an error

这一生的挚爱 提交于 2019-12-01 04:23:00
问题 I am looking for a way to exit rpm install if some condition is false. I have added a small script in the %pre section that exits install if my condition fails. The problem I am facing is I see that the %pre scriptlet is executed, and rpm install does fail. Yet at the end of it I get these 2 lines which I don't want -- Installed ... followed by Complete! Downloading Packages: Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction missing file zyWhg1.

If condition inside the %Files section on a SPEC file

China☆狼群 提交于 2019-12-01 03:11:43
问题 I'm kinda a new to writing spec files and building RPM's. Currently I have one RPM that is supposed to deploy some files in 1 of 2 possible directories that will vary with the OS. How can I, within the %files section, verify them? I can't use variable...I can't verify both paths because one will for sure fail...I tried to define a macro earlier in the %install section but it will be defined just once and won't be redefined on every RPM installation... what can I do here? Thanks 回答1: The

RPM upgrade uninstalls the RPM

China☆狼群 提交于 2019-11-30 10:26:40
问题 I am upgrading our project RPM. The problem is when I upgrade from projectname-1.0-0 to projectname-1.0-1, it first installs the new project and uninstalls the old project, which, in overall view, removes my project entirely. I have used "vv" option while upgrading and the output showed the uninstallation is done after installation. Somebody please help with this problem. Is there anything I should change specifically in the RPM spec or rpmbuild options? 回答1: Yes, when an RPM upgrade occurs,

一个rpm包的艰难诞生

喜夏-厌秋 提交于 2019-11-30 09:05:35
问题背景 环境:CentOS 7.5 本打算使用checkinstall来打包spice-server,奈何CentOS7.5下没法yum install checkinstall 遂去网上找rpm包安装,然后总是报error: /xx/xx/libxxx.so is not a directory 怀疑是版本问题,然后去 git clone http://checkinstall.izto.org/checkinstall.git 手动装最新版本,结果还是报error: Building file list… FAILED! cat: /var/tmp/tmp.wHtVtWP0YZ/newfiles: No such file or directory 自带的log显示: error: line 11: Unknown tag: Recommends: 查了半天也没解决,没办法了只能想别的办法 rpmbuild 和 dpkg-buildpackage的操作太麻烦,暂不考虑 查到个新玩意儿,FPM 看起来 很好吃 很好用的样子,哈哈 安装FPM #安装rugy、gem: yum -y install ruby rubygems ruby-devel gem source -l #添加国内aliyun的源: gem sources -a http://mirrors.aliyun

openssh 8.0 rpm 制作

江枫思渺然 提交于 2019-11-30 07:27:59
yum install rpm-build zlib-devel openssl-devel gcc perl-devel pam-devel unzip -y mkdir -p /root/rpmbuild/{SOURCES,SPECS} cd /root/rpmbuild/SOURCES wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.0p1.tar.gz wget https://src.fedoraproject.org/repo/pkgs/openssh/x11-ssh-askpass-1.2.4.1.tar.gz/8f2e41f3f7eaa8543a2440454637f3c3/x11-ssh-askpass-1.2.4.1.tar.gz tar zxvf openssh-8.0p1.tar.gz openssh-8.0p1/contrib/redhat/openssh.spec mv openssh-8.0p1/contrib/redhat/openssh.spec ../SPECS/ chown sshd:sshd /root/rpmbuild/SPECS/openssh.spec cp /root/rpmbuild/SPECS/openssh.spec /root

Automatically install build dependencies prior to building an RPM package

て烟熏妆下的殇ゞ 提交于 2019-11-30 01:17:44
I am trying to build a .rpm package. I have just followed the steps to do that. Till now all steps were gone fine but now i just stuck with this step. I just ran the following command and got this error: rpmbuild -ba asterisk.spec error: Failed build dependencies: gtk2-devel is needed by asterisk-1.8.12.2-1.fc15.x86_64 libsrtp-devel is needed by asterisk-1.8.12.2-1.fc15.x86_64 [... more ...] freetds-devel is needed by asterisk-1.8.12.2-1.fc15.x86_64 uw-imap-devel is needed by asterisk-1.8.12.2-1.fc15.x86_64 I am using fedora-15. How to resolve this error? How I do install all depencencies

RPM upgrade uninstalls the RPM

懵懂的女人 提交于 2019-11-29 20:27:05
I am upgrading our project RPM. The problem is when I upgrade from projectname-1.0-0 to projectname-1.0-1, it first installs the new project and uninstalls the old project, which, in overall view, removes my project entirely. I have used "vv" option while upgrading and the output showed the uninstallation is done after installation. Somebody please help with this problem. Is there anything I should change specifically in the RPM spec or rpmbuild options? Yes, when an RPM upgrade occurs, RPM first installs the new version of the package and then uninstalls the old version of the package. Only

rpmbuild: using script files contained in the package in %pre script

烂漫一生 提交于 2019-11-29 12:47:56
I have to perform multiple elaborate "sanity" checks on target system before an RPM package installs/upgrades. I want to contain the procedure in a script (bash/python/php or otherwise) alongside other accessory files (such as SQL scripts) which wouldn't be installed with other files but only used during pre(install|upgrade). Where do I put these files for rpmbuild and how do I call/reference them (paths, etc.) inside %pre section and inside main script? How do I reference then-to-be-installed data files (said SQL scripts)? Thanks for any help. This is possible if you put the scripts in a self

How to pass user defined parameters to rpmbuild to fill variables

别等时光非礼了梦想. 提交于 2019-11-28 22:54:22
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 rpmbuild -bb --define '_foobar Foo' somespecfile.spec and refer it within the spec as %{_foobar} (the _ is a convention, not a must) smani The closest you can get AFAIK are conditional builds, which allow you to do things like rpmbuild -ba newpackage.spec -

What is the minimum I have to do to create an RPM file?

只愿长相守 提交于 2019-11-27 16:35:11
I just want to create an RPM file to distribute my Linux binary "foobar", with only a couple of dependencies. It has a config file, /etc/foobar.conf and should be installed in /usr/bin/foobar. Unfortunately the documentation for RPM is 27 chapters long and I really don't have a day to sit down and read this, because I am also busy making .deb and EXE installers for other platforms. What is the absolute minimum I have to do to create an RPM? Assume the foobar binary and foobar.conf are in the current working directory. devzero2000 I often do binary rpm per packaging proprietary apps - also