rpmbuild

date command is giving erroneous output while using inside rpm spec file

℡╲_俬逩灬. 提交于 2021-02-20 05:00:52
问题 I have to perform some necessary steps before installing my package, such as taking back up of previous datastore snapshot. For that purpose I'm using a %pre script as follows. %pre #!/bin/sh -------- -------- stamp=`date +%Y%m%d%H%M%S` echo ${stamp} ------------- ------------- The output is as follows: 20161103123325OURCE It is printing some random characters along with date. "OURCE" is not present anywhere in my spec file. The same script works perfectly as standalone. The platform is

date command is giving erroneous output while using inside rpm spec file

我的梦境 提交于 2021-02-20 05:00:49
问题 I have to perform some necessary steps before installing my package, such as taking back up of previous datastore snapshot. For that purpose I'm using a %pre script as follows. %pre #!/bin/sh -------- -------- stamp=`date +%Y%m%d%H%M%S` echo ${stamp} ------------- ------------- The output is as follows: 20161103123325OURCE It is printing some random characters along with date. "OURCE" is not present anywhere in my spec file. The same script works perfectly as standalone. The platform is

cpack restrict OS version package can be installed on

强颜欢笑 提交于 2021-02-11 12:42:34
问题 I create packages for several OS versions including RHEL7 & RHEL8 (or mostly equally CentOS7 & 8). It is possible to install a package built for .el7. on .el8. but it will typically not work (for example due to undefined symbols etc). Ideally I would like to make the installation fail with an error message like "this package is only intend for RHEL7/CentOS7". How can I do this? More specifically how can I do this with CPack/CMake? Bonus points if you can also given an explanation suitable for

Unable to read from user in rpm install script

£可爱£侵袭症+ 提交于 2021-02-05 09:24:08
问题 I've Created RPM Package which contains shell script code which shown below. When I'm installing it in RedHat OS, It is not taking user input and continuously looping. If I run the same file manually it's working fine. If Anybody Knows Please let me know. set +e IpAddress='0' condition=1 while [[ $condition -ne 0 ]] do echo ' ' echo "PLEASE PROVIDE APPLIANCE IP" read IpAddress if valid_ip $IpAddress; then condition=0 else echo $IpAddress " IS INVALID IP PLEASE PROVIDE A VALID IP: " echo ' '

Why does %autosetup perform patching BEFORE extracting sources?

ⅰ亾dé卋堺 提交于 2021-01-27 11:52:26
问题 I have a very straightforward arrangement -- one source tarball, one patch: Source: http://...../foo-%{version}.tar.gz Patch: my-patch-for-foo.diff ... %prep %autosetup -v -n bar-%{version} However, when I attempt to use the %autosetup in the %prep step, rpmbuild attempts to patch first -- before extracting: /bin/cat ..../SOURCES/my-patch-for-foo.diff | /usr/bin/patch Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.8PV0PY + umask 022 + cd /.... + LANG=C + export LANG + unset DISPLAY + cd /....

Why does %autosetup perform patching BEFORE extracting sources?

你。 提交于 2021-01-27 11:51:50
问题 I have a very straightforward arrangement -- one source tarball, one patch: Source: http://...../foo-%{version}.tar.gz Patch: my-patch-for-foo.diff ... %prep %autosetup -v -n bar-%{version} However, when I attempt to use the %autosetup in the %prep step, rpmbuild attempts to patch first -- before extracting: /bin/cat ..../SOURCES/my-patch-for-foo.diff | /usr/bin/patch Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.8PV0PY + umask 022 + cd /.... + LANG=C + export LANG + unset DISPLAY + cd /....

Why does %autosetup perform patching BEFORE extracting sources?

牧云@^-^@ 提交于 2021-01-27 11:49:08
问题 I have a very straightforward arrangement -- one source tarball, one patch: Source: http://...../foo-%{version}.tar.gz Patch: my-patch-for-foo.diff ... %prep %autosetup -v -n bar-%{version} However, when I attempt to use the %autosetup in the %prep step, rpmbuild attempts to patch first -- before extracting: /bin/cat ..../SOURCES/my-patch-for-foo.diff | /usr/bin/patch Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.8PV0PY + umask 022 + cd /.... + LANG=C + export LANG + unset DISPLAY + cd /....

RPM Spec file conditional Requires per distribution AFTER build

前提是你 提交于 2021-01-27 10:41:31
问题 I want to build RPM files and I want them to be commonly used and beeing not depending on which distribution is installed. Now I found a requirement which name is different on RHEL and SLES. I found this as possible solution: %if 0%{?suse_version} Requires: jdk >= 2000:1.8.0_00-fcs, netcat, telnet, at %else Requires: jdk >= 2000:1.8.0_00-fcs, nc, telnet, at %endif But my problem with is, that it's an if query for the Build process, what I wish to have is depending on the distribution I

Rpm-build limitaitons

♀尐吖头ヾ 提交于 2021-01-27 06:43:14
问题 I am beginner in rpm packaging and as I understand rpm-build has issue with file sizes>4GB due to cpio limitations. So I split the large file in my package with gnu split into files of 512MB [which is done as a part of rpmbuild since the large files are generated build time]. I still see the error: "error: create archive failed on file /io1/dm/build/BUILDROOT/pkg/installdir/lib/clfsplitab: cpio: Bad magic" where clfsplitab is the 512MB split of the large file. Any suggestions on how to trace