Just the cheat-sheet I was looking for. Thanks!
Useful rpmbuild macros

Utilizing macros can make life easier when you’re dealing with building on, and for, multiple platforms. Why bother with hard-coding full paths to system utilities when you can simply refer to them by their macro name?
These can also be useful for avoiding things like rpm check-files errors, installed (but unpackaged) file(s) found, and debuginfo related stuff.
If you find these macros are not available in your version of rpmbuild, you can explicitly define them yourself. Most systems will have (most of) these preconfigured for you in /usr/lib/rpm or a similar path.
filesystem macros
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
%__awk gawk %__bzip2 /usr/bin/bzip2 %__cat /bin/cat %__chgrp /bin/chgrp %__chmod /bin/chmod %__chown /bin/chown %__cp /bin/cp %__cpio /bin/cpio %__file /usr/bin/file %__gpg /usr/bin/gpg %__grep /bin/grep %__gzip /usr/bin/gzip %__id /usr/bin/id %__install /usr/bin/install %__ln_s ln -s %__lzma /usr/bin/lzma %__xz /usr/bin/xz %__make /usr/bin/make %__mkdir /bin/mkdir %__mkdir_p /bin/mkdir -p %__mv /bin/mv %__patch /usr/bin/patch %__perl /usr/bin/perl %__pgp /usr/bin/pgp %__python /usr/bin/python %__rm /bin/rm %__rsh /usr/bin/rsh %__sed /bin/sed %__ssh /usr/bin/ssh %__tar /bin/tar %__unzip /usr/bin/unzip |
Build system path macros
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
%__ar ar %__as as %__cc gcc %__cpp gcc -E %__cxx g++ %__ld /usr/bin/ld %__nm /usr/bin/nm %__objcopy /usr/bin/objcopy %__objdump /usr/bin/objdump %__ranlib ranlib %__remsh %{__rsh} %__strip /usr/bin/strip |
Avoid failures if tools are not installed when rpm is built
|
1 2 3 4 5 6 7 8 9 |
%__libtoolize libtoolize %__aclocal aclocal %__autoheader autoheader %__automake automake %__autoconf autoconf |
Other
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# The directory where rpm's configuration and scripts live %_rpmconfigdir %{getconfdir} # The directory where sources/patches will be unpacked and built. %_builddir %{_topdir}/BUILD # The interpreter used for build scriptlets. %_buildshell /bin/sh # The path to the bzip2 executable (legacy, use %{__bzip2} instead). %_bzip2bin %{__bzip2} The location of the rpm database file(s). %_dbpath %{_var}/lib/rpm # The location of the rpm database file(s) after "rpm --rebuilddb". %_dbpath_rebuild %{_dbpath} # The path to the gzip executable (legacy, use %{__gzip} instead). %_gzipbin %{__gzip} # The number of changelog entries kept when installing (unused in rpm-4.0.1 and later). %_instchangelog 5 # The path to the pgp executable (legacy, use %{__pgp} instead). %_pgpbin %{__pgp} # The directory where newly built binary packages will be written. %_rpmdir %{_topdir}/RPMS # A template used to generate the output binary package file name (legacy). %_rpmfilename %{_build_name_fmt} # The default signature type. %_signature gpg # The directory where sources/patches from a source package will be installed. %_sourcedir %{_topdir}/SOURCES # The directory where the spec file from a source package will be installed. %_specdir %{_topdir}/SPECS # The directory where newly built source packages will be written. %_srcrpmdir %{_topdir}/SRPMS # The directory where buildroots will be created. %_buildrootdir %{_topdir}/BUILDROOT # Build root path, where %install installs the package during build. %buildroot %{_buildrootdir}/%{name}-%{version}-%{release}.%{_arch} # Directory where temporaray files can be created. %_tmppath %{_var}/tmp # Path to top of build area. %_topdir %{getenv:HOME}/rpmbuild # The path to the unzip executable (legacy, use %{__unzip} instead). %_unzipbin %{__unzip} # A macro that expands to nothing. %nil %{!?nil} |
Just the cheat-sheet I was looking for. Thanks!