English Chinese (Simplified)
tito will also handle the creation of the source tarball from the git repository, so change the `Source0:` URL to the filename `%\{name}-%\{version}.tar.gz` & add a comment to tell users how to get the tarball
The changelog can be left empty.
``` user@host ~/copr-tito-quickdoc % cat hellocopr.spec ... Version: 0.0.0 Release: 0%\{?dist} ... # Sources can be obtained by # git clone https://pagure.io/copr-tito-quickdoc # cd copr-tito-quickdoc # tito build --tgz Source0: %\{name}-%\{version}.tar.gz ... %changelog ```
Commit the changes.
Next, we initialize the project for use with tito.
``` user@host ~/copr-tito-quickdoc % tito init Creating tito metadata in: ~/copr-tito-quickdoc/.tito
created ~/copr-tito-quickdoc/.tito
wrote tito.props
created ~/copr-tito-quickdoc/.tito/packages
wrote ~/copr-tito-quickdoc/.tito/packages/.readme
committed to git Done! ```
This creates link:https://pagure.io/copr-tito-quickdoc/c/7a6919d3dd56943bb988a755f8233157965aa9bb?branch=master[a subdirectory `.tito` with some default configuration], which can be left unchanged for now.
We can now do a test build of the package using `tito build`. Usually, tito will build from a tag, which we haven't created yet. However, using the `--test` flag, we can build from the most recent commit instead, which will be written to `/tmp/tito`:
``` user@host ~/copr-tito-quickdoc % tito build --rpm --test Creating output directory: /tmp/tito WARNING: unable to lookup latest package tag, building untagged test project WARNING: .tito/packages/hellocopr doesn't exist in git, using current directory Building package [hellocopr-0.0.0-0] Wrote: /tmp/tito/hellocopr-git-11.7a6919d.tar.gz ...
Successfully built: /tmp/tito/hellocopr-0.0.0-0.git.11.7a6919d.fc32.src.rpm
/tmp/tito/noarch/hellocopr-0.0.0-0.git.11.7a6919d.fc32.noarch.rpm ```
Once we've fixed any issues with the package that might crop up, we can let tito create a package release using `tito tag`. Since we haven't set a proper version yet, we need to pass it to tito for the first tag:
``` user@host ~/copr-tito-quickdoc % tito tag --use-version 1.0.0 ```
This will open the editor & display a pre-formatted changelog entry build up from all commits since the last release, which we can edit as needed. Since there have been none so far, the entry will just contain "- new package built with tito". Save the file, link:https://pagure.io/copr-tito-quickdoc/c/f44e81d695df669bcdb7237612baf41b80da98e0?branch=master[and tito will]
set the Version in the specfile to 1.0.0