Build rpm with Jenkins project

Here is how I build rpm files in Jenkins.


Add a Fedora node to the cluster. I am running Jenkins on Devuan, which obviously is not ideal for building rpms.
I added a few labels, which are space-delimited which I found unusual. But whatever. I used a service account, and set up an ssh key for passwordless authentication.
Configuring a Jenkins node, with name fc30x-01a and a remote directory and ssh setup.
Add a user and grant them some specific sudo permissions:

useradd jenkins

cat <<EOF >/etc/sudoers.d/70_jenkins
User_Alias JENKINS = jenkins
Defaults:JENKINS !requiretty
JENKINS fc30x-01a=(root)	NOPASSWD: /usr/bin/dnf -y builddep *

Install some build tools:

sudo dnf -y install rpm-build rpmdevtools

My rpmbuild workflow in Jenkins

Add a new project. Restrict it to run on label “fedora.”
Project configuration showing restrict where project is run, to label "fedora"
Like last time, I am checking out my git repo to a local subdirectory.
Screenshot of project configuration showing SCM, and additional behavior of "Check out to a sub-directory"
All the build steps for this project are shell commands.
The first command uses some tooling I learned about for this project: spectool. The dnf installs the build dependencies, and spectool downloads all the source files that are not already present in the directory.

pwd ; ls -altr ; mkdir -p rpmbuild ; cd rpmbuild ;
cp -p ../work/veracrypt/* . || :;
sudo dnf -y builddep *.spec ;
spectool -g *.spec ;

The actual build command happens in the second step. I am using a few macro definitions to keep everything happening in the present working directory.

cd rpmbuild ; rpmbuild --define "_topdir %(pwd)" --define "_builddir %{_topdir}" --define "_rpmdir %{_topdir}" --define "_sourcedir %{_topdir}" --define "_srcrpmdir %{_topdir}" --define "_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" -ba *.spec

And the final step deploys the files to my nfs share for manual curation.

mkdir -p /mnt/public/Public/${JOB_NAME} ;
cp -p *.rpm */*.rpm /mnt/public/Public/${JOB_NAME}/ || :



  1. fedora – Automatically install build dependencies prior to building an RPM package – Stack Overflow
  2. rpm – How do I get rpmbuild to download all of the sources for a particular .spec? – Stack Overflow
  3. Rpmdevtools – Fedora Project Wiki
  4. Build RPMs using Jenkins/Hudson

How I use the COPR to build and host rpms for CentOS and Fedora


For about a year now, I have been using the Fedora Project’s public Cool Other Packages Repository (copr) to build and host rpms for my Fedora and CentOS GNU/Linux installations.
This post documents the process I use to take an upstream package, build the packages for the different chroots, and host them for download.

The process

No local tools are required, other than the source control software, normally git.

Select the upstream package

My example will use FreeFileSync, which is a great program and it’s quick to compile.
Additionally, because the upstream provides only a zip file, I am using my collaborative Opensource Tracking repo for the tarball which dpkg seemed to require and I gave up investigating how to get it to use a zip file as a source.

Prepare the spec file and additional artifacts

My spec file, patches, and additional items for building FreeFileSync on Fedora are on my gitlab page. This topic today is not intended to show you how to use rpmbuild, which is a deep and useful topic.

Add a package to copr

With the rpm sources available on the Internet, we’re ready to work in the copr environment.

Create a project

A project can host a single package or many. Also useful to note, that a spec file can produce more than one rpm. So for the copr, a “package” can include either a single rpm artifact or multiple. For example, a libssl.spec will probably produce a libssl-devel, libssl, and libss-docs rpms. You would only have to set up the libssl.spec, and any produced rpms will just be handled automatically.
So, on the main page of COPR, select “New Project.”

Name the project and include any long-form text you care to share. The build options, farther down the page, are important. You can always change these options later, so don’t feel that you have to be extremely careful right now. Select the chroot arch environments you want to build the rpms for.

The external repositories section is really nice. If you need the packages from your favorite Internet yum repo, you can paste the baseurl values here.

Create a new package

In your shiny new project, you will want to add some packages!
Select the Packages tab, and then “New package.”

Plug in the relevant information.
For FreeFileSync, my rpmbuild input artifacts are at, with a committish (I love that term!) of “freefilesync-bump” which is the dev tree I use for testing the latest version of FreeFileSync.
The subdir for just the freefilesync package, in my entire git tree, is freefilesync/. I’ve got a lot of other spec files in there, but the copr can look in just one dir, which is pretty great.
Use the “rpkg” option, based on the git source. I don’t actually know how the other methods work, and the rpkg has always been good enough for git-hosted spec files for me.

