So a user reported a bug about not being able to create a desktop file in GNOME 3 (which is an upstream issue) for a text editor called TEA from TEA: news
I don’t normally package QT stuff, so I thought I would give it a whirl, look in the README and it’s just a qmake, make, make install scenario so shouldn’t be too bad. Aside from just adding a *.desktop file which isn’t a biggy.
Looking in the source there is a 64x64 sized icon, so just need to copy, convert and add as a Source(n): to the spec file, an easy job with the ImageMagick tools;
cp tea-31.0.0/icons/tea_icon_v2.png tea-editor.png
convert tea-editor.png -resize 48x48 tea-editor.png
Voila a nice 48x48 icon
So fixing some of the build dependencies got the build going until it came to the install it didn’t like the standard install macro as it wanted to install directly into /usr/bin grrrr,r Oh well it’s just a binary file so lets just install manually into the build root via the install command and create our desktop file;
install -Dm0755 bin/tea %{buildroot}%{_bindir}/tea
%suse_update_desktop_file -c tea-editor "Text editor for UNIX-like systems" "" tea tea-editor Utility TextEditor
Now it all builds except the dreaded “File is compiled without RPM_OPT_FLAGS” it’s only a warning, but to ensure all the full build checks are done it needs to be enabled. Normally just adding the %{optflags} to C and CXX FLAGS is enough… but this is using qmake which generates a Makefile from a src.pro file. Ughh patches required But some surfing on the net came up with this little gem a .qmake.cache which will add your options on the fly
So, I added this to the rpm spec file in the %build section;
# Create qmake cache file to add rpm optflags
cat > .qmake.cache <<EOF
QMAKE_CFLAGS += %{optflags}
QMAKE_CXXFLAGS += %{optflags}
EOF
Now we get a nice clean build with the RPM_OPT_FLAGS set with a few build warnings, but nothing serious
It’s not a bad little text editor, if you want to try it out it’s in my testing repository and can be found here for SLE 11 SP1, and openSUSE;
software.opensuse.org: Search Results