I’m new to packaging and I’m trying to write a spec file for Getting Things Gnome, but when I run “rpmbuild -bi gtg.spec” I get this error message in the installation process:
+ /usr/lib/rpm/check-buildroot
/home/leug/rpmbuild/BUILDROOT/gtg-0.5-19.fc34.x86_64/share/dbus-1/services/org.gnome.GTG.service:Exec=/home/leug/rpmbuild/BUILDROOT/gtg-0.5-19.fc34.x86_64/bin/gtg --gapplication-service
/home/leug/rpmbuild/BUILDROOT/gtg-0.5-19.fc34.x86_64/bin/gtg: LOCALE_DIR = '/home/leug/rpmbuild/BUILDROOT/gtg-0.5-19.fc34.x86_64/share/locale'
Found '/home/leug/rpmbuild/BUILDROOT/gtg-0.5-19.fc34.x86_64' in installed files; aborting
error: Bad exit status from /var/tmp/rpm-tmp.1gC181 (%install)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.1gC181 (%install)
This is the content of “rpm-tmp.1gC181”:
#!/bin/sh
RPM_SOURCE_DIR="/home/leug/rpmbuild/SOURCES"
RPM_BUILD_DIR="/home/leug/rpmbuild/BUILD"
RPM_OPT_FLAGS="-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection"
RPM_LD_FLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld "
RPM_ARCH="x86_64"
RPM_OS="linux"
RPM_BUILD_NCPUS="2"
export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_LD_FLAGS RPM_ARCH RPM_OS RPM_BUILD_NCPUS RPM_LD_FLAGS
RPM_DOC_DIR="/usr/share/doc"
export RPM_DOC_DIR
RPM_PACKAGE_NAME="gtg"
RPM_PACKAGE_VERSION="0.5"
RPM_PACKAGE_RELEASE="19.fc34"
export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
LANG=C
export LANG
unset CDPATH DISPLAY ||:
RPM_BUILD_ROOT="/home/leug/rpmbuild/BUILDROOT/gtg-0.5-19.fc34.x86_64"
export RPM_BUILD_ROOT
PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/usr/lib64/pkgconfig:/usr/share/pkgconfig"
export PKG_CONFIG_PATH
CONFIG_SITE=${CONFIG_SITE:-NONE}
export CONFIG_SITE
set -x
umask 022
cd "/home/leug/rpmbuild/BUILD"
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "${RPM_BUILD_ROOT}"
mkdir -p `dirname "$RPM_BUILD_ROOT"`
mkdir "$RPM_BUILD_ROOT"
cd 'gtg-0.5'
rm -rf /home/leug/rpmbuild/BUILDROOT/gtg-0.5-19.fc34.x86_64
ninja -C _build install
/usr/lib/rpm/find-lang.sh /home/leug/rpmbuild/BUILDROOT/gtg-0.5-19.fc34.x86_64 gtg
/usr/lib/rpm/find-debuginfo.sh \
-j2 \
--strict-build-id \
\
-m \
-i \
--build-id-seed "0.5-19.fc34" \
--unique-debug-suffix "-0.5-19.fc34.x86_64" \
--unique-debug-src-base "gtg-0.5-19.fc34.x86_64" \
--run-dwz\
--dwz-low-mem-die-limit 10000000\
--dwz-max-die-limit 110000000 \
\
-S debugsourcefiles.list \
"/home/leug/rpmbuild/BUILD/gtg-0.5"
[ "%{buildarch}" = "noarch" ] || QA_CHECK_RPATHS=1 ;
case "${QA_CHECK_RPATHS:-}" in [1yY]*) /usr/lib/rpm/check-rpaths ;; esac
/usr/lib/rpm/check-buildroot
/usr/lib/rpm/redhat/brp-ldconfig
/usr/lib/rpm/brp-compress
/usr/lib/rpm/redhat/brp-strip-lto /usr/bin/strip
/usr/lib/rpm/brp-strip-static-archive /usr/bin/strip
/usr/lib/rpm/redhat/brp-python-bytecompile "" "1" "0"
/usr/lib/rpm/brp-python-hardlink
/usr/lib/rpm/redhat/brp-mangle-shebangs
This is my .spec file:
Name: gtg
Version: 0.5
Release: 19%{?dist}
Summary: Personal organizer for the GNOME desktop
Group: Applications/Productivity
License: GPLv3+
URL: https://wiki.gnome.org/Apps/GTG
BuildArch: noarch
Source0: https://github.com/getting-things-gnome/gtg/archive/refs/tags/v%{version}.tar.gz
BuildRequires: python3-gobject
BuildRequires: gtk3
BuildRequires: itstool
BuildRequires: gettext
BuildRequires: python3-lxml
BuildRequires: meson
Requires: python3-cairo python3-setproctitle
%description
Getting Things GNOME! (GTG) is a personal organizer for the GNOME desktop
environment inspired by the Getting Things Done (GTD) methodology. GTG is
designed with flexibility, adaptability, and ease of use in mind so it can be
used as more than just GTD software.
%prep
%autosetup
meson _build --prefix=$RPM_BUILD_ROOT
%build
ninja -C _build
%install
rm -rf $RPM_BUILD_ROOT
ninja -C _build install
%find_lang %{name}
%files -f %{name}.lang
Obs: I’m just modifying an old .spec file of gtg.