When the OpenAM  Apache 2.2 Web Agent build process is running on Ubuntu (and probably on some others debian based linux distros too), building the final RPM could fail telling :

janua@build:~/build/4Cyril/Agents-3.3.0/opensso/products/webagents$ ant apache22 -Dbuild.type=64
Buildfile: /opt/build/Agents-3.3.0/opensso/products/webagents/build.xml

preparebuild:

apache22:
     [echo] Dispatch to Apache 22

gmake:
     [echo] Dispatch to compile of agent c code
     [exec] gmake[1]: Entering directory `/opt/build/Agents-3.3.0/opensso/products/webagents/am/source'
     [exec] gmake[2]: Entering directory `/opt/build/Agents-3.3.0/opensso/products/webagents/am/source/samples'
     [exec] cp -fp README.TXT samples.mk am_auth_test.c am_policy_test.c am_sso_test.c apache_agent.c am_log_test.c am_web_agent_test.c ../../../built/samples
     [exec] gmake[2]: Leaving directory `/opt/build/Agents-3.3.0/opensso/products/webagents/am/source/samples'
     [exec] gmake[2]: Entering directory `/opt/build/Agents-3.3.0/opensso/products/webagents/am/source/test'
     [exec] gmake[2]: Nothing to be done for `all'.
     [exec] gmake[2]: Leaving directory `/opt/build/Agents-3.3.0/opensso/products/webagents/am/source/test'
     [exec] gmake[1]: Leaving directory `/opt/build/Agents-3.3.0/opensso/products/webagents/am/source'
     [exec] gmake[1]: Entering directory `/opt/build/Agents-3.3.0/opensso/products/webagents/agents/source'
     [exec] gmake[2]: Entering directory `/opt/build/Agents-3.3.0/opensso/products/webagents/agents/source/common'
     [exec] gmake[3]: Entering directory `/opt/build/Agents-3.3.0/opensso/products/webagents/agents/source/common/resources'
     [exec] gmake[3]: Nothing to be done for `all'.
     [exec] gmake[3]: Leaving directory `/opt/build/Agents-3.3.0/opensso/products/webagents/agents/source/common/resources'
     [exec] mkdir -p ../../../built/Linux/packages.scratch/RPMS/x86_64
     [exec] rm -f -r /tmp/janua/agent-buildroot
     [exec] mkdir -p /tmp/janua/agent-buildroot/opt/agents/lib
     [exec] mkdir -p /tmp/janua/agent-buildroot/opt/agents/config
     [exec] mkdir -p /tmp/janua/agent-buildroot/opt/agents/bin
     [exec] mkdir -p /tmp/janua/agent-buildroot/opt/agents/include
     [exec] mkdir -p /tmp/janua/agent-buildroot/opt/agents/samples
     [exec] mkdir -p /tmp/janua/agent-buildroot/RPMS/x86_64
     [exec] cp -fp ../../../built/Linux/lib/libamsdk.so.3 /tmp/janua/agent-buildroot/opt/agents/lib
     [exec] cp -fp  ../../../extlib/Linux/nspr_64/lib/* /tmp/janua/agent-buildroot/opt/agents/lib
     [exec] cp -fp THIRD_PARTY_LICENSE.TXT /tmp/janua/agent-buildroot/opt/agents/lib/..
     [exec] cp -fp ../../../extlib/Linux/libxml2_64/lib/libxml2.so.2 /tmp/janua/agent-buildroot/opt/agents/lib
     [exec] cp -fp ../../../conf/OpenSSOAgentBootstrap.template /tmp/janua/agent-buildroot/opt/agents/config/OpenSSOAgentBootstrap.template.orig
     [exec] cp -fp ../../../conf/OpenSSOAgentConfiguration.template /tmp/janua/agent-buildroot/opt/agents/config/OpenSSOAgentConfiguration.template.orig
     [exec] cp -fp ../../../am/source/crypt_util /tmp/janua/agent-buildroot/opt/agents/bin
     [exec] cp -fp comlib_linux /tmp/janua/agent-buildroot/opt/agents/lib
     [exec] cp -fp ../../../built/samples/README.TXT /tmp/janua/agent-buildroot/opt/agents/samples
     [exec] cp -fp ../../../built/samples/*.c /tmp/janua/agent-buildroot/opt/agents/samples
     [exec] cp -fp ../../../built/samples/samples.mk /tmp/janua/agent-buildroot/opt/agents/samples/Makefile
     [exec] cp -fp ../../../built/include/*.h /tmp/janua/agent-buildroot/opt/agents/include
     [exec] if [ -f /home/janua/.rpmmacros ] ; then mv /home/janua/.rpmmacros /home/janua/.rpmmacros.agent ; fi
     [exec] echo "%_topdir /tmp/janua/agent-buildroot" > /home/janua/.rpmmacros
     [exec] rpmbuild -bb --buildroot /tmp/janua/agent-buildroot --target x86_64 common-3.0-0.spec
     [exec] Building target platforms: x86_64
     [exec] Building for target x86_64
     [exec] Processing files: common-3.0-0.x86_64
     [exec] Checking for unpackaged file(s): /usr/lib/rpm/check-files /tmp/janua/agent-buildroot
     [exec] + umask 022
     [exec] + cd /tmp/janua/agent-buildroot/BUILD
     [exec] + /bin/rm -rf /tmp/janua/agent-buildroot
     [exec] + exit 0
     [exec] mv: cannot stat `/tmp/janua/agent-buildroot/RPMS/x86_64/common-3.0-0.x86_64.rpm': No such file or directory
     [exec] gmake[2]: *** [../../../built/Linux/packages.scratch/RPMS/x86_64/common-3.0-0.x86_64.rpm] Error 1
     [exec] gmake[1]: *** [all_subdirs] Error 2
     [exec] gmake: *** [all_subdirs] Error 2
     [exec] Wrote: /tmp/janua/agent-buildroot/RPMS/x86_64/common-3.0-0.x86_64.rpm
     [exec] Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.tO2IKf
     [exec] rm -f /home/janua/.rpmmacros
     [exec] if [ -f /home/janua/.rpmmacros.agent ] ; then mv /home/janua/.rpmmacros.agent /home/janua/.rpmmacros ; fi
     [exec] mv -f /tmp/janua/agent-buildroot/RPMS/x86_64/common-3.0-0.x86_64.rpm ../../../built/Linux/packages.scratch/RPMS/x86_64
     [exec] gmake[2]: Leaving directory `/opt/build/Agents-3.3.0/opensso/products/webagents/agents/source/common'
     [exec] gmake[1]: Leaving directory `/opt/build/Agents-3.3.0/opensso/products/webagents/agents/source'

BUILD FAILED
/opt/build/Agents-3.3.0/opensso/products/webagents/build.xml:199: The following error occurred while executing this line:
/opt/build/Agents-3.3.0/opensso/products/webagents/build.xml:252: exec returned: 2

Total time: 2 seconds

The solution is to modify the spec file opensso/products/webagents/agents/source/common/common-3.0-0.spec by adding an empty %clean section at its end and run the ant command again.

Les derniers articles par janua (tout voir)