If the package needs to be excluded from certain architectures, there’s a blacklist field you can use.
Save the package settings.

Trigger a build

On the package list, find the new package and select “Rebuild.”

You can choose which chroots to use, and the checkboxes are pre-populated with your defaults and blacklist. My freefilesync package has some unresolvable build dependencies on EL6, so I have excluded those.

Also, specifically, FreeFileSync needed some very custom dependencies co build on EL7– some higher versions of libs like curl and openssl, so it’s a complex dependency tree so either include copr://bgstack15/FreeFileSync in your project’s external repository list.

Use virt-install to fully automate the install for CentOS/Fedora with kickstart

Here is my kickstart file for CentOS 7. I deploy VMs into my kvm environment with a oneliner, using this kickstart file.

How I use this

I define a variable, and plug it into the important parts.

vm=c7-04a ; time sudo virt-install -n "${vm}" --memory 2048 \
   --vcpus=1 --os-variant=centos7.0 --accelerate -v \
   --disk path=/var/lib/libvirt/images/"${vm}".qcow2,size=20 \
   -l /mnt/public/Support/SetupsBig/Linux/CentOS-7-x86_64-Minimal-1810.iso \
   --initrd-inject=/mnt/public/Support/Platforms/CentOS7/centos7-ks.cfg \
   --extra-args "ks=file:/centos7-ks.cfg SERVERNAME=${vm}" \
   --debug --network type=bridge,source=br0 --noautoconsole

Some thoughts

I had to download the 1810 release of the iso, because there was something wrong with the repos or perhaps files in the previous isos, with how they interacted with either the virtual environment or the network or something. But the CentOS-7-x86_64-minimal-1810.iso was important.
I found the SERVERNAME trick on the Internet. You can iterate over /proc/cmdline and react to values you find there, in the %pre or %post scripts.
You will see that I use my own local repositories for the regular CentOS repos, and I add my own internal one (smith122/repo/rpm). Obviously you should find a suitable set of repos for your own.
You will also see that I attempt to download my CA certificates at various points. I’m pretty sure the %pre effort fails, because the system is not on the network yet.


The kickstart file

# File: /mnt/public/Support/Platforms/CentOS7/centos7-ks.cfg
# Locations:
#    /mnt/public/Support/Platforms/CentOS7/centos7-ks.cfg
# Author: bgstack15
# Startdate: 2017-06-02
# Title: Kickstart for CentOS 7 for
# Purpose: To provide an easy installation for VMs and other systems in the Mersey network
# History:
#    2017-06 I learned how to use kickstart files for the RHCSA EX-200 exam
#    2017-08-08 Added notifyemail to --extra-args
#    2017-10-29 major revision to use local repository
# Usage with virt-install:
#    vm=c7-04a ; time sudo virt-install -n "${vm}" --memory 2048 --vcpus=1 --os-variant=centos7.0 --accelerate -v --disk path=/var/lib/libvirt/images/"${vm}".qcow2,size=20 -l /mnt/public/Support/SetupsBig/Linux/CentOS-7-x86_64-Minimal-1810.iso --initrd-inject=/mnt/public/Support/Platforms/CentOS7/centos7-ks.cfg --extra-args "ks=file:/centos7-ks.cfg SERVERNAME=${vm}" --debug --network type=bridge,source=br0 --noautoconsole
#    vm=c7-04a; sudo virsh destroy "${vm}"; sudo virsh undefine --remove-all-storage "${vm}";
# Reference:
#    /mnt/public/Support/Platforms/CentOS7/install-vm.txt

#platform=x86, AMD64, or Intel EM64T
# Install OS instead of upgrade
# Keyboard layouts
keyboard 'us'
# Root password
rootpw --plaintext SOMETHINGSTRONGHERE
# my user
user --groups=wheel --name=bgstack15-local --password=$6$.gh0u7vg2HDPJPX/$g4Y1l.q76fs7i0UK8t6h83bDIo2YnGGj/1DGeUzzbMTd0pBh4of6jNYWxxws/937sUiPgETqPsYFI5XNrkAle. --iscrypted --gecos="bgstack15-local"

# System language
lang en_US.UTF-8
# Firewall configuration
firewall --enabled --ssh
# Reboot after installation
# Network information
#attempting to put it in the included ks file that accepts hostname from the virsh command.
#network  --bootproto=dhcp --device=eth0 --ipv6=auto --activate
%include /tmp/network.ks
# System timezone
timezone America/New_York --utc
# System authorization information
auth  --useshadow  --passalgo=sha512
# Use network installation instead of CDROM installation media
url --url=""

