summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2021-06-17 10:07:38 +0300
committerPanu Matilainen <pmatilai@redhat.com>2021-06-18 12:25:41 +0300
commite5344b0a624f010f129f82193fcb7e8cd6826a9a (patch)
treee3c026fbe5f094a24578e25f0149d1039265fad9
parentf8225732b5f9b4ce8ca20dc8f063abd0ddc149ba (diff)
downloadrpm-e5344b0a624f010f129f82193fcb7e8cd6826a9a.tar.gz
Rewrap autosetup docs to be readable + editable as plain text
-rw-r--r--docs/manual/autosetup.md59
1 files changed, 45 insertions, 14 deletions
diff --git a/docs/manual/autosetup.md b/docs/manual/autosetup.md
index 3b63441df..2e2fee4e4 100644
--- a/docs/manual/autosetup.md
+++ b/docs/manual/autosetup.md
@@ -6,7 +6,9 @@ title: rpm.org - Automating patch application in specs
## %autosetup description
-Starting with version 4.11, RPM has a set of new macros to further automate source unpacking and patch application. Previously one had to manually specify each patch to be applied, eg
+Starting with version 4.11, RPM has a set of new macros to further
+automatesource unpacking and patch application. Previously one had to
+manually specify each patch to be applied, eg
```
%prep
@@ -18,43 +20,71 @@ Starting with version 4.11, RPM has a set of new macros to further automate sour
%patch149
```
-This can get rather tedious when the number of patches is large. The new %autosetup macro allows taking care of all this in a single step: the following applies all the patches declared in the spec, ordered by the patch number:
+This can get rather tedious when the number of patches is large. The new
+%autosetup macro allows taking care of all this in a single step: the
+following applies all the patches declared in the spec, ordered by the patch
+number:
```
%prep
%autosetup
```
-In addition to automating plain old "patch" command invocations, %autosetup allows utilizing various version control systems such as git, mercurial (aka hg), quilt and bzr for managing the build directory source. For example this unpacks the vanilla source, initializes a git repository in the build directory and then applies all the patches defined in the spec using individual git apply + commits:
+In addition to automating plain old "patch" command invocations, %autosetup
+allows utilizing various version control systems such as git, mercurial (aka
+hg), quilt and bzr for managing the build directory source. For example this
+unpacks the vanilla source, initializes a git repository in the build
+directory and then applies all the patches defined in the spec using
+individual git apply + commits:
```
%autosetup -S git
```
-The resulting build directory can be used for bisecting problems introduced in patches, and developing new patches from the build directory is more natural than with gendiff.
+The resulting build directory can be used for bisecting problems introduced
+in patches, and developing new patches from the build directory is more
+natural than with gendiff.
## %autosetup options
-Generally %autosetup accepts the same arguments as %setup does. The notable exceptions are
-
-* %autosetup defaults to quiet operation, so -q is not needed or accepted. Use -v to enable verbose source unpacking if needed.
-* -N disables automatic patch application if necessary for some reason. If %autosetup is called with -N, the patch-application phase can be manually invoked with %autopatch macro.
-* -S<vcs> specifies the VCS to use. Currently supported VCSes are: "git", "hg" (for mercurial), "bzr", "quilt" and "patch", "git_am" (rpm >= 4.12) and "gendiff" (rpm >= 4.14). If -S is omitted, %autosetup defaults to "patch"
+Generally %autosetup accepts the same arguments as %setup does. The notable
+exceptions are
+
+* %autosetup defaults to quiet operation, so -q is not needed or accepted.
+ Use -v to enable verbose source unpacking if needed.
+* -N disables automatic patch application if necessary for some reason. If
+ %autosetup is called with -N, the patch-application phase can be manually
+ invoked with %autopatch macro.
+* -S<vcs> specifies the VCS to use. Currently supported VCSes are: "git",
+ "hg" (for mercurial), "bzr", "quilt" and "patch", "git_am" (rpm >= 4.12)
+ and "gendiff" (rpm >= 4.14). If -S is omitted, %autosetup defaults to
+ "patch"
* -p<number> argument to control patch prefix stripping (same as -p to %patch)
-* -b (for creating patch backups) is accepted but currently ignored - this is not meaningful for a full-blown VCS anyway. If you need backups for gendiff use, use "gendiff" backend.
+* -b (for creating patch backups) is accepted but currently ignored - this is
+ not meaningful for a full-blown VCS anyway. If you need backups for gendiff
+ use, use "gendiff" backend.
-Note that the exact behavior of -S option depends on the used VCS: for example quilt only controls patches whereas git and mercurial control the entire source repository.
+Note that the exact behavior of -S option depends on the used VCS: for
+example quilt only controls patches whereas git and mercurial control the
+entire source repository.
## Automating patch (and source) declarations
-While typically patch and source names tend to be descriptive for humans, making automating the declarations impossible, some upstreams (for example bash and vim) provide bugfixes by serially numbered patches. In such cases automation can be taken one step further by programmatically generating the patch declarations as well. As of this writing there are no specific helper macros for performing this, but for example the embedded Lua interpreter can be used for the purpose:
+While typically patch and source names tend to be descriptive for humans,
+making automating the declarations impossible, some upstreams (for example
+bash and vim) provide bugfixes by serially numbered patches. In such cases
+automation can be taken one step further by programmatically generating the
+patch declarations as well. As of this writing there are no specific helper
+macros for performing this, but for example the embedded Lua interpreter can
+be used for the purpose:
```
%{lua:for i=1,45 do print(string.format("Patch%u: bash42-%03u\n", i, i)) end}
```
-On spec parse, the above expands to as many patch declarations (best inspected with `rpmspec --parse <spec>`):
+On spec parse, the above expands to as many patch declarations (best
+inspected with `rpmspec --parse <spec>`):
```
Patch1: bash42-001
@@ -65,4 +95,5 @@ Patch4: bash42-004
Patch45: bash42-045
```
-Combined with %autosetup, this can eliminate a very large number of repetitive spec lines, making package maintenance that little bit easier.
+Combined with %autosetup, this can eliminate a very large number of
+repetitive spec lines, making package maintenance that little bit easier.