rpmbuild

symlink in particular directory using rpm spec

馋奶兔 提交于 2019-12-10 17:21:42
问题 rpm created using spec file will create directory "directory1" and all files in /var/lib/directory1. For another use case i want to create another directory in "/var/lib" which should be a symlink to directory1. eg: cd /var/lib/ ls -la directory2 -> directory1 directory1 how is it possible to do achieve this without using absolute paths in spec file? 回答1: %install mkdir -p %{buildroot}/%{_sharedstatedir}/directory1 ln -s directory1 %{buildroot}/%{_sharedstatedir}/directory2 %files %{

How to set the rpmbuild destination folder

可紊 提交于 2019-12-09 05:10:30
问题 I noticed rpmbuild (-bb and --buildroot options) creates the .rpm in different locations depending of what OS are you using: GNU/Linux Ubuntu <= 9.04: /usr/src/rpm/... GNU/Linux Ubuntu >= 9.10: /home/rpmbuild/... GNU/Linux Fedora: /usr/src/redhat/... So how can I set manually the destination folder for all OS? 回答1: Replying myself, adding: %define _rpmdir /outputdir to .spec file. 回答2: You may want to use the command argument --define : For example, this will send the rpm files into the

How do you make _topdir relative to the location of the .spec file when building an RPM?

荒凉一梦 提交于 2019-12-08 14:42:06
问题 I have a .spec file that relies on a variable called _topdir . Right now when you checkout the SRPM source from git, you have to go and change where _topdir is pointing to to get the rpmbuild to function correctly. # We need the following line so that RPM can find the BUILD and SOURCES and RPMS dirs. %define _topdir /root/projects/my-project/my-project-srpm/ How do you specify that _topdir should be relative to the location of the .spec file so that _topdir isn't hard coded? 回答1: specify your

how ${buildroot} is created automatically during rpmbuild?

放肆的年华 提交于 2019-12-08 03:11:46
问题 I want to create the binary rpm files from generated binary packages in centos 6.4 and noticed in one of my build system the ${buildroot} is created automatically, I want to know how it can be achieved. The sample wget.spec looks like below. detail spec is in my gist https://gist.github.com/larrycai/1ffe134bce1860f1cf87 %install tar xf ~/wget.tar.gz -C %{buildroot}/ %files %defattr(-,root,root) /usr/bin/wget The wget.tar.gz can be created tar -zcvf ~/wget.tar.gz /usr/bin/wget When I build it

How to control the rpmbuild buildroot and install directory

若如初见. 提交于 2019-12-06 09:15:20
问题 I am confused about some directories in rpmbuild. 1: buildroot: which should be used to store the files that are supposed to be installed when the binary package is installed by an end-user. Questions: how to control this directory? What does BuildRoot mean? $ cat 3.spec .. BuildRoot: /opt/abc .. %prep echo %{buildroot} echo $RPM_BUILD_ROOT whatever I set the BuildRoot to, I get the result which was defined in /usr/lib/rpm/macros . If I define %buildroot in ~/.rpmmacros , I will get the

Conditionally include file in an RPM

非 Y 不嫁゛ 提交于 2019-12-06 04:05:46
How can I conditionally include a file in an .rpm based on a define _foobar being set or not? The define _foobar would contain the absolute path inside the build root. The file is there. According to the documentation, I expected the following to work (note: there are more files in this %files section, but this is the gist): %files %if %{_foobar} %{_foobar} %endif which, however, gives me the error: error: parse error in expression error: /path/to/specfile:LINENO: parseExpressionBoolean returns -1 where /path/to/specfile:LINENO is the path to the .spec file and the line number of the line with

How to create RPM subpackages using the same paths for different envs?

廉价感情. 提交于 2019-12-05 18:45:25
I would like to use a rpm to build subpackages for different environments (live,testing,developer) but for the same files, so having a package called name-config-live, one called name-config-testing and one called name-config-developer and in them to have the same paths but each with the configs corresponding to the environment it's named after. as an example let's say on all environments I have a file called /etc/name.conf and on testing I want it to contain "1", on development "2" and on live "3". Is it possible to do this in the same spec since the subpackage generation only happens last

Bad exit status from /var/tmp/rpm-tmp.ajKra4 (%prep)

最后都变了- 提交于 2019-12-04 21:03:01
问题 I am having a weird RPM issue, I am new to it so bear with me... I have the spec file created and when I run to do the build I get an error: /var/tmp/rpm-tmp.ajKra4: line 36: cd: hero-01: No such file or directory error: Bad exit status from /var/tmp/rpm-tmp.ajKra4 (%prep) Then I check that temp file and it is trying to CD to a directory that does not exist.. Should it be creating this in the spec file? if so where? Here is my spec file: Summary: Install Hero Name: hero Version: 01 Release: 1

Using Jenkins BUILD NUMBER in RPM spec file

痞子三分冷 提交于 2019-12-04 20:00:46
问题 Name: My Software Version: 1.0.5 Release: 1 Summary: This is my software Not sure if anyone has tried this before or if it is easy, but: A spec file has two unique indicators for its version: Version (which specifies software version) Release (which specifies the package's number - if you build an RPM, it's broken, and build another one, you up the 'Release' number. I'm wondering if anyone has tried, or knows how, I could use the Jenkins $BUILD_NUMBER variable to dynamically change the

How to control the rpmbuild buildroot and install directory

六眼飞鱼酱① 提交于 2019-12-04 16:49:18
I am confused about some directories in rpmbuild. 1: buildroot: which should be used to store the files that are supposed to be installed when the binary package is installed by an end-user. Questions: how to control this directory? What does BuildRoot mean? $ cat 3.spec .. BuildRoot: /opt/abc .. %prep echo %{buildroot} echo $RPM_BUILD_ROOT whatever I set the BuildRoot to, I get the result which was defined in /usr/lib/rpm/macros . If I define %buildroot in ~/.rpmmacros , I will get the result from it. 2: How do I control the destination when we install the rpm package? For example: rpm -ivh