alphonsoisded
alphonsoisded

Reputation: 1

Building Custom RPM Files

I want to create a single RPM that packs some other RPMs, some shell scripts, and my compiled binary. A single shell file can perform all the installation and setup by extracting files in a temp directory, copying them to the my install directory, install the rpms, create the service, clean the files and exit

How should I setup my directory structure and spec file, I'm really confused. Also, I only want one single RPM in the hand that holds all of my data.

Updates: Okay, so here's what I've done, I'm able to build the RPM. But stuck at a key catch,

[---@localhost ~]$ sudo rpm -i ***-2.0-2.0-0.x86_64.rpm 

warning: /etc/***/install_guard/protobuf-2.5.0-8.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
warning: waiting for transaction lock on /var/lib/rpm/.rpm.lock

Why this happens, because I'm running a shell script inside my spec file:

install -m 755 libqb-1.0.1-7.el7.x86_64.rpm $RPM_BUILD_ROOT/etc/***/install_guard/
install -m 755 protobuf-2.5.0-8.el7.x86_64.rpm $RPM_BUILD_ROOT/etc/***/install_guard/
install -m 755 usbguard-0.7.4-2.el7.x86_64.rpm $RPM_BUILD_ROOT/etc/***/install_guard/


%post
bash /etc/***/scripts/init_setup.sh
init-setup.sh
# Installing Guard Rpms
rpm -i /etc/***/install_guard/protobuf-2.5.0-8.el7.x86_64.rpm
sleep 2
rpm -i /etc/***/install_guard/libqb-1.0.1-7.el7.x86_64.rpm
sleep 2
rpm -i /etc/***/install_guard/usbguard-0.7.4-2.el7.x86_64.rpm 
sleep 2


Everything else works, just stuck at this point. '***': redacted proprieatary data

One possible solution is adding those 3 RPMs as require: files and add them to their internal RPM Repostore, but the customer demand is very specific. Can I have any other work around.

Upvotes: 0

Views: 260

Answers (1)

Aaron D. Marasco
Aaron D. Marasco

Reputation: 6758

You cannot have RPMs install other RPMs. You make them Require the others and then put them into a yum repository.

Upvotes: 2

Related Questions