To use the meshcommander.spec
file to build a RPM package, you need:
A RPM based distro. I am using Fedora 30 here. If using an older version of Fedora or an Enterprise Linux (clone) older than 8, substitute dnf
with yum
.
The spec file from the project's Download section.
Create a user for RPM packaging, I will name it build
here. It is strongly recommended to not use root
for package building.
sudo adduser build
Install rpm-build
and rpmdevtools
. rpm-build
is required to build RPM packages, rpmdevtools
contains the tools we use later to create the RPM build tree and to automatically download sources.
sudo dnf install rpm-build rpmdevtools
Install the spec file's build dependencies; unzip
and msitools
. unzip
is required to unpack the icon pack. msitools
is required to extract the files from the MeshCommander.msi
.
sudo dnf install unzip msitools
Switch to the build
user.
sudo su - build
Create a rpmbuild
directory tree in the build
user's home directory using rpmdev-setuptree
.
rpmdev-setuptree
Copy the meshcommander.spec
file in the build user's home directory. You may want to make it writable to be able to edit it in the future. (The usual place for spec files would be ~/rpmbuild/SPECS
, but placing it in ~
works, too, and is maybe easier to maintain.)
After you have set up your RPM build environment as described above, you may start building RPM packages:
Edit meshcommander.spec
to match MeshCommander's current version.
Run spectool
to automatically download both the MeshCommander.msi
and the NW.js binary tarball.
spectool -g -f -R meshcommander.spec
The -g
flag tells spectool to download the source files, -f
tells it to force downloading (this is required as MeshCommander.msi
does not contain a version number, thus needs to be replaced even if it already exists), -R
makes spectool place the downloaded files in ~/rpmbuild/SOURCES
, where rpmbuild
expects to find them.
Build the MeshCommander RPM package.
rpmbuild -bb meshcommander.spec
-bb
is build binary. Alternatively you may want to use -ba
instead to have rpmbuild
also build a source RPM file, which contains the specfile and the downloaded source files and may be used to build RPMs using rpmbuild --rebuild
.
The new RPM package file is placed in ~/rpmbuild/RPMS/x86_64
. If your system is a desktop installation, you may now install it:
sudo dnf install /home/build/rpmbuild/RPMS/x86_64/meshcommander-0.9.0-1.x86_64.rpm
The version and release number may vary, use the ones from the spec file.