# Use text mode install
# SELinux configuration
selinux --enforcing
# Do not configure the X Window System

# Use all local repositories
# Online repos
repo --name=smith122rpm --baseurl=
repo --name=base --baseurl=$releasever/os/$basearch/
repo --name=updates --baseurl=$releasever/updates/$basearch/
repo --name=extras --baseurl=$releasever/extras/$basearch/
repo --name=epel --baseurl=$releasever/$basearch

# Offline repos

firstboot --disabled

# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
autopart --type=lvm

echo "network  --bootproto=dhcp --device=eth0 --ipv6=auto --activate --hostname" > /tmp/network.ks
for x in $( cat /proc/cmdline );
   case $x in
         eval $x
         echo "network  --bootproto=dhcp --device=eth0 --ipv6=auto --activate --hostname ${SERVERNAME}" > /tmp/network.ks
         eval $x
         echo "${NOTIFYEMAIL}" > /mnt/sysroot/root/notifyemail.txt
cp -p /run/install/repo/ /etc/pki/ca-trust/source/anchors/ 2>/dev/null || :
wget -O /etc/pki/ca-trust/source/anchors/ || :
update-ca-trust || :

   # Set temporary hostname
   #hostnamectl set-hostname;

   # Get local mirror root ca certificate
   wget -O /etc/pki/ca-trust/source/anchors/ && update-ca-trust

   # Get local mirror repositories
   wget -O /etc/yum.repos.d/smith122rpm.repo;
   wget -O /etc/yum.repos.d/smith122rpm.mirrorlist
   distro=centos7 ; wget${distro}.repo -O /etc/yum.repos.d/smith122-bundle-${distro}.repo && grep -oP "(? /boot/grub2/grub.cfg

   # postfix is already started by default on centos7
   # Send IP address to myself
   thisip="$( ifconfig 2>/dev/null | awk '/Bcast|broadcast/{print $2}' | tr -cd '[^0-9\.\n]' | head -n1 )"
      echo "${SERVER} has IP ${thisip}."
      echo "system finished kickstart at $( date "+%Y-%m-%d %T" )";
   } | /usr/share/bgscripts/ -f "root@$( hostname --fqdn )" \
      -h -s "${SERVER} is ${thisip}" $( cat /root/notifyemail.txt 2>/dev/null )

   # No changes to graphical boot

   # fix the mkhomedir problem
   systemctl enable oddjobd.service && systemctl start oddjobd.service

   # Personal customizations
   mkdir -p /mnt/bgstack15 /mnt/public
   su bgstack15-local -c "sudo /usr/share/bgconf/"

) >> /root/install.log 2>&1


Notes for Yum repositories for CentOS and Fedora

This is my scratch page for third-party centos and fedora repositories that are useful. I’ve used these at least once in my personal experience. There’s obviously a lot more, and they’re only an internet search away.


Lists of additional ones:

Sites for “rpm find”:

Fedora and scanners

If you are running Fedora and you want to use a scanner, you probably already have sane (backends at least) and simple-scan installed.

What is incredibly frustrating is when scanimage -L shows you the scanner, but simple-scan does not list it.

What you are missing is

sudo dnf install libnsl

This package is different from libnsl2, which is probably already installed. But some applications must depend on libnsl, including simple-scan. Thanks to suspiciousmilk of Ask Fedora.



  1. Brother scanner driver don’t work []

Lightdm crashes after dnf update

For a few months this year, running “dnf update” caused my display manager to malfunction. It it a terribly annoying problem. In the past, once, my /usr/bin/X was not installed. I don’t know how that happened.

This time, lightdm was not starting due to some error message which is only visible if you turn on logging/debugging and go find the right log.

lightdm gtk:error:gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed

Thankfully, the issue was researchable online although it did take a while and I bounced around different distros’ fora to get to the answer.
For Fedora, the answer simply was:

sudo dnf -y reinstall shared-mime-info


Web searches

  1. Google: fedora lightdm gtk:error:gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed

Web links

  3. points to the next two links
  4. what actually solved it
  5. same kind of error

Compile Pale Moon 28 on Fedora 27


Pale Moon 28 was released on August 16, 2018. I package it myself on Fedora because I don’t see it in the fedora repositories, and plus I like the experience of assembling packages myself. For a basic compile (not in an rpm), you can follow these instructions.

