chroot rpm builds with build fail

I’m using ‘/bin/build’ to build a few relocatable packages for local installation. I created the ‘abuild’ user and group with 399 uid and gid.

My build environment -

echo -e "$BUILD_ROOT
$BUILD_ARCH
$BUILD_RPM_BUILD_STAGE" 
/home/abuild/rpmbuild/BUILD 
x86_64 
-ba

When I run ‘build arpwatch.spec,’ I get the error “Bad source: /home/abuild/rpmbuild/SOURCES/arpwatch-3.3.tar.gz: No such file or directory:” despite the fact that the sources are already present in '…/SOURCES." -

[Tue Dec 06 09:27:56 root@flux-virt /home/abuild/rpmbuild/SPECS] 
# ls -l ../SOURCES/arpwatch-3.3.tar.gz 
-rw-r--r-- 1 abuild abuild 117839 Mar 27  2022 ../SOURCES/arpwatch-3.3.tar.gz

[FONT=monospace][FONT=arial black]

Aside from manpage I can’t seem to find detailed documentation for this program; please let me know if I’m using it the wrong way or if I skipped something.

[/FONT][/FONT]

Build log - https://paste.debian.net/hidden/c95754e4/

Hi
When using osc and build, all files live in build-root/home/abuild/rpmbuild/SOURCES directory.

Excellent, I didn’t get that. Should I use OSC in addition to build? OSC is too complicated for me to understand, and I don’t have reference material for it.

Hi
Well that’s the collaboration tool for the openSUSE Build Service, if have an account there, easy to setup local building for any distribution… if build is working, then rock on… :wink:

Nice, I’ll give that a shot once I’ve finished setting up the build system that works.

Hi
Some references for you;

https://en.opensuse.org/openSUSE:OSC

The only things I do is add my user via visudo to allow /usr/bin/build to run… oh and a build-root folder owned by root.

Yes, my user is defined in the /etc/sudoers.d/build file as “flux ALL = NOPASSWD: /usr/bin/build”. Can I specify additional rpmmacros for the build program in ‘/usr/lib/build/configs/tumbleweed.conf’?

Hi
Again if you switch to osc, then it can all be done with the project config, but don’t see why not, however it’s could be over written on an update…

Before running the build, I’ll write a script with uniq -d and compare it with the backup, and if uniq -d doesn’t print anything, I’ll concatenate my additions to the replaced file.

Hi
Ahh ok, so if I wanted to tweak said file, I would just use;


osc co security arpwatch
cd security/arpwatch
tweak as required
osc build --clean
...done...

If I wanted to update, then would use bco instead to branch the package. If I wanted my own copy in a home project then would just copypac it…

My earlier cockup of using ‘rpmdev-spectool’ to add source files to abuild/rpmbuild/SOURCES was the cause of the source not found problem. The “build” operates as expected after all the sources were moved to a separate directory and combined with the specs. This method is more appropriate for build replications where the likelihood of failure is low, but it might not be feasible in my situation. After assembling a package, the program typically purges dependencies before installing some of the same deleted packages for the subsequent spec file. If the build package for the wildcard spec fails, the application then terminates and doesn’t execute any other specs. My changes to /usr/lib/build/configs/tumbleweed.conf have an effect on packages, and the build respects %optflags and %build_ldflags.

I currently have a loop running with the || true, and I added the file logging option to build. Things appear to work somewhat. As soon as the build is finished or fails due to issues, I will post more information.