gear(1)

GEAR(1) User Commands GEAR(1)

NAME

gear - Get Every Archive from git package Repository

SYNOPSIS

gear [options] <output-tarball-name>
gear [options] --export-dir=<dirname>
gear [options] --command -- <command>...
gear [options] --hasher -- <hsh-command>...
gear [options] --rpmbuild -- <rpmbuld-command>...

DESCRIPTION

gear - extract archive from git package repository.

OPTIONS

--no-compress
do not compress output archive;
--bzip2
compress output archive using bzip2;
--gzip
compress output archive using gzip;
--lz4
compress output archive using lz4;
--lzop
compress output archive using lzop;
--xz
compress output archive using xz;
--zstd
compress output archive using zstd;
--disable-specsubst
disable specsubst directive support;
--commit
make temporary commit prior to extract;
--command
execute arbitrary command afterwards;
--hasher
execute hsh-like command afterwards;
--rpmbuild
execute rpmbuild-like command afterwards;
--update-spec
if specfile was changed after executed rpmbuild command, then update it in the git repository;
--export-dir=DIRNAME
write source files to specified directory;
--describe
describe package as "%{NAME} %{VERSION} %{RELEASE}";
-r, --rules=FILENAME
override rules file name;
-t, --tree-ish=ID
COMMIT[:PATH] specifying the tree to process;
-q, --quiet
try to be more quiet;
-v, --verbose
print a message for each action;
-V, --version
print program version and exit;
-h, --help
show this text and exit.

USAGE

gear can perform several different operations, one of which is selected by command line options.

Create a tar archive with source files

When no options which specify another operation are specified, gear requires a single non-option argument output-tarball-name. In this mode gear extracts source files from the repository and packs them into a tar archive with the specified name. By default the archive is compressed with zstd; this may be changed using the following compression options: --bzip2, --gzip, --lz4, --lzop, --xz, --zstd, and --no-compress.

Extract source files to a directory

When the --export-dir=dirname option is specified, gear does not accept any non-option arguments. In this mode gear extracts source files from the repository and puts them into the specified directory.

Execute hsh-like command

When the --hasher option is specified, gear requires one or more non-option arguments hsh-command..., which specify the command to execute and parameters for it. In this mode gear extracts source files from the repository, creates a temporary tar archive with these files and invokes hsh-command, appending the archive file name to its parameters. When hsh-command completes, gear removes the temporary tar archive.

Execute rpmbuild-like command

When the --rpmbuild option is specified, gear requires one or more non-option arguments rpmbuild-command..., which specify the command to execute and parameters for it. In this mode gear extracts source files from the repository to a temporary directory and invokes rpmbuild-command, appending the following parameters to it:

--define "_specdir $dir" --define "_sourcedir $dir" "$spec"

where $dir is the name of the temporary directory, and $spec is the full name of the extracted spec file. When rpmbuild-command completes, gear optionally copies the spec file from the temporary directory to the working copy of the repository (if requested by the --update-spec option), and then removes the temporary source directory.

Describe the package

When the --describe options is specified, gear does not accept any non-option arguments. In this mode gear just prints the package name, version and release strings found in the spec file, and does not proceed to extract source files from the repository.

TEMPORARY COMMITS AND TAGS

In --commit mode, gear creates a temporary commit object with staged and unstaged changes. If specsubst: directive is in use, gear also creates a temporary tag object for just created temporary commit object.

CONFIGURATION

gear reads following configuration options from git-config(1):

gear.compress

compression method, defaults to --zstd.

gear.rules

rules file name.

In --commit mode, when specsubst: directive is in use, gear also reads gear.specsubst.* configuration options from git-config(1) for each variable listed in the specsubst: directive.

BUGS

gear does not get correct package name, version and release from spec files which use RPM macros to define these fields.

ENVIRONMENT

GIT_DIR
If the GIT_DIR environment variable is set then it specifies a path to use instead of the default for the base of the repository.

AUTHOR

Written by Dmitry V. Levin <ldv@altlinux.org>

REPORTING BUGS

Report bugs to https://bugzilla.altlinux.org/

COPYRIGHT

Copyright © 2006-2021 Dmitry V. Levin <ldv@altlinux.org>
Copyright © 2006-2008 Alexey I. Froloff <raorn@altlinux.org>
Copyright © 2006-2021 Alexey Gladkov <legion@altlinux.org>
Copyright © 2006-2007 Sergey Vlasov <vsu@altlinux.org>
Copyright © 2006 Fr. Br. George <george@altlinux.org>
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

SEE ALSO

gear-rules(5), gear-commit(1), gear-srpmimport(1), gear-store-tags(1), gear-update(1), hsh(1), git(7), git-config(1), rpmbuild(8).

November 2022 gear 2.6.0