Install dependencies

Install the whole set of packages listed on the Pale Moon site (reference 2) or CentOS7

sudo dnf -y install gtk2-devel dbus-glib-devel autoconf213 yasm mesa-libGL-devel alsa-lib-devel libXt-devel zlib-devel openssl-devel sqlite-devel bzip2-devel pulseaudio-libs-devel
sudo dnf -y groupinstall 'Development Tools'

Install the dependencies I found.

sudo dnf -y install GConf2-devel notification-daemon

Use autoconf 2.13

Pale Moon depends on autoconf 2.13. Thankfully, it’s in the Fedora repos, but changing the main autoconf link to point to this specific version will save a bunch of headache later. Be aware that this step exactly as shown will change your system’s default autoconf. I’m sure this is a crude way to do it, but aren’t build systems throwaway systems nowadays?

autoconfver="$( autoconf --version 2>/dev/null | awk 'NR==1 {print $NF*100;} END {print "0";}' | head -n1 )"
test ${autoconfver} -ne 213 &&amp test ${autoconfver} -gt 0 && sudo mv /usr/bin/autoconf /usr/bin/autoconf-${autoconver} 2>/dev/null ; sudo ln -sf autoconf-2.13 /usr/bin/autoconf

Fetch source

Pale Moon likes to compile in ~/pmsrc. Don’t change it. It just makes it easier.

mkdir ~/pmsrc ~/pmbuild
cd ~/pmsrc
git clone .

Prepare to compile

Use the recommended .mozconfig from the Pale Moon site (reference 2)

touch "${tf}"
cat <<'EOFMOZCONFIG' > "${tf}"
mk_add_options AUTOCLOBBER=1
mk_add_options MOZ_OBJDIR=/home/$USER/pmbuild/
ac_add_options --enable-application=palemoon
ac_add_options --enable-optimize="-O2"
# Please see for restrictions when using the official branding.
ac_add_options --enable-official-branding
ac_add_options --enable-default-toolkit=cairo-gtk2
ac_add_options --enable-jemalloc
ac_add_options --enable-strip
ac_add_options --with-pthreads
ac_add_options --disable-tests
ac_add_options --disable-eme
ac_add_options --disable-parental-controls
ac_add_options --disable-accessibility
ac_add_options --disable-webrtc
ac_add_options --disable-gamepad
ac_add_options --disable-necko-wifi
ac_add_options --disable-updater
ac_add_options --x-libraries=/usr/lib


These instructions include saving the output to a log file, but that’s not necessary.

mkdir ~/log
cd ~/pmsrc
{ time ./mach build && time ./mach package ; } | tee -a ~/log/pmsrc.$( date "+%F-%H%M%S" ).log
echo done



  3. Compiling Pale Moon web browser on Fedora (published 2018-02-09)

Compile FreeFileSync 10.1 on Fedora

How to compile FreeFileSync 10.1 on Fedora

Tested on Fedora 28

1. Install build dependencies.

dnf install -y boost-devel compat-wxGTK3-gtk2-devel gcc-c++ gtk+-devel gtk3-devel wxGTK-devel wxGTK3-devel

2. Fetch and extract source

wget --user-agent 'Firefox 60.0 (GNU/Linux) X11' -L
mkdir 10.1
pushd 10.1; unzip ../; popd

3. Prepare patch required to compile on Fedora.

cat <<'EOF' > "${pfile}"
diff -x '*.orig' -x '*.rej' -Naur 10.1/FreeFileSync/Source/Makefile 10.1-0/FreeFileSync/Source/Makefile
--- 10.1/FreeFileSync/Source/Makefile	2018-06-03 04:27:00.000000000 -0400
+++ 10.1-0/FreeFileSync/Source/Makefile	2018-06-07 22:44:44.919899060 -0400
@@ -5,15 +5,15 @@
-CXXFLAGS  = -std=c++17 -pipe -DWXINTL_NO_GETTEXT_MACRO -I../.. -I../../zenXml -isystem../../boost -include "zen/i18n.h" -include "zen/warn_static.h" \
+CXXFLAGS  = -std=c++17 -pipe -DWXINTL_NO_GETTEXT_MACRO -I../.. -I../../zenXml -isystem/usr/include/boost -include "zen/i18n.h" -include "zen/warn_static.h" \
 -Wall -Wfatal-errors -Wmissing-include-dirs -Wswitch-enum -Wcast-align -Wshadow -Wnon-virtual-dtor \
 -O3 -DNDEBUG `wx-config --cxxflags --debug=no` -pthread
