macros - How to control the rpmbuild buildroot and install directory -


i confused directories in rpmbuild.

1: buildroot: should used store files supposed installed when binary package installed end-user.

questions: how control directory? buildroot mean?

 $ cat 3.spec  ..  buildroot: /opt/abc  ..  %prep  echo %{buildroot}  echo  $rpm_build_root    

whatever set buildroot to, result defined in /usr/lib/rpm/macros. if define %buildroot in ~/.rpmmacros, result it.

2: how control destination when install rpm package? example: rpm -ivh xxx.rpm, files installed?

you create subdirectories in %install or wherever.

example: want install files in /opt/mypkg/ want config file /etc/mypkg.conf. in %install section you:

mkdir -p %{buildroot}/opt/mypkg mkdir -p %{buildroot}/etc 

so re-creating tree want installed, %{buildroot} equivalent of target's /.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -