rpmtool.8 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.13
  2. .\"
  3. .\" Standard preamble:
  4. .\" ========================================================================
  5. .de Sh \" Subsection heading
  6. .br
  7. .if t .Sp
  8. .ne 5
  9. .PP
  10. \fB\\$1\fR
  11. .PP
  12. ..
  13. .de Sp \" Vertical space (when we can't use .PP)
  14. .if t .sp .5v
  15. .if n .sp
  16. ..
  17. .de Vb \" Begin verbatim text
  18. .ft CW
  19. .nf
  20. .ne \\$1
  21. ..
  22. .de Ve \" End verbatim text
  23. .ft R
  24. .fi
  25. ..
  26. .\" Set up some character translations and predefined strings. \*(-- will
  27. .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
  28. .\" double quote, and \*(R" will give a right double quote. | will give a
  29. .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
  30. .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
  31. .\" expand to `' in nroff, nothing in troff, for use with C<>.
  32. .tr \(*W-|\(bv\*(Tr
  33. .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
  34. .ie n \{\
  35. . ds -- \(*W-
  36. . ds PI pi
  37. . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
  38. . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
  39. . ds L" ""
  40. . ds R" ""
  41. . ds C`
  42. . ds C'
  43. 'br\}
  44. .el\{\
  45. . ds -- \|\(em\|
  46. . ds PI \(*p
  47. . ds L" ``
  48. . ds R" ''
  49. 'br\}
  50. .\"
  51. .\" If the F register is turned on, we'll generate index entries on stderr for
  52. .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
  53. .\" entries marked with X<> in POD. Of course, you'll have to process the
  54. .\" output yourself in some meaningful fashion.
  55. .if \nF \{\
  56. . de IX
  57. . tm Index:\\$1\t\\n%\t"\\$2"
  58. ..
  59. . nr % 0
  60. . rr F
  61. .\}
  62. .\"
  63. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  64. .\" way too many mistakes in technical documents.
  65. .hy 0
  66. .if n .na
  67. .\"
  68. .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
  69. .\" Fear. Run. Save yourself. No user-serviceable parts.
  70. . \" fudge factors for nroff and troff
  71. .if n \{\
  72. . ds #H 0
  73. . ds #V .8m
  74. . ds #F .3m
  75. . ds #[ \f1
  76. . ds #] \fP
  77. .\}
  78. .if t \{\
  79. . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
  80. . ds #V .6m
  81. . ds #F 0
  82. . ds #[ \&
  83. . ds #] \&
  84. .\}
  85. . \" simple accents for nroff and troff
  86. .if n \{\
  87. . ds ' \&
  88. . ds ` \&
  89. . ds ^ \&
  90. . ds , \&
  91. . ds ~ ~
  92. . ds /
  93. .\}
  94. .if t \{\
  95. . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
  96. . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
  97. . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
  98. . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
  99. . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
  100. . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
  101. .\}
  102. . \" troff and (daisy-wheel) nroff accents
  103. .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
  104. .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
  105. .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
  106. .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
  107. .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
  108. .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
  109. .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
  110. .ds ae a\h'-(\w'a'u*4/10)'e
  111. .ds Ae A\h'-(\w'A'u*4/10)'E
  112. . \" corrections for vroff
  113. .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
  114. .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
  115. . \" for low resolution devices (crt and lpr)
  116. .if \n(.H>23 .if \n(.V>19 \
  117. \{\
  118. . ds : e
  119. . ds 8 ss
  120. . ds o a
  121. . ds d- d\h'-1'\(ga
  122. . ds D- D\h'-1'\(hy
  123. . ds th \o'bp'
  124. . ds Th \o'LP'
  125. . ds ae ae
  126. . ds Ae AE
  127. .\}
  128. .rm #[ #] #H #V #F C
  129. .\" ========================================================================
  130. .\"
  131. .IX Title "RPMTOOL 8"
  132. .TH RPMTOOL 8 "OpenPKG" "RPMTOOL(8)" "OpenPKG"
  133. .SH "NAME"
  134. \&\fBrpmtool\fR \- RPM Auxiliary Tool
  135. .SH "SYNOPSIS"
  136. .IX Header "SYNOPSIS"
  137. \&\fBrpmtool\fR
  138. \&\fIcommand\fR
  139. [\fIcommand-options\fR]
  140. .SH "DESCRIPTION"
  141. .IX Header "DESCRIPTION"
  142. This is an auxiliary tool to the RedHat Package Manager (\s-1RPM\s0). It
  143. provides additional functionality for use in \s-1RPM\s0 \fIspec\fR files while
  144. building packages. The following \fIcommand\fRs are available:
  145. .IP "\fBplatform\fR" 4
  146. .IX Item "platform"
  147. This command outputs a unique platform id in the format
  148. \&\*(L"<architecture>\-<system><release>\*(R". For instance, the output on a
  149. FreeBSD platform can be \*(L"i386\-freebsd4.2\*(R", the output on a Linux
  150. platform can be \*(L"i686\-linux2.2.16\*(R", the output on a Solaris platform can
  151. be \*(L"sun4u\-sunos5.8\*(R", etc.
  152. .Sp
  153. Example:
  154. .Sp
  155. .Vb 5
  156. \& case `rpmtool platform`; in
  157. \& *-freebsd[34].* ) ... ;;
  158. \& *-sunos5.[678] ) ... ;;
  159. \& *-linux2.[24].* ) ... ;;
  160. \& esac
  161. .Ve
  162. .IP "\fBmflags\fR [\fB\-O\fR] \fItool\fR" 4
  163. .IX Item "mflags [-O] tool"
  164. This command outputs additional flags for \fImake\fR\|(1) for
  165. use with the program \fItool\fR. It provides only standard flags which
  166. always can be used. In conjunction with \fB\-O\fR (optimization), it also provides
  167. reasonable job control for use on multi-processor platforms (for instance it
  168. outputs \*(L"\-j4\*(R" on an \s-1SMP\s0 system with 2 CPUs if \s-1GNU\s0 make or \s-1BSD\s0 pmake is used).
  169. .Sp
  170. Example:
  171. .Sp
  172. .Vb 1
  173. \& make `rpmtool mflags -O make`
  174. .Ve
  175. .IP "\fBcflags\fR [\fB\-O\fR] \fItool\fR" 4
  176. .IX Item "cflags [-O] tool"
  177. This command outputs additional flags for \fIcc\fR\|(1) for use with the program
  178. \&\fItool\fR. It provides only standard flags which always can be used.
  179. conjunction with \fB\-O\fR it provides also optimization flags (for instance
  180. it outputs \*(L"\-O2 \-pipe\*(R" for \s-1GNU\s0 C/\*(C+ compiler).
  181. .Sp
  182. Example:
  183. .Sp
  184. .Vb 1
  185. \& CC="$CC" CFLAGS=`rpmtool mflags -O $CC` ./configure ...
  186. .Ve
  187. .ie n .IP "\fBcppflags\fR [\fB\-p\fR \fIprefix\fR] [[\*(C`+|\-\*(C'\fR\fIsubdir ...]" 4
  188. .el .IP "\fBcppflags\fR [\fB\-p\fR \fIprefix\fR] [[\f(CW\*(C`+|\-\*(C'\fR\fIsubdir\fR ...]" 4
  189. .IX Item "cppflags [-p prefix] [[+|-subdir ...]"
  190. This command output \fIcpp\fR\|(1) \f(CW\*(C`\-I\*(C'\fR options for the OpenPKG instance
  191. \&\fIprefix\fR. It optionally can prefix or suffix with one or more \fIsubdir\fR
  192. related options, too. If \fIsubdir\fR is prefixed with \f(CW\*(C`+\*(C'\fR (or not
  193. prefixed at all), the generated option is appended. If \fIsubdir\fR is
  194. prefixed with \f(CW\*(C`\-\*(C'\fR the generated option is prepended.
  195. .Sp
  196. Example:
  197. .Sp
  198. .Vb 1
  199. \& rpmtool cppflags -p /foo bar -baz +quux
  200. .Ve
  201. .ie n .IP "\fBldflags\fR [\fB\-p\fR \fIprefix\fR] [[\*(C`+|\-\*(C'\fR\fIsubdir ...]" 4
  202. .el .IP "\fBldflags\fR [\fB\-p\fR \fIprefix\fR] [[\f(CW\*(C`+|\-\*(C'\fR\fIsubdir\fR ...]" 4
  203. .IX Item "ldflags [-p prefix] [[+|-subdir ...]"
  204. This command output \fIld\fR\|(1) \f(CW\*(C`\-L\*(C'\fR options for the OpenPKG instance
  205. \&\fIprefix\fR. It optionally can prefix or suffix with one or more \fIsubdir\fR
  206. related options, too. If \fIsubdir\fR is prefixed with \f(CW\*(C`+\*(C'\fR (or not
  207. prefixed at all), the generated option is appended. If \fIsubdir\fR is
  208. prefixed with \f(CW\*(C`\-\*(C'\fR the generated option is prepended.
  209. .Sp
  210. Example:
  211. .Sp
  212. .Vb 1
  213. \& rpmtool ldflags -p /foo bar -baz +quux
  214. .Ve
  215. .IP "\fBfiles\fR [\fB\-v\fR] [\fB\-o\fR \fIoutfile\fR] [\fB\-r\fR \fIbuild-root\fR] [\fIentry\fR ...]" 4
  216. .IX Item "files [-v] [-o outfile] [-r build-root] [entry ...]"
  217. This is a dynamic variant of the \s-1RPM\s0 \f(CW%files\fR section, i.e., it
  218. dynamically creates the contents of the \f(CW%files\fR section for use with
  219. the \f(CW\*(C`%files \-f\*(C'\fR command. For this the file list entries are read from
  220. the command line (or from stdin if no arguments are given or a single
  221. argument \f(CW\*(C`\-\*(C'\fR is given) and written to stdout (if no \fB\-o\fR option is
  222. given or its \fIoutfile\fR argument is \f(CW\*(C`\-\*(C'\fR) or to \fIoutfile\fR.
  223. .Sp
  224. The trick of this approach is to be able to use additional features in
  225. the file list which \s-1RPM\s0 does not provide. The following features are
  226. provided:
  227. .RS 4
  228. .IP "\fBTrailing Tags\fR" 4
  229. .IX Item "Trailing Tags"
  230. \&\s-1RPM\s0 requires that all tags (like \f(CW\*(C`%attr(...)\*(C'\fR or \f(CW%dir\fR) preceed the
  231. path in a file list entry. This sometimes leads to ugly and unreadable
  232. file lists, because all paths cannot be left\-aligned. With \fIrpmtool\fR\|(1)
  233. tags in the input file list can be at leading and trailing positions.
  234. The output file list will nevertheless have all tags in leading
  235. positions for \s-1RPM\s0.
  236. .IP "\fBSyntactical Set Pattern\fR" 4
  237. .IX Item "Syntactical Set Pattern"
  238. \&\s-1RPM\s0 supports simple wildcard patterns like \f(CW\*(C`/path/*\*(C'\fR or \f(CW\*(C`/path/[a\-z]\*(C'\fR,
  239. etc. Sometimes it is convenient, to also have (in addition to character
  240. sets) string sets like \f(CW\*(C`/path/{foo,bar,quux}\*(C'\fR. \fIrpmtool\fR\|(1) provides this
  241. by syntactically (without checking the filesystem) expanding those
  242. string sets.
  243. .IP "\fBOverriding Entries\fR" 4
  244. .IX Item "Overriding Entries"
  245. This is the most important feature and the reason why \fIshtool\fR\|(1)'s
  246. \&\fBfiles\fR command was implemented. Although \s-1RPM\s0 allows one to specify a
  247. directory in a file list and then implicitly expands this recursively
  248. into its contents, it unfortunately does not allow one to later
  249. explcitly override particular entries (usually if an individual
  250. \&\f(CW\*(C`%attr(...)\*(C'\fR tag is required). \fIrpmtool\fR\|(1) now supports overriding
  251. entries, i.e., if a path occurs multiple times, only the last occurance
  252. is kept.
  253. .IP "\fBNegation Tag\fR" 4
  254. .IX Item "Negation Tag"
  255. This provides an additional tag \f(CW%not\fR which can be used to explicitly
  256. exclude a previously implicitly added entry.
  257. .RE
  258. .RS 4
  259. .Sp
  260. Example:
  261. .Sp
  262. .Vb 8
  263. \& %install
  264. \& :
  265. \& rpmtool files -o files -r$RPM_BUILD_ROOT \e
  266. \& '%defattr(-,foo,foo)' \e
  267. \& '%{prefix}' \e
  268. \& '%attr(1755,root,foo) %{prefix}/bin/bar' \e
  269. \& '%not %dir {%{prefix},%{prefix}/*,%{prefix}/man/*}' \e
  270. \& '%not %{prefix}/info/dir'
  271. .Ve
  272. .Sp
  273. .Vb 1
  274. \& %files -f files
  275. .Ve
  276. .RE
  277. .IP "\fBuser\fR [\fB\-a\fR] [\fB\-r\fR] [\fB\-p\fR \fIpasswd\fR] [\fB\-n\fR \fIrealname\fR] [\fB\-d\fR \fIhomedir\fR] [\fB\-s\fR \fIshell\fR] [\fB\-u\fR \fImin-uid\fR] \fIusername\fR" 4
  278. .IX Item "user [-a] [-r] [-p passwd] [-n realname] [-d homedir] [-s shell] [-u min-uid] username"
  279. This adds (\fB\-a\fR) or removes (\fB\-r\fR) the user \fIusername\fR in the system database.
  280. .IP "\fBgroup\fR [\fB\-a\fR] [\fB\-r\fR] [\fB\-g\fR \fImin-gid\fR] \fIgroupname\fR [\fIusername\fR ...]" 4
  281. .IX Item "group [-a] [-r] [-g min-gid] groupname [username ...]"
  282. This adds (\fB\-a\fR) or removes (\fB\-r\fR) the group \fIgroupname\fR in the system database.
  283. .IP "\fBmsg\fR [\fB\-b\fR]" 4
  284. .IX Item "msg [-b]"
  285. This displays the contents of \fIstdin\fR as a boxed message. If option
  286. \&\fB\-b\fR is given it additionally beeps once before displaying the box.
  287. .SH "HISTORY"
  288. .IX Header "HISTORY"
  289. This tool was created in November 2000 for use in OpenPKG, the
  290. cross-platform RPM-based Unix software packaging facility.
  291. .SH "AUTHOR"
  292. .IX Header "AUTHOR"
  293. .Vb 3
  294. \& Ralf S. Engelschall
  295. \& rse@engelschall.com
  296. \& www.engelschall.com
  297. .Ve