-LINKFLAGS = -s -no-pie `wx-config --libs std, aui --debug=no` -pthread
+LINKFLAGS = -s -no-pie `wx-config --libs std, aui --debug=no` -lz -pthread
 #Gtk - support recycler/icon loading/no button border/grid scrolling
-CXXFLAGS  += `pkg-config --cflags gtk+-2.0`
-LINKFLAGS += `pkg-config --libs   gtk+-2.0`
+CXXFLAGS  += `pkg-config --cflags gtk+-3.0`
+LINKFLAGS += `pkg-config --libs   gtk+-3.0`
 #support for SELinux (optional)
 SELINUX_EXISTING=$(shell pkg-config --exists libselinux && echo YES)
@@ -125,5 +125,5 @@
 	mkdir -p $(DOCSHAREDIR)
-	cp ../Build/Changelog.txt $(DOCSHAREDIR)/changelog
+	cp ../../Changelog.txt $(DOCSHAREDIR)/changelog
 	gzip $(DOCSHAREDIR)/changelog
diff -x '*.orig' -x '*.rej' -Naur 10.1/FreeFileSync/Source/RealTimeSync/Makefile 10.1-0/FreeFileSync/Source/RealTimeSync/Makefile
--- 10.1/FreeFileSync/Source/RealTimeSync/Makefile	2018-06-03 04:27:00.000000000 -0400
+++ 10.1-0/FreeFileSync/Source/RealTimeSync/Makefile	2018-06-07 22:20:59.043383931 -0400
@@ -6,11 +6,11 @@
 -Wall -Wfatal-errors -Wmissing-include-dirs -Wswitch-enum -Wcast-align -Wshadow -Wnon-virtual-dtor \
 -O3 -DNDEBUG `wx-config --cxxflags --debug=no` -pthread
-LINKFLAGS = -s -no-pie `wx-config --libs std, aui --debug=no` -pthread
+LINKFLAGS = -s -no-pie `wx-config --libs std, aui --debug=no` -lz -pthread
 #Gtk - support "no button border"
-CXXFLAGS  += `pkg-config --cflags gtk+-2.0`
-LINKFLAGS += `pkg-config --libs   gtk+-2.0`
+CXXFLAGS  += `pkg-config --cflags gtk+-3.0`
+LINKFLAGS += `pkg-config --libs   gtk+-3.0`
diff -x '*.orig' -x '*.rej' -Naur 10.1/FreeFileSync/Source/ui/main_dlg.cpp 10.1-0/FreeFileSync/Source/ui/main_dlg.cpp
--- 10.1/FreeFileSync/Source/ui/main_dlg.cpp	2018-06-03 04:27:02.000000000 -0400
+++ 10.1-0/FreeFileSync/Source/ui/main_dlg.cpp	2018-06-07 22:25:32.856972097 -0400
@@ -11,6 +11,7 @@
 #include <zen/thread.h>
 #include <zen/shell_execute.h>
 #include <zen/perf.h>
+/* #include <zen/warn_static.h>  REMOVED FOR TESTING. Add back on any failures. */
 #include <wx/clipbrd.h>
 #include <wx/wupdlock.h>
 #include <wx/sound.h>
@@ -4844,7 +4845,7 @@
         globalCfg_.gui.lastUpdateCheck = 0; //reset to GlobalSettings.xml default value!
+    /*
     if (shouldRunAutomaticUpdateCheck(globalCfg_.gui.lastUpdateCheck))
         flashStatusInformation(_("Searching for program updates..."));
@@ -4852,6 +4853,7 @@
         automaticUpdateCheckEval(this, globalCfg_.gui.lastUpdateCheck, globalCfg_.gui.lastOnlineVersion,
+    */
@@ -4859,7 +4861,7 @@
     //execute just once per startup!
     Disconnect(wxEVT_IDLE, wxIdleEventHandler(MainDialog::OnRegularUpdateCheck), nullptr, this);
