Bad exit status on "rpmbuild -bi <name>.spec"

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.

Can you post the error message as copied text rather than as a screenshot, please? Thanks!

1 Like

gtg was retired because upstream development had stopped. You can see the spec that was in use before here and adapt that:

https://src.fedoraproject.org/rpms/gtg/blob/36577e76bb89b717c8ac5802d5c7d999fc653019/f/gtg.spec

I’d follow the steps here to build the RPM. (rpmbuild -bi is not a command I’ve used in my workflow in a very long time. Generally, you use rpmbuild -bs to build the source rpm, and then rpmbuild -ba to build the binary rpms.)

https://fedoraproject.org/wiki/Join_the_package_collection_maintainers#Make_a_Package

Your specific error simply says that the default “buildroot” folder is included in the list of files that are installed, which shouldn’t be the case.

I was already using this spec file, but the new upstream is using meson to build the package, so I had to change the build and install process in the spec file.

I took a look at the nautilus spec file and found that to compile with meson you use %meson and %meson_build in the build process and %meson_install in the install process. Changing it in the spec file fixed my error.

%prep
%autosetup


%build
%meson
%meson_build

%install
%meson_install
1 Like

Sounds good.

In general, please prefer text to figures on the forum. Figures are not accessible by individuals using screen readers etc., and when they contain more information, they’re not searchable either.

1 Like

And you can’t do copy&paste :rofl:

1 Like