gbp-pq-rpm.sgml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <refentry id="man.gbp.pq.rpm">
  2. <refentryinfo>
  3. <address>
  4. &rpm-email;
  5. </address>
  6. <author>
  7. &rpm-firstname;
  8. &rpm-surname;
  9. </author>
  10. </refentryinfo>
  11. <refmeta>
  12. <refentrytitle>gbp-pq-rpm</refentrytitle>
  13. &dhsection;
  14. </refmeta>
  15. <refnamediv>
  16. <refname>gbp-pq-rpm</refname>
  17. <refpurpose>Manage patches and development branches in Git</refpurpose>
  18. </refnamediv>
  19. <refsynopsisdiv>
  20. <cmdsynopsis>
  21. &gbp-pq-rpm;
  22. &man.common.options.synopsis;
  23. <arg><option>--packaging-dir=</option><replaceable>DIRECTORY</replaceable></arg>
  24. <arg><option>--spec-file=</option><replaceable>FILEPATH</replaceable></arg>
  25. <arg><option>--upstream-tag=</option><replaceable>TAG-FORMAT</replaceable></arg>
  26. <arg><option>--force</option></arg>
  27. <arg><option>--[no-]patch-numbers</option></arg>
  28. <group choice="plain">
  29. <arg><option>drop</option></arg>
  30. <arg><option>export</option></arg>
  31. <arg><option>import</option></arg>
  32. <arg><option>rebase</option></arg>
  33. <arg><option>switch</option></arg>
  34. <arg><option>apply</option></arg>
  35. </group>
  36. </cmdsynopsis>
  37. </refsynopsisdiv>
  38. <refsect1>
  39. <title>DESCRIPTION</title>
  40. <para>
  41. &gbp-pq-rpm; helps in managing patches and development branch(es) for
  42. packages that are maintained with &gbp;. It designed to be used for
  43. packages that are maintained using the "orphan-packaging" model.
  44. &gbp-pq-rpm; has multiple subcommands, or actions, for working with the
  45. branches and patches.
  46. </para>
  47. <para>
  48. &gbp-pq-rpm; makes it easy to do source code development on a separate
  49. development branch (patch-queue branch in Debian git-buildpackage terms).
  50. For example, if the packaging files would be stored in
  51. <replaceable>master</replaceable> the associated development branch would
  52. be <replaceable>development/master</replaceable>.
  53. </para>
  54. </refsect1>
  55. <refsect1>
  56. <title>ACTIONS</title>
  57. <variablelist>
  58. <varlistentry>
  59. <term><option>import</option>
  60. </term>
  61. <listitem>
  62. <para>
  63. Create a development (patch-queue) branch by applying all patches
  64. from the packaging branch on top of the upstream version. The patches
  65. must apply without fuzz.
  66. </para>
  67. </listitem>
  68. </varlistentry>
  69. <varlistentry>
  70. <term><option>export</option>
  71. </term>
  72. <listitem>
  73. <para>
  74. Export patches from the development branch into the packaging branch.
  75. It generates patches (one-per-commit) from the development branch and
  76. updates the spec file accordingly. It doesn't automatically commit
  77. the changes though - they need to verified and committed manually.
  78. </para>
  79. </listitem>
  80. </varlistentry>
  81. <varlistentry>
  82. <term><option>rebase</option>
  83. </term>
  84. <listitem>
  85. <para>
  86. Switch to the development branch and rebase it against the current
  87. upstream version (indicated in the spec file of the associated
  88. packaging branch).
  89. </para>
  90. </listitem>
  91. </varlistentry>
  92. <varlistentry>
  93. <term><option>drop</option>
  94. </term>
  95. <listitem>
  96. <para>
  97. Drop (delete) the development branch associated to the current
  98. branch. For example, you're on branch <replaceable>foo</replaceable>
  99. this would drop branch <replaceable>development/foo</replaceable>.
  100. </para>
  101. </listitem>
  102. </varlistentry>
  103. <varlistentry>
  104. <term><option>apply</option>
  105. </term>
  106. <listitem>
  107. <para>
  108. Add a single patch to the development branch - similar to using
  109. <command>git-am</command>.
  110. </para>
  111. </listitem>
  112. </varlistentry>
  113. <varlistentry>
  114. <term><option>switch</option>
  115. </term>
  116. <listitem>
  117. <para>
  118. Switch between the development branch and the associated packaging
  119. branch.
  120. </para>
  121. </listitem>
  122. </varlistentry>
  123. </variablelist>
  124. </refsect1>
  125. <refsect1>
  126. <title>OPTIONS</title>
  127. <variablelist>
  128. &man.common.options.description;
  129. <varlistentry>
  130. <term><option>--packaging-dir=</option><replaceable>DIRECTORY</replaceable>
  131. </term>
  132. <listitem>
  133. <para>
  134. Subdirectory that contains the RPM packaging files.
  135. </para>
  136. </listitem>
  137. </varlistentry>
  138. <varlistentry>
  139. <term><option>--spec-file=</option><replaceable>FILEPATH</replaceable>
  140. </term>
  141. <listitem>
  142. <para>
  143. Relative path to the spec file to use. Special value
  144. <replaceable>auto</replaceable> causes &gbp; to search and guess.
  145. Other values cause the <option>--packaging-dir</option> option to be
  146. ignored: the directory of the spec file is used, instead.
  147. </para>
  148. </listitem>
  149. </varlistentry>
  150. <varlistentry>
  151. <term><option>--upstream-tag=</option><replaceable>TAG-FORMAT</replaceable>
  152. </term>
  153. <listitem>
  154. <para>
  155. Use this tag format when looking for tags of upstream versions,
  156. default is <replaceable>upstream/%(version)s</replaceable>.
  157. </para>
  158. </listitem>
  159. </varlistentry>
  160. <varlistentry>
  161. <term><option>--force</option></term>
  162. <listitem>
  163. <para>
  164. Import even if the development (patch-queue) branch already exists.
  165. Only valid for the import action.
  166. </para>
  167. </listitem>
  168. </varlistentry>
  169. <varlistentry>
  170. <term><option>--[no-]patch-numbers</option>
  171. </term>
  172. <listitem>
  173. <para>
  174. Whether the patch files should start with a number or not.
  175. </para>
  176. </listitem>
  177. </varlistentry>
  178. </variablelist>
  179. </refsect1>
  180. <refsect1>
  181. <title>META TAGS</title>
  182. <para>
  183. When exporting patches from a patch-queue branch &gbp-pq-rpm; will look at
  184. the commit message for special tags it recognizes. All tags need to start
  185. at the first column and require at least one whitespace after the colon.
  186. </para>
  187. <variablelist>
  188. <varlistentry>
  189. <term><option>Gbp-Rpm: Ignore</option>
  190. </term>
  191. <listitem>
  192. <para>
  193. Ignores the commit, no patch is generated out of it.
  194. </para>
  195. </listitem>
  196. </varlistentry>
  197. <varlistentry>
  198. <term><option>Gbp-Rpm: If &lt;expression&gt;</option>
  199. </term>
  200. <listitem>
  201. <para>
  202. Conditional patch. Put patch inside "%if &lt;expression&gt;" in the
  203. spec file.
  204. </para>
  205. </listitem>
  206. </varlistentry>
  207. <varlistentry>
  208. <term><option>Gbp-Rpm: IfArch&lt;expression&gt;</option>
  209. </term>
  210. <listitem>
  211. <para>
  212. Conditional patch. Put patch inside "%ifarch &lt;expression&gt;" in
  213. the spec file.
  214. </para>
  215. </listitem>
  216. </varlistentry>
  217. </variablelist>
  218. <para>
  219. For example, the following commit message:
  220. </para>
  221. <screen>
  222. Fix around a problem in Fedora
  223. which is not applicable elsewhere.
  224. Gbp-Rpm: If 0%{?fedora}
  225. </screen>
  226. <para>
  227. Will result something like this in the spec file:
  228. </para>
  229. <screen>
  230. # 0001-Fix-around-a-problem-in-Fedora.patch
  231. %if 0%{?fedora}
  232. %patch0 -p1
  233. %endif
  234. </screen>
  235. </refsect1>
  236. <refsect1>
  237. <title>SEE ALSO</title>
  238. <para>
  239. <xref linkend="man.gbp.buildpackage.rpm"/>,
  240. <xref linkend="man.gbp.import.srpm"/>,
  241. <xref linkend="man.gbp.conf"/>
  242. </para>
  243. </refsect1>
  244. <refsect1>
  245. <title>AUTHOR</title>
  246. <para>
  247. &rpm-username; &rpm-email;
  248. </para>
  249. </refsect1>
  250. </refentry>