Changes between Version 3 and Version 4 of RPMBuilding
- Timestamp:
- Aug 4, 2010 9:04:21 AM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
RPMBuilding
v3 v4 1 1 = Getting started with RPM Building = 2 2 3 [[PageOutline(2-6)]] 3 4 How to get started with building RPMS - in particular how to setup your build environment and the basics of spec file writing. 4 5 5 6 == Getting Started == 6 7 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. 8 9 9 10 To 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 … … 72 73 BuildRoot: /var/tmp/NaV{version}-root 73 74 Requires: /etc/blabla 74 plazonic@math.princeton.edu> 75 Description 75 }}} 76 76 77 ==== Description ==== 78 79 {{{ 80 #!sh 77 81 %description 78 82 This is an example rpm, with no useful content or purpose, just here to show how to do it. 79 Prep 83 }}} 80 84 85 ==== Prep ==== 86 {{{ 87 #!sh 81 88 %setup -q -a 1 82 89 %patch0 -p1 -b .paths … … 85 92 cd examples-additional 86 93 gunzip -dc % | tar xf - 87 Build 94 }}} 88 95 96 ==== Build ==== 97 {{{ 98 #!sh 89 99 %build 90 100 %configure --with-special-option=princeton --exclude-motif … … 94 104 %configure --with-tex --with-pdf 95 105 make all 96 Install 106 }}} 97 107 108 ==== Install ==== 109 {{{ 110 #!sh 98 111 %install 99 112 rm -rf $RPM_BUILD_ROOT … … 104 117 install -m755 examples-additional/example2 $RPM_BUILD_ROOT%{_datadir}/example-doc 105 118 perl -pi -e "s|$RPM_BUILD_ROOT||g" $RPM_BUILD_ROOT%{_mandir}/man*/* 106 Scripts 119 }}} 107 120 121 ==== Scripts ==== 122 {{{ 123 #!sh 108 124 # post install script for the example-doc rpm 109 125 %post doc … … 112 128 %preun 113 129 echo "Oh why, why, are you removing me..." 114 Files 130 }}} 115 131 132 ==== Files ==== 133 {{{ 134 #!sh 116 135 %files 117 136 %doc README COPYRIGHT … … 123 142 %doc example-doc-%{version}/README 124 143 %{_datadir}/example-doc 144 }}} 125 145 146 ==== Clean ==== 147 {{{ 148 !#sh 126 149 # clean the build root - highly advisable 127 150 %clean 128 151 rm -rf $RPM_BUILD_ROOT 152 }}} 129 153 154 ==== Changelog ==== 155 {{{ 156 #!sh 130 157 %changelog 131 158 * Tue Dec 11 2001 Josko Plazonic <plazonic@....> 0.11-1 … … 135 162 == Additional useful directives: == 136 163 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).