+    /*
     if (shouldRunAutomaticUpdateCheck(globalCfg_.gui.lastUpdateCheck))
         flashStatusInformation(_("Searching for program updates..."));
@@ -4873,6 +4875,7 @@
                                      resultAsync.get()); //run on main thread:
+    */
diff -x '*.orig' -x '*.rej' -Naur 10.1/FreeFileSync/Source/ui/small_dlgs.cpp 10.1-0/FreeFileSync/Source/ui/small_dlgs.cpp
--- 10.1/FreeFileSync/Source/ui/small_dlgs.cpp	2018-06-03 04:27:02.000000000 -0400
+++ 10.1-0/FreeFileSync/Source/ui/small_dlgs.cpp	2018-06-07 22:20:59.050384125 -0400
@@ -970,7 +970,8 @@
-    m_textCtrlOfflineActivationKey->ForceUpper();
+    // Fedora 27 does not have wxWidgets 3.1.1 yet.
+    //m_textCtrlOfflineActivationKey->ForceUpper();
     m_textCtrlLastError           ->ChangeValue(lastErrorMsg);
     m_textCtrlManualActivationUrl ->ChangeValue(manualActivationUrl);
diff -x '*.orig' -x '*.rej' -Naur 10.1/FreeFileSync/Source/ui/version_check_impl.h 10.1-0/FreeFileSync/Source/ui/version_check_impl.h
--- 10.1/FreeFileSync/Source/ui/version_check_impl.h	2018-06-03 04:27:02.000000000 -0400
+++ 10.1-0/FreeFileSync/Source/ui/version_check_impl.h	2018-06-07 22:20:59.051384152 -0400
@@ -14,7 +14,7 @@
 namespace fff
 time_t getVersionCheckInactiveId()
     //use current version to calculate a changing number for the inactive state near UTC begin, in order to always check for updates after installing a new version
@@ -38,7 +38,6 @@
 time_t getVersionCheckCurrentTime()
     return std::time(nullptr);
diff -x '*.orig' -x '*.rej' -Naur 10.1/wx+/grid.cpp 10.1-0/wx+/grid.cpp
--- 10.1/wx+/grid.cpp	2018-06-03 04:27:02.000000000 -0400
+++ 10.1-0/wx+/grid.cpp	2018-06-07 22:30:02.202436428 -0400
@@ -1169,7 +1169,9 @@
                 if (overlapPix != 0)
-                    const double scrollSpeed = wnd_.ToDIP(overlapPix) * mouseDragSpeedIncScrollU; //unit: [scroll units / sec]
+                    // Fedora 28 does not have wxGTK 3.1.1 yet. This probably breaks HiDPI usage
+                    //const double scrollSpeed = wnd_.ToDIP(overlapPix) * mouseDragSpeedIncScrollU; //unit: [scroll units / sec]
+                    const double scrollSpeed = overlapPix * mouseDragSpeedIncScrollU; //unit: [scroll units / sec]
                     toScroll += scrollSpeed * deltaSecs;

A summary of what this patch does:

  • Ensure using the system boost library. It appears the source looks for a locally-bundled boost lib, which was not included with the 10.1 code.
  • Link to zlib because previous versions use to, and without I could not compile.
  • Compile against gtk+3 instead of gtk+2 because I could not get it to compile against gtk2.
  • Place the changelog text file where the Makefile expects.
  • Disable the check for updates and lines related to activation, particularly a few based on a newer version of wxWidgets which Fedora 28 does not have yet (wxWidgets 3.1.1).
  • Revert to an older version of the scrollSpeed calculation because wxWidgets 3.1.1 is not in Fedora yet.

4. Apply patch

cd 10.1
patch -p1 < ../FreeFileSync-10.1-1.fc28.patch

5. Compile and install

cd FreeFileSync/Source
make && sudo make install

Next steps

Build an rpm for FreeFileSync (gitlab)



  1. How-to: Build 10.* from Source (Linux Mint) (FreeFileSync forum)
  2. Compiling FreeFileSync 10.0 on Fedora (this blog)
  3. Compiling FreeFileSync on Fedora (this blog)
  4. AUR (en) – freefilesync

Compiling FreeFileSync 10.0 on Fedora

When compiling the latest release of FreeFileSync, I came across this error (after applying my basic Fedora patches):

