Changes between Version 3 and Version 4 of RPMBuilding


Ignore:
Timestamp:
Aug 4, 2010 9:04:21 AM (14 years ago)
Author:
thomas
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RPMBuilding

    v3 v4  
    11= Getting started with RPM Building =
    22
     3[[PageOutline(2-6)]]
    34How to get started with building RPMS - in particular how to setup your build environment and the basics of spec file writing.
    45
    56== Getting Started ==
    67
    7 [attachment:rpm-talk-2.white.pdf RPM Building (PDF)]
     8[attachment:rpm-talk-2.white.pdf RPM Building (PDF)] - presentation on RPM building given at IAS.
    89
    910To build rpms you need to have a .rpmmacros file in your home directory which configures your build tree location. The minimum you'll need is the location of your top directory for building
     
    7273BuildRoot: /var/tmp/NaV{version}-root
    7374Requires: /etc/blabla
    74 plazonic@math.princeton.edu>
    75 Description
     75}}}
    7676
     77==== Description ====
     78
     79{{{
     80#!sh
    7781%description
    7882This is an example rpm, with no useful content or purpose, just here to show how to do it.
    79 Prep
     83}}}
    8084
     85==== Prep ====
     86{{{
     87#!sh
    8188%setup -q -a 1
    8289%patch0 -p1 -b .paths
     
    8592cd examples-additional
    8693gunzip -dc % | tar xf -
    87 Build
     94}}}
    8895
     96==== Build ====
     97{{{
     98#!sh
    8999%build
    90100%configure --with-special-option=princeton --exclude-motif
     
    94104%configure --with-tex --with-pdf
    95105make all
    96 Install
     106}}}
    97107
     108==== Install ====
     109{{{
     110#!sh
    98111%install
    99112rm -rf $RPM_BUILD_ROOT
     
    104117install -m755 examples-additional/example2 $RPM_BUILD_ROOT%{_datadir}/example-doc
    105118perl -pi -e "s|$RPM_BUILD_ROOT||g" $RPM_BUILD_ROOT%{_mandir}/man*/*
    106 Scripts
     119}}}
    107120
     121==== Scripts ====
     122{{{
     123#!sh
    108124# post install script for the example-doc rpm
    109125%post doc
     
    112128%preun
    113129echo "Oh why, why, are you removing me..."
    114 Files
     130}}}
    115131
     132==== Files ====
     133{{{
     134#!sh
    116135%files
    117136%doc README COPYRIGHT
     
    123142%doc example-doc-%{version}/README
    124143%{_datadir}/example-doc
     144}}}
    125145
     146==== Clean ====
     147{{{
     148!#sh
    126149# clean the build root - highly advisable
    127150%clean
    128151rm -rf $RPM_BUILD_ROOT
     152}}}
    129153
     154==== Changelog ====
     155{{{
     156#!sh
    130157%changelog
    131158* Tue Dec 11 2001 Josko Plazonic <plazonic@....> 0.11-1
     
    135162== Additional useful directives: ==
    136163
    137 * BuildArch? - to force a particular architecture on build, e.g. for perl modules ("BuildArch: noarch")
    138 * %postun (post install), %pre (pre install) scripts
    139 * %setup options (setup macro understands tar.gz, tgz, tar.bz2, zip and maybe other archives...)
    140 * -n name will set the name of the build directory to the listed name. The default is $NAME-$VERSION.
    141 * -c will create and cd to the named directory before doing the untar
    142 * -b # will untar Source# before cd'ing into the directory (and this makes no sense with -c so don't do it). This is only useful with multiple source files
    143 * a # will untar Source# after cd'ing into the directory
    144 * -T This option overrides the default action of untarring the Source and requires a -b 0 or -a 0 to get the main source file untarred. You need this when there are secondary sources
    145 * -D Do not delete the directory before unpacking. This is only useful where you have more than one setup macro. It should only be used in setup macros after the first one (but never in the first one).
     164 * !BuildArch - to force a particular architecture on build, e.g. for perl modules ("BuildArch: noarch")
     165 * %postun (post install), %pre (pre install) scripts
     166 * %setup options (setup macro understands tar.gz, tgz, tar.bz2, zip and maybe other archives...)
     167 * -n name will set the name of the build directory to the listed name. The default is $NAME-$VERSION.
     168 * -c will create and cd to the named directory before doing the untar
     169 * -b # will untar Source# before cd'ing into the directory (and this makes no sense with -c so don't do it). This is only useful with multiple source files
     170 * a # will untar Source# after cd'ing into the directory
     171 * -T This option overrides the default action of untarring the Source and requires a -b 0 or -a 0 to get the main source file untarred. You need this when there are secondary sources
     172 * -D Do not delete the directory before unpacking. This is only useful where you have more than one setup macro. It should only be used in setup macros after the first one (but never in the
     173      first one).