Building birdie — a twitter client — for Red Hat Enterprise Linux 7 Beta
Birdie is a beautiful, new twitter client for the Linux desktop that is not included as official software in Red Hat Enterprise Linux 7 Beta. This post details the steps I followed, and a few of the issues faced when building and packaging birdie for RHEL7 Beta.
Setting up your build environment
Starting with a clean install of the RHEL7 Beta Workstation, install the Development Tools group, and the rpmdevtools package with the commands:
sudo yum groupinstall "Development tools" sudo yum install rpmdevtools
Next, setup the rpmbuild directory in your home directory with the command:
Everything you need to grow your career.
With your free Red Hat Developer program membership, unlock our library of cheat sheets and ebooks on next-generation application development.SIGN UP
Get the birdie source
Download the birdie source from github using the command
git clone https://github.com/birdieapp/birdie.git
The main branch of birdie contains GNOME and GTK features not available to us, so we need to use the “legacy” branch of birdie. Use the following commands to switch to the legacy branch, and to create a tarball of the birdie legacy branch source:
cd birdie git checkout legacy git archive --format=tar.gz --prefix=birdie-1.1/ legacy > birdie-1.1.tar.gz
Now, copy the newly created birdie tarball into the SOURCES directory in the ~/rpmbuild directory.
cp birdie-1.1.tar.gz ~/rpmbuild/SOURCES/
Getting and editing the birdie Specfile
Since birdie is in Fedora, we are now going to grab the srpm from the upstream Fedora package, and extract the specfile out of it. First, download the srpm:
Then extract the specfile from the srpm, and copy it to the ~/rpmbuild/SPECS directory with:
rpm2cpio birdie-1.1-1.fc20.src.rpm | cpio -id "birdie.spec" cp birdie.spec ~/rpmbuild/SPECS/
Finally, because the Fedora birdie builds against birdie trunk/master, not the legacy branch we want, we need to change a few build dependencies in the specfile for birdie to build on RHEL7 Beta. Remove the following lines in birdie.spec
BuildRequires: gtk3-devel >= 3.10 BuildRequires: vala-devel >= 0.22.1
and change them to
BuildRequires: gtk3-devel BuildRequires: vala-devel BuildRequires: libwnck3-devel
Additionally, change the following two lines from:
Attempt to build the birdie rpm
First up, we need to install all the build dependencies that birdie requires to build. To do this, use the command:
sudo yum-builddep ~/rpmbuild/SPECS/birdie.spec
then build the birdie binary locally with:
rpmbuild -ba ~/rpmbuild/SPECS/birdie.spec
However, this build will most likely fail, with the following error (it will be in the scroll back a ways)
error: Package `Dbusmenu-0.4' not found in specified Vala API directories or GObject-Introspection GIR directories
Turns out, Birdie Legacy actually requires the libdbusmenu-devel package as a builddep too.
libdbusmenu is not available in RHEL7 Beta, so we have to build that one from source too. First, change into the SRPM directory in ~/rpmbuild. and download the SRPM from Fedora:
cd ~/rpmbuild/SRPMS/ wget http://kojipkgs.fedoraproject.org//packages/libdbusmenu/12.10.2/5.fc20/src/libdbusmenu-12.10.2-5.fc20.src.rpm
Install the builddeps for, then build the libdbusmenu packages:
sudo yum-builddep ~/rpmbuild/SRPMS/libdbusmenu-12.10.2-5.fc20.src.rpm rpmbuild --rebuild ~/rpmbuild/SRPMS/libdbusmenu-12.10.2-5.fc20.src.rpm
Then install what we just built. First, the libdbusmenu package, followed by the libdbusmenu-devel package.
sudo yum localinstall ~/rpmbuild/RPMS/x86_64/libdbusmenu-12.10.2-5.el7.x86_64.rpm sudo yum localinstall ~/rpmbuild/RPMS/x86_64/libdbusmenu-devel-12.10.2-5.el7.x86_64.rpm
Try the birdie build again
Use the same command as before to build the birdie binary:
rpmbuild -ba ~/rpmbuild/SPECS/birdie.spec
Now, once the package is built you should be able to install birdie with:
sudo yum localinstall ~/rpmbuild/RPMS/x86_64/birdie-1.1-1.el7.x86_64.rpm
To start birdie, either type “birdie” in the command line, or find it in the Applications menu under the Internet category.
Alternatively, just install birdie.
If you just want to install birdie, and not bother about building it yourself, there is a COPR repo set up to install a pre-built version of Birdie for RHEL7 Beta.
First, enable the repo on your system:
sudo curl -o /etc/yum.repos.d/birdie-rhel7.repo http://copr.fedoraproject.org/coprs/ryanlerch/birdie/repo/epel-7-x86_64/
Then install birdie with:
sudo yum install birdie
If you want learn more about COPR, you should go check out this post which will show you how to get an account and get things built that you can share with others.
Take advantage of your Red Hat Developers membership and download RHEL today at no cost.