cc1plus: warning: ../../boost: No such file or directory [-Wmissing-include-dirs]
g++ -o ../Build/FreeFileSync ../Obj/FFS_GCC_Make_Release/ffs/src/algorithm.o ../Obj/FFS_GCC_Make_Release/ffs/src/application.o ../Obj/FFS_GCC_Make_Release/ffs/src/comparison.o ../Obj/FFS_GCC_Make_Release/ffs/src/structures.o ../Obj/FFS_GCC_Make_Release/ffs/src/synchronization.o ../Obj/FFS_GCC_Make_Release/ffs/src/fs/abstract.o ../Obj/FFS_GCC_Make_Release/ffs/src/fs/concrete.o ../Obj/FFS_GCC_Make_Release/ffs/src/fs/native.o ../Obj/FFS_GCC_Make_Release/ffs/src/file_hierarchy.o ../Obj/FFS_GCC_Make_Release/ffs/src/ui/batch_config.o ../Obj/FFS_GCC_Make_Release/ffs/src/ui/batch_status_handler.o ../Obj/FFS_GCC_Make_Release/ffs/src/ui/cfg_grid.o ../Obj/FFS_GCC_Make_Release/ffs/src/ui/command_box.o ../Obj/FFS_GCC_Make_Release/ffs/src/ui/folder_history_box.o ../Obj/FFS_GCC_Make_Release/ffs/src/ui/folder_selector.o ../Obj/FFS_GCC_Make_Release/ffs/src/ui/file_grid.o ../Obj/FFS_GCC_Make_Release/ffs/src/ui/file_view.o ../Obj/FFS_GCC_Make_Release/ffs/src/ui/tree_grid.o ../Obj/FFS_GCC_Make_Release/ffs/src/ui/gui_generated.o ../Obj/FFS_GCC_Make_Release/ffs/src/ui/gui_status_handler.o ../Obj/FFS_GCC_Make_Release/ffs/src/ui/main_dlg.o ../Obj/FFS_GCC_Make_Release/ffs/src/ui/progress_indicator.o ../Obj/FFS_GCC_Make_Release/ffs/src/ui/search.o ../Obj/FFS_GCC_Make_Release/ffs/src/ui/small_dlgs.o ../Obj/FFS_GCC_Make_Release/ffs/src/ui/sync_cfg.o ../Obj/FFS_GCC_Make_Release/ffs/src/ui/taskbar.o ../Obj/FFS_GCC_Make_Release/ffs/src/ui/tray_icon.o ../Obj/FFS_GCC_Make_Release/ffs/src/ui/triple_splitter.o ../Obj/FFS_GCC_Make_Release/ffs/src/ui/version_check.o ../Obj/FFS_GCC_Make_Release/ffs/src/lib/binary.o ../Obj/FFS_GCC_Make_Release/ffs/src/lib/db_file.o ../Obj/FFS_GCC_Make_Release/ffs/src/lib/dir_lock.o ../Obj/FFS_GCC_Make_Release/ffs/src/lib/ffs_paths.o ../Obj/FFS_GCC_Make_Release/ffs/src/lib/generate_logfile.o ../Obj/FFS_GCC_Make_Release/ffs/src/lib/hard_filter.o ../Obj/FFS_GCC_Make_Release/ffs/src/lib/icon_buffer.o ../Obj/FFS_GCC_Make_Release/ffs/src/lib/icon_loader.o ../Obj/FFS_GCC_Make_Release/ffs/src/lib/localization.o ../Obj/FFS_GCC_Make_Release/ffs/src/lib/parallel_scan.o ../Obj/FFS_GCC_Make_Release/ffs/src/lib/process_xml.o ../Obj/FFS_GCC_Make_Release/ffs/src/lib/resolve_path.o ../Obj/FFS_GCC_Make_Release/ffs/src/lib/perf_check.o ../Obj/FFS_GCC_Make_Release/ffs/src/lib/status_handler.o ../Obj/FFS_GCC_Make_Release/ffs/src/lib/versioning.o ../Obj/FFS_GCC_Make_Release/ffs/src/../../zen/xml_io.o ../Obj/FFS_GCC_Make_Release/ffs/src/../../zen/recycler.o ../Obj/FFS_GCC_Make_Release/ffs/src/../../zen/file_access.o ../Obj/FFS_GCC_Make_Release/ffs/src/../../zen/file_io.o ../Obj/FFS_GCC_Make_Release/ffs/src/../../zen/file_traverser.o ../Obj/FFS_GCC_Make_Release/ffs/src/../../zen/zstring.o ../Obj/FFS_GCC_Make_Release/ffs/src/../../zen/format_unit.o ../Obj/FFS_GCC_Make_Release/ffs/src/../../zen/process_priority.o ../Obj/FFS_GCC_Make_Release/ffs/src/../../zen/shutdown.o ../Obj/FFS_GCC_Make_Release/ffs/src/../../wx+/file_drop.o ../Obj/FFS_GCC_Make_Release/ffs/src/../../wx+/grid.o ../Obj/FFS_GCC_Make_Release/ffs/src/../../wx+/image_tools.o ../Obj/FFS_GCC_Make_Release/ffs/src/../../wx+/graph.o ../Obj/FFS_GCC_Make_Release/ffs/src/../../wx+/http.o ../Obj/FFS_GCC_Make_Release/ffs/src/../../wx+/tooltip.o ../Obj/FFS_GCC_Make_Release/ffs/src/../../wx+/image_resources.o ../Obj/FFS_GCC_Make_Release/ffs/src/../../wx+/popup_dlg.o ../Obj/FFS_GCC_Make_Release/ffs/src/../../wx+/popup_dlg_generated.o ../Obj/FFS_GCC_Make_Release/ffs/src/../../wx+/zlib_wrap.o ../Obj/FFS_GCC_Make_Release/ffs/src/../../xBRZ/src/xbrz.o -s -no-pie `wx-config --libs std, aui --debug=no` -pthread `pkg-config --libs   gtk+-3.0` `pkg-config --libs libselinux`
/usr/bin/ld: ../Obj/FFS_GCC_Make_Release/ffs/src/../../wx+/zlib_wrap.o: undefined reference to symbol 'compressBound@@ZLIB_1.2.0'
//usr/lib64/ error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:103: ../Build/FreeFileSync] Error 1

After some Internet searches, I found the answer!

All you have to do is fix the linking to include the -lz flag. In fact, previous versions of the software included the -lz flag in the makefile. It was probably removed as an oversight, but it compiled and operated on Fedora GNU/Linux once I added back in the linking flag. I guess omitting the z library prevents the binary from building successfully! Who’da thunk it?

Here is the diff:

--- 10.0-0/FreeFileSync/Source/Makefile	2018-04-26 16:57:13.000000000 -0400
+++ 10.0-1/FreeFileSync/Source/Makefile	2018-05-01 07:13:57.430369158 -0400
@@ -9,11 +9,11 @@
 -Wall -Wfatal-errors  -Winit-self -Wmissing-include-dirs -Wswitch-enum -Wmain -Wnon-virtual-dtor -Wcast-align -Wshadow -Wno-deprecated-declarations \
 -O3 -DNDEBUG `wx-config --cxxflags --debug=no` -pthread
-LINKFLAGS = -s -no-pie `wx-config --libs std, aui --debug=no` -pthread
+LINKFLAGS = -s -no-pie `wx-config --libs std, aui --debug=no` -lz -pthread
 #Gtk - support recycler/icon loading/no button border/grid scrolling
-CXXFLAGS  += `pkg-config --cflags gtk+-2.0`
-LINKFLAGS += `pkg-config --libs   gtk+-2.0`
+CXXFLAGS  += `pkg-config --cflags gtk+-3.0`
+LINKFLAGS += `pkg-config --libs   gtk+-3.0`
 #support for SELinux (optional)
 SELINUX_EXISTING=$(shell pkg-config --exists libselinux && echo YES)



  2. Discussion about linking to a lib in general

Fedora remove duplicate packages from partially-completed dnf update

On my Fedora 27 systems, my system froze up when I was updating all the packages (I suspect I’m having hardware problems).

My system did reboot just fine, but not all ancillary services came up. During my troubleshooting, I discovered that there were multiple versions of packages installed for hundreds of packages.

After some brief Internet searches, I found my solution:

sudo dnf remove --duplicates

Output will resemble:

Last metadata expiration check: 1:14:37 ago on Sat 31 Mar 2018 09:52:43 PM EDT.
Dependencies resolved.
 Package                       Arch   Version            Repository        Size
 ImageMagick                   x86_64 1:  updates-smith122 186 k
     replacing  ImageMagick.x86_64 1:
 ImageMagick-libs              x86_64 1:  updates-smith122 2.3 M
     replacing  ImageMagick-libs.x86_64 1:
 abrt                          x86_64 2.10.7-1.fc27      updates-smith122 525 k
     replacing  abrt.x86_64 2.10.5-1.fc27
 abrt-addon-ccpp               x86_64 2.10.7-1.fc27      updates-smith122 130 k
     replacing  abrt-addon-ccpp.x86_64 2.10.5-1.fc27
 abrt-addon-coredump-helper    x86_64 2.10.7-1.fc27      updates-smith122  40 k
     replacing  abrt-addon-coredump-helper.x86_64 2.10.5-1.fc27
 abrt-addon-kerneloops         x86_64 2.10.7-1.fc27      updates-smith122  54 k
     replacing  abrt-addon-kerneloops.x86_64 2.10.5-1.fc27
 abrt-addon-pstoreoops         x86_64 2.10.7-1.fc27      updates-smith122  32 k
     replacing  abrt-addon-pstoreoops.x86_64 2.10.5-1.fc27