I'm packaging cryptodev-linux in a local osc instance.
Upstream source is from git.
It can be trivially built/installed with
cd cryptodev-linux
make
make install
which installs two files
/usr/include/crypto/cryptodev.h
/lib/modules/4.0.0-2.g53b125b-desktop/extra/cryptodev.ko
For obs, I use osc source_services, configured with
edit _service
<services>
<service name="tar_scm" mode="disabled">
<param name="url">https://github.com/cryptodev-linux/cryptodev-linux.git</param>
<param name="scm">git</param>
<param name="exclude">.git</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">*.tar</param>
<param name="compression">gz</param>
</service>
<service name="set_version" mode="disabled">
<param name="basename">cryptodev-linux</param>
</service>
</services>
On exec of disabled run
osc service dr
the git source is pulled and tar'd in the local pkg dir,
ls -1 .
cryptodev-linux-1428749261.da73010.tar.gz
cryptodev-linux.spec
_service
and 'version' is propagated to the spec file
edit cryptodev-linux.spec
# spec file for package cryptodev-linux
#
# Copyright (c) 2015 PGNd
#
# 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/
#
# cryptodev-linux.spec
Name: cryptodev-linux
Version: 1428749261.da73010
Release: 0
Summary: Package cryptodev-linux
License: GPL-2.0
Group: Productivity/Networking/Security
Url: http://cryptodev-linux.org/
Source: %{name}-%{version}.tar.gz
BuildArch: x86_64
BuildRequires: kernel-desktop-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Cryptodev-linux is a device that allows access to Linux kernel cryptographic
drivers; thus allowing of userspace applications to take advantage of hardware
accelerators.
%prep
%setup -q -n %{name}-%{version}
make clean
%build
make %{?_smp_mflags}
%install
make DESTDIR=%{buildroot} install
%clean
rm -rf %{buildroot}
%files
%defattr(-, root, root)
%{buildroot}/usr/include/crypto/cryptodev.h
%changelog
* Sat Apr 25 2015 PGNd
- init
The exec of the build fails
osc build --noinit --local-package cryptodev-linux.spec
WARNING: source service from package or project will not be executed. This may not be the same build as on server!
Building cryptodev-linux.spec for openSUSE_13.2/x86_64
Use local '/usr/local/src/obs_workspace/home:pgnd:pgnd-stack/cryptodev-linux/.osc/_buildinfo-openSUSE_13.2-x86_64.xml' file as buildinfo
Use local '/usr/local/src/obs_workspace/home:pgnd:pgnd-stack/cryptodev-linux/.osc/_buildconfig-openSUSE_13.2-x86_64' file as buildconfig
Updating cache of required packages
0.0% cache miss. 108/108 dependencies cached.
Verifying integrity of cached packages
using keys from openSUSE:13.2, devel:tools, Kernel
Writing build configuration
Running build
logging output to /var/tmp/build-root/openSUSE_13.2-x86_64/.build.log...
[ 0s] Memory limit set to 33093592KB
[ 0s] Using BUILD_ROOT=/var/tmp/build-root/openSUSE_13.2-x86_64
[ 0s] Using BUILD_ARCH=x86_64:i686:i586:i486:i386
[ 0s]
[ 0s]
[ 0s] desk.lan started "build cryptodev-linux.spec" at Sun Apr 26 00:54:48 UTC 2015.
[ 0s]
[ 0s]
[ 0s] processing recipe /usr/local/src/obs_workspace/home:pgnd:pgnd-stack/cryptodev-linux/cryptodev-linux.spec ...
[ 0s] running changelog2spec --target rpm --file /usr/local/src/obs_workspace/home:pgnd:pgnd-stack/cryptodev-linux/cryptodev-linux.spec
[ 1s] -----------------------------------------------------------------
[ 1s] ----- building cryptodev-linux.spec (user abuild)
[ 1s] -----------------------------------------------------------------
[ 1s] -----------------------------------------------------------------
[ 1s] + exec rpmbuild -ba --define '_srcdefattr (-,root,root)' --nosignature /usr/src/packages/SOURCES/cryptodev-linux.spec
[ 1s] Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.9NhwX4
[ 1s] + umask 022
[ 1s] + cd /usr/src/packages/BUILD
[ 1s] + cd /usr/src/packages/BUILD
[ 1s] + rm -rf cryptodev-linux-1428749261.da73010
[ 1s] + /usr/bin/gzip -dc /usr/src/packages/SOURCES/cryptodev-linux-1428749261.da73010.tar.gz
[ 1s] + /bin/tar -xf -
[ 1s] + STATUS=0
[ 1s] + '[' 0 -ne 0 ']'
[ 1s] + cd cryptodev-linux-1428749261.da73010
[ 1s] + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
[ 1s] + make clean
[ 1s] make -C /lib/modules/4.0.0-4.g27299c0-desktop/build SUBDIRS=`pwd` clean
[ 1s] make[1]: Entering directory '/usr/src/linux-4.0.0-4.g27299c0-obj/x86_64/desktop'
[ 2s] make[1]: Leaving directory '/usr/src/linux-4.0.0-4.g27299c0-obj/x86_64/desktop'
[ 2s] rm -f *~
[ 2s] CFLAGS= KERNEL_DIR=/lib/modules/4.0.0-4.g27299c0-desktop/build make -C tests clean
[ 2s] make[1]: Entering directory '/usr/src/packages/BUILD/cryptodev-linux-1428749261.da73010/tests'
[ 2s] rm -f *.o *~ cipher cipher-aead hmac speed async_cipher async_hmac async_speed sha_speed hashcrypt_speed fullspeed cipher-gcm cipher-aead-srtp cipher_comp hash_comp hmac_comp
[ 2s] make[1]: Leaving directory '/usr/src/packages/BUILD/cryptodev-linux-1428749261.da73010/tests'
[ 2s] + exit 0
[ 2s] Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.Lr1Uxf
[ 2s] + umask 022
[ 2s] + cd /usr/src/packages/BUILD
[ 2s] + /usr/bin/rm -rf /usr/src/packages/BUILDROOT/cryptodev-linux-1428749261.da73010-0.x86_64
[ 2s] ++ dirname /usr/src/packages/BUILDROOT/cryptodev-linux-1428749261.da73010-0.x86_64
[ 2s] + /usr/bin/mkdir -p /usr/src/packages/BUILDROOT
[ 2s] + /usr/bin/mkdir /usr/src/packages/BUILDROOT/cryptodev-linux-1428749261.da73010-0.x86_64
[ 2s] + cd cryptodev-linux-1428749261.da73010
[ 2s] + make -j4
[ 2s] make -C /lib/modules/4.0.0-4.g27299c0-desktop/build SUBDIRS=`pwd` modules
[ 2s] make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
[ 2s] make[1]: Entering directory '/usr/src/linux-4.0.0-4.g27299c0-obj/x86_64/desktop'
[ 2s] CC [M] /usr/src/packages/BUILD/cryptodev-linux-1428749261.da73010/ioctl.o
[ 3s] CC [M] /usr/src/packages/BUILD/cryptodev-linux-1428749261.da73010/main.o
[ 3s] CC [M] /usr/src/packages/BUILD/cryptodev-linux-1428749261.da73010/cryptlib.o
[ 4s] CC [M] /usr/src/packages/BUILD/cryptodev-linux-1428749261.da73010/authenc.o
[ 4s] CC [M] /usr/src/packages/BUILD/cryptodev-linux-1428749261.da73010/zc.o
[ 5s] CC [M] /usr/src/packages/BUILD/cryptodev-linux-1428749261.da73010/util.o
[ 5s] LD [M] /usr/src/packages/BUILD/cryptodev-linux-1428749261.da73010/cryptodev.o
[ 5s] Building modules, stage 2.
[ 5s] MODPOST 1 modules
[ 5s] CC /usr/src/packages/BUILD/cryptodev-linux-1428749261.da73010/cryptodev.mod.o
[ 5s] LD [M] /usr/src/packages/BUILD/cryptodev-linux-1428749261.da73010/cryptodev.ko
[ 5s] make[1]: Leaving directory '/usr/src/linux-4.0.0-4.g27299c0-obj/x86_64/desktop'
[ 5s] + exit 0
[ 5s] Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.qbPpuC
[ 5s] + umask 022
[ 5s] + cd /usr/src/packages/BUILD
[ 5s] + cd cryptodev-linux-1428749261.da73010
[ 5s] + make DESTDIR=/usr/src/packages/BUILDROOT/cryptodev-linux-1428749261.da73010-0.x86_64 install
[ 5s] make -C /lib/modules/4.0.0-4.g27299c0-desktop/build SUBDIRS=`pwd` modules_install
[ 5s] make[1]: Entering directory '/usr/src/linux-4.0.0-4.g27299c0-obj/x86_64/desktop'
[ 7s] INSTALL /usr/src/packages/BUILD/cryptodev-linux-1428749261.da73010/cryptodev.ko
[ 7s] DEPMOD 4.0.0-4.g27299c0-desktop
[ 7s] make[1]: Leaving directory '/usr/src/linux-4.0.0-4.g27299c0-obj/x86_64/desktop'
[ 7s] Installing cryptodev.h in /usr/include/crypto ...
[ 7s] + /usr/lib/rpm/brp-compress
[ 7s] + /usr/lib/rpm/brp-suse
[ 7s] calling /usr/lib/rpm/brp-suse.d/brp-05-permissions
[ 7s] calling /usr/lib/rpm/brp-suse.d/brp-15-strip-debug
[ 7s] calling /usr/lib/rpm/brp-suse.d/brp-25-symlink
[ 7s] calling /usr/lib/rpm/brp-suse.d/brp-30-desktop
[ 7s] WARNING: '/usr/lib/rpm/brp-desktop.data/suse-screensavers.menu' does not exist
[ 7s] WARNING: '/usr/lib/rpm/brp-desktop.data/preferences-gnome.menu' does not exist
[ 7s] WARNING: '/usr/lib/rpm/brp-desktop.data/applications-kmenuedit.menu' does not exist
[ 7s] calling /usr/lib/rpm/brp-suse.d/brp-35-rpath
[ 7s] calling /usr/lib/rpm/brp-suse.d/brp-40-rootfs
[ 7s] calling /usr/lib/rpm/brp-suse.d/brp-45-tcl
[ 7s] calling /usr/lib/rpm/brp-suse.d/brp-50-check-python
[ 7s] calling /usr/lib/rpm/brp-suse.d/brp-55-boot-scripts
[ 7s] calling /usr/lib/rpm/brp-suse.d/brp-60-hook
[ 7s] calling /usr/lib/rpm/brp-suse.d/brp-65-lib64-linux
[ 7s] calling /usr/lib/rpm/brp-suse.d/brp-72-extract-appdata
[ 7s] Processing files: cryptodev-linux-1428749261.da73010-0.x86_64
[ 7s] error: File not found: /usr/src/packages/BUILDROOT/cryptodev-linux-1428749261.da73010-0.x86_64/usr/include/crypto/cryptodev.h
[ 7s]
[ 7s]
[ 7s] RPM build errors:
[ 7s] File not found: /usr/src/packages/BUILDROOT/cryptodev-linux-1428749261.da73010-0.x86_64/usr/include/crypto/cryptodev.h
The buildroot was: /var/tmp/build-root/openSUSE_13.2-x86_64
In the .spec, I specified
BuildRoot: %{_tmppath}/%{name}-%{version}-build
The build exec seems to ignored that, instead using
[ 0s] Using BUILD_ROOT=/var/tmp/build-root/openSUSE_13.2-x86_64
apparently sourced from
grep "build-root =" ~/.oscrc
#build-root = /var/tmp/build-root/%(repo)s-%(arch)s
The files spec instructs looking for the installed file, cryptodev.h, in its install dir under %{buildroot}.
%files
%defattr(-, root, root)
%{buildroot}/usr/include/crypto/cryptodev.h <--
The file is, apparently, not found under the spec-file-specified %{buildroot}
[ 7s] RPM build errors:
[ 7s] File not found: /usr/src/packages/BUILDROOT/cryptodev-linux-1428749261.da73010-0.x86_64/usr/include/crypto/cryptodev.h
but is actually located under the used BUILD_ROOT
[ 0s] Using BUILD_ROOT=/var/tmp/build-root/openSUSE_13.2-x86_64
find /var/tmp/build-root/openSUSE_13.2-x86_64 -name 'cryptodev.h'
/var/tmp/build-root/openSUSE_13.2-x86_64/usr/include/crypto/cryptodev.h
/var/tmp/build-root/openSUSE_13.2-x86_64/usr/src/packages/BUILD/cryptodev-linux-1428749261.da73010/crypto/cryptodev.h
What in the spec file needs to change so that the build process finds the built file in the correct buildroot?
--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org
To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org