; for example for Fedora 38: git clone -b f38 --single-branch https://github.com/rpmfusion/vcmi.git
3. Copy all files to ~/rpmbuild/SPECS with command: cp vcmi/* ~/rpmbuild/SPECS
4. Fetch all sources by using spectool:
```sh
sudo dnf install rpmdevtools
spectool -g -R ~/rpmbuild/SPECS/vcmi.spec
```
5. Fetch all dependencies required to build the RPM:
```sh
sudo dnf install dnf-plugins-core
sudo dnf builddep ~/rpmbuild/SPECS/vcmi.spec
```
6. Go to ~/rpmbuild/SPECS and open terminal in this folder and type:
```sh
rpmbuild -ba ~/rpmbuild/SPECS/vcmi.spec
```
7. Generated RPM is in folder ~/rpmbuild/RPMS
If you want to package the generated RPM above for different processor architectures and operating systems you can use the tool mock.
Moreover, it is necessary to install mock-rpmfusion_free due to the packages ffmpeg-devel and ffmpeg-libs which aren't available in the standard RPM repositories(at least for Fedora). Go to ~/rpmbuild/SRPMS in terminal and type:
```sh
mock -r fedora-38-aarch64-rpmfusion_free path_to_source_RPM
mock -r fedora-38-x86_64-rpmfusion_free path_to_source_RPM
```
For other distributions that uses RPM, chances are there might be a spec file for VCMI. If there isn't, you can adapt the RPMFusion's file
Available root environments and their names are listed in /etc/mock.
### Debian/Ubuntu
1. Install debhelper and devscripts packages
2. Run dpkg-buildpackage command from vcmi source directory
```sh
sudo apt-get install debhelper devscripts
cd /path/to/source
dpkg-buildpackage
```
To generate packages for different architectures see "-a" flag of dpkg-buildpackage command