15

Which man page describes the usage of the top-level RPM spec file macros that are defined in RPM source files directly? I mean, %setup, %buildroot and the like, which are not in /usr/lib/rpm. Looking up the %setup options in a tutorial at rpm.org or searching through the source code isn't best of convenience.

badbishop
  • 898
  • 3
  • 11
  • 21

6 Answers6

8

The Fedora Project hosts the best documentation on RPM out there in html format:

http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html-single/RPM_Guide/index.html

See also:

http://fedoraproject.org/wiki/How_to_create_an_RPM_package

Prior to these resources, my go to guide was Maximum RPM (which you also found):

http://www.rpm.org/

dmourati
  • 24,720
  • 2
  • 40
  • 69
  • Yep, Fedora guide seems to be very well written! Should pay more attention to these 'drafts', as they seem better written than some 'normal' documentation. – badbishop Feb 02 '13 at 07:39
  • 1
    I never did find anything in the Fedora Draft Documentation to describe the parameters for %setup. The link to the coverage in "Maximum RPM" is: http://www.rpm.org/max-rpm/s1-rpm-inside-macros.html – Mark Edington Jul 07 '16 at 21:35
  • 1
    @MarkEdington see: https://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html-single/RPM_Guide/index.html#id853841 – dmourati Jul 08 '16 at 05:43
  • the primary resource you list is 404 - not found :( – Marcus Müller Sep 19 '17 at 21:36
  • @MarcusMüller seems working now – dmourati Oct 06 '17 at 18:24
2

Some of them are documented in Maximum RPM, Taking the RPM Package Manager to the Limit by Edward C. Bailey.

Section Macros: Helpful Shorthand for Package Builders describes %setup and %patch macros.

Olaf Dietsche
  • 265
  • 1
  • 7
Piotr Dobrogost
  • 371
  • 5
  • 16
1

There is no man page for that, but you can create a minimal spec file using rpmdev-newspec from rpmdevtools package.

0

Most of sources linked in the other answers don't seem to mention %autosetup. (At least not directly.)

There is this "RPM Reference Manual", which does:

https://rpm-software-management.github.io/rpm/manual/autosetup.html

Alois Mahdal
  • 263
  • 1
  • 4
  • 17
0

As far as I am aware no such documentation exists within the man pages. Even if you review all the items available in the rpmbuild and rpm man pages it does not detail those directives.

Forrest
  • 148
  • 1
  • 7
0

It's crazy that there is no fundamental public reference for the .spec file format which have been heavily used by multiple distributions for more than a decade.

You can jam a %dump into your spec and then try building (redirect stderr out to a file). Depending on where you put the %dump you get whatever macros existed at that moment. This is not a substitute for real documentation... but might keep you going.

Piotr Dobrogost
  • 371
  • 5
  • 16
Tel
  • 1