post script fail


I am quit new to OBS and have only build a few rpm in the past, so please be gentle with me.

Previously I have successfully build a package the old fashioned way using rpmbuild in ~/rpm catalog with the usual BUILD, SPEC ect. structure. To share this package with the world I tried to move the package to build service.

The daemon needs a system account and working directory so in the spec file I have made the following lines:

if ! /usr/bin/getent passwd rbldns >/dev/null; then
  /usr/sbin/useradd --system --home /var/lib/rbldns rbldns
  /bin/mkdir -p -m0755 /var/lib/rbldns

But when I try to build in OBS build fails:

... testing for pre/postinstall scripts that are not idempotent
/.build_patchrpmcheck_scr: line 2: /usr/sbin/useradd: No such file or directory
postinstall script of rbldnsd-0.996b-3.1.x86_64.rpm failed
System halted.

What is the correct way to accomplish this?

Ensuring that the package containing useradd is present during build (BuildRequires).

Thanks for the pointer. Got it building now.

(pew … a lot of warnings though)