How to ship/include a generated file with ISO? - centos

I am trying to build an ISO where I have some prebuilt RPMS. I have another file which is dynamically generated and I want the ISO to include it and when that same ISO is installed, it should be placed in /usr/bin folder. I know one way is to make a RPM of the same file and package that RPM as part of the ISO so that when the other RPMs are installed, this RPM will also install the file in proper location. But is there any other way?

You can edit ISO with UltraISO.

Related

Some files are deleted after RPM upgrade

I have 2 RPM files. In RPM1 I have for example File.xml. In RPM2 this file is not present, but I create it via some scripts. As I know, after Upgrade, if the file is not in the list of RPM2 it will be deleted. Is there any configurations in the Spec file not to delete this file?
The easiest solution is to create a dummy file in the RPM2. But I would like to use SPEC file.
if the file is not in the list of RPM2 it will be deleted
no. The list of files are the files that the rpm detains. If you remove the rpm, then those files will be removed. Custom files that you create in %post scripts for example will not be removed, because rpm doesn't know who they belong to.
Example part of a spec file:
%post
echo "content" > /etc/file.xml
%files
/etc/file2.xml
when you install the rpm created with above spec file; /etc/file.xml and /etc/file2.xml will be present on the system.
If you now remove that rpm, /etc/file2.xml will be removed (because in the %files section), but /etc/file.xml will remain because it does not belong to your rpm.

How can I configure rpmbuild to use lib64/perl5 as an install path?

I am running CentOS7 (RHEL7) and I am trying to build a Perl module with rpmbuild. I have generated the SPEC file and it builds all the way until it installs, which fails.
error: File not found by glob: /home/user/rpm/BUILDROOT/perl-Data-Dumper-2.167_02-1.el7.centos.x86_64/usr/lib64/perl5/vendor_perl/auto/*
I see that in the .spec file, it is looking for %{perl_vendorarch}/auto/* so it's looking in the right place (same place that yum installs pre-built rpms for perl modules.)
HOWEVER, when doing the install phase, it seems rpmbuild is trying to use (via the MakeMaker generated Makefile) my PERL5LIB /home/user/perl5/lib/perl5. I can change the INSTALL_DIR via the spec to /usr, however, I can't figure out how to change the suffix to lib/perl5
Is there anyway to tell MakeMaker to use a different suffix?

Is there an option to convert shell installation to pkg in Solaris?

The JRE's in oracle site for Solaris comes in 'sh' format (java_1.6.xx.sh).
Is there an option to convert it from 'sh' to 'pkg', and then install it from this pkg on solaris using 'pkgadd'?
There is no conversion of an arbitrary self-extracting installer into a pkg-file. However, once installed, you can create a package out of the resulting directory structure and the files contained in it. You will also have the opportunity to add pre-install checks and post-install steps. Here is a link that could be of help: http://www.garex.net/sun/packaging/create_pkg.html
Hope this helps.

Installing 3rd party packages in kickstart on redhat

I have been trying to work out how to add my own packages as part of a kickstart install (specifically mondo packages) but using the %packages directive as opposed to rpm commands in the post scripts. I tried adding them to the packages file with my %include statement in the kickstart file, and copied the RPM's to the RH linux/Packages directory, however these packages don't get installed. I read something about comps.xml but dont have that file in the RHEL distribution, or know what the procedure is.
Essentially I have a package list which I include like this:
# cat packages.txt
openssh-clients
openssh-server
afio-2.5-1.rhel6.x86_64.rpm
buffer-1.19-4.rhel6.x86_64.rpm
mindi-2.1.7-1.rhel6.x86_64.rpm
mindi-busybox-1.18.5-3.rhel6.x86_64.rpm
mondo-3.0.4-1.rhel6.x86_64.rpm
All the rpms from afio down are custom ones not part of the RH installation.
Could someone tell me how this can be done?
thanks
All kickstart files should have a section near the top where they define available repos. An example repo line would look like this:
repo --name=a-base --baseurl=http://mirror.centos.org/centos/6/os/$basearch
This tells the kickstart system that there is a usable rpm repo at the given url
In order to add your own rpms you need to create a custom repo and point your kickstart files to it by adding a new repo line. Then you can list the core rpm package names in your %packages directive and they will be picked up.
So for you it would be something like:
...
repo --name=a-base --baseurl=http://my.domain.org/customrepo/path/here
%packages
openssh-clients
openssh-server
afio
buffer
mindi
mindi-busybox
mondo
...

Preventing hardcode path in RPM SPEC file

I am creating rpm for apc. While writing spec file, I realized that some commands may have path which can keep on changing which are required during the compilation time. For eg. these commands are required to be executed during the building time.
$ /usr/local/php/bin/phpize
$ ./configure --with-php-config=/usr/local/php/bin/php-config
But the complete path of phpize and php-config file may change. So how can i prevent this dependencies so that i should not hard-code these path in my spec file.
Because these commands are used at building time, the ideal solution to this problem is here:
Find packages on distribution which provide these commands or paths e.g php-config is provided by php-devel package on Fedora operating system. In fedora you can find it using yum whatprovides "*/php-config" or if they are already installed on system then using rpm -qf /path/to/command.
Once you know the packages add them as BuildRequire tag in spec file. Step 2 will make sure that paths are always present whenever you build the package from spec file even if you use hard coded paths (which isn't ofcourse best way to do it).
In place of /usr/ you can use %{_prefix}, it depends entirely on macros available on distribution you are building this rpm on. Check macro files for path macros. One link which has common macro definitions is here.