Trying to write a snapd-glib spec file: autoreconf is asking me to define LIBTOOL?

Hi,

I’m fairly new to writing spec files where there’s an autogen script. I want to package snapd-glib as that way I can build GNOME Software with Snappy package support. This is my current spec file:


#
# spec file for package snapd-glib
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           snapd-glib
Version:        1.39
Release:        0
Summary:        glib library for communicating with snapd
License:        LGPL
Group:          System/Packages
Url:            https://github.com/snapcore/snapd-glib
Source:         https://github.com/snapcore/snapd-glib/archive/%{version}.tar.gz
BuildRequires:  libsoup-devel
BuildRequires:  json-glib-devel
BuildRequires:  libqt5-qtdeclarative-devel
BuildRequires:  libqt5-qtbase-devel
BuildRequires:  glib2-devel
BuildRequires:  gtk-doc
BuildRequires:  autoconf
BuildRequires:  automake
Requires:       libsoup-2_4-1
Requires:       libjson-glib-1_0-1
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description

%prep
%setup -q

%build
ln -sf /usr/share/gtk-doc/data/gtk-doc.make gtk-doc.make
autoreconf -i -f
%configure
make %{?_smp_mflags}

%install
%make_install

%post
%postun

%files
%defattr(-,root,root)
%doc README.md COPYING.LGPL2 COPYING.LGPL3

%changelog

this is my build log: https://gist.githubusercontent.com/fusion809/48d20fe086740ccf26885fe3bcbd41f7/raw/4b05f8db3685a7b3c75e3257333948611947b87b/snapd-glib-build-log. The error itself is:


snapd-qt/Makefile.am:66: error: Libtool library used but 'LIBTOOL' is undefined

any ideas as to how I fix this? It mentions adding LT_INIT to configure.ac, but how am I meant to do that? Merely doing echo "LT_INIT" >> configure.ac to the spec file doesn’t cut it. Sorry for my ignorance, I’m used to simple config and cmake builds, not autoconf.

Thanks for your time,

I should add that I have managed to build this package without a problem locally via running:


./autogen.sh
make
sudo make install

based on this success I originally tried using this spec file instead:


#
# spec file for package snapd-glib
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           snapd-glib
Version:        1.39
Release:        0
Summary:        glib library for communicating with snapd
License:        LGPL
Group:          System/Packages
Url:            https://github.com/snapcore/snapd-glib
Source:         https://github.com/snapcore/snapd-glib/archive/%{version}.tar.gz
BuildRequires:  libsoup-devel
BuildRequires:  json-glib-devel
BuildRequires:  libqt5-qtdeclarative-devel
BuildRequires:  libqt5-qtbase-devel
BuildRequires:  glib2-devel
BuildRequires:  gtk-doc
BuildRequires:  autoconf
BuildRequires:  automake
Requires:       libsoup-2_4-1
Requires:       libjson-glib-1_0-1
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
glib library for communicating with snapd 

%prep
%setup -q

%build
./autogen.sh --prefix=/usr
make %{?_smp_mflags}

%install
%make_install

%post
%postun

%files
%defattr(-,root,root)
%doc README.md COPYING.LGPL2 COPYING.LGPL3

%changelog

but I got the same error involving LIBTOOL.

Also tried adding the lines:


echo "LT_INIT" >> configure.ac
aclocal
autoconf

before the autogen.sh line, based on what the error message said and it too failed. The error suggests something wrong with aclocal’s search path, anyone know how to fix that?

Try adding libtool as build requires.

I thought the error told me that libtool was detected, but you’re right it was needed as a BuildRequires, thanks.