# Build RPM

## Installation dependency package

```
# Install rpm-build
[root@ip] yum install -y rpm-build

# Install git
[root@ip] yum install -y git
```

## Create build directory

```
[root@ip] cd ~
[root@ip] rpmbuild tiops # 执行该命令的报错可以忽略，目的是生成 rpmbuild 及其子目录
```

## Setting configuration
1. git clone tiops and put it into `~/rpmbuild/SOURCES/` directory.
2. Put the `tiops.spec` file that in `scripts/rpmbuild` directory into the `~/rpmbuild/SPECS` directory.
3. Modify the `Version` in `tiops.spec`.

## Start build RPM package

```
[root@ip] cd ~/rpmbuild
[root@ip] rpmbuild -bb SPECS/tiops.spec
```

## Get RPM package
After the build is complete, you can get the rpm package in the `~/rpmbuild/RPMS` directory.
