You clone the repo inside the rpmbuild/SOURCES folder, so you get all sources 
inside rpmbuild/SOURCES/fedora-32-x86_64-ez folder, not inside rpmbuild/SOURCES 
itself.

Just copy the files to the SOURCES folder directly, e.g.:
vrpmbuild/SOURCES
# cd rpmbuild/SOURCES
# git clone -b dist-vz7-u15 
https://src.openvz.org/scm/ovzt/fedora-32-x86_64-ez.git
# cp fedora-32-x86_64-ez/os*  fedora-32-x86_64-ez/*packages .
...

Also make sure that there no other files in rpmbuild/SOURCES, otherwise the 
template can pick up them.

The root of the problem is that template authors are quite lazy to declare 
every source file separately in spec, so the spec looks for sources in a rather 
tricky way:

%define sources_lst() \
%((cd %_sourcedir;\
s=1;\
for tmpl in %1; do\
sources=$tmpl"_*";\
for file in $sources; do\
echo Source$s: $file;\
s=$((s+1))\
done;\
done))\
%nil

%define templates_list() %((cd %_sourcedir; for f in *_packages; do echo -n 
"${f%_*} "; done))

The latter command scans _sourcedir recursively so it finds *_packages files 
even in subfolders. But the former macro doesn't look into subfolders so at 
least os* files are missing.
________________________________
From: [email protected] <[email protected]> on behalf of Peter 
Schultze <[email protected]>
Sent: Thursday, August 6, 2020 3:17 AM
To: OpenVZ users <[email protected]>
Subject: Re: [Users] Fedora-3x template packages

On Wed, 5 Aug 2020, Denis Silakov wrote:

> I guess there are no docs, but the process is rather simple - clone the repo, 
> checkout a branch corresponding to the development version (dist-vz7-u15 
> atm), copy all files to your ~/rpmbuild/SOURCES folder and launch rpmbuild 
> -bb *spec.

I am evidently still missing something. Building and installing an rpm
ran without errors:

# cd rpmbuild/SOURCES
# git clone -b dist-vz7-u15 
https://src.openvz.org/scm/ovzt/fedora-32-x86_64-ez.git

# cd
# rpmbuild -bb rpmbuild/SOURCES/fedora-32-x86_64-ez/fedora-32-x86_64-ez.spec
# yum localinstall 
rpmbuild/RPMS/noarch/fedora-32-x86_64-ez-7.0.0-1.vl7.noarch.rpm

However, the resulting rpm contains no os files:

# rpm -ql fedora-32-x86_64-ez-7.0.0-1.vl7.noarch
/vz/template/fedora/32/x86_64/config/app/*/default
/vz/template/fedora/32/x86_64/config/app/*/default/description
/vz/template/fedora/32/x86_64/config/app/*/default/release
/vz/template/fedora/32/x86_64/config/app/*/default/summary
/vz/template/fedora/32/x86_64/config/app/*/default/version

and container generation of course fails:
# prlctl create F32 --vmtype ct --ostemplate fedora-32-x86_64
Creating the Container...
Failed to register the CT: PRL_ERR_VZCTL_OPERATION_FAILED (Details: Error:
Unable to find ostemplate: fedora-32-x86_64
Creation of Container private area failed)
Failed to create the virtual machine.


What am I missing?



> ________________________________
> From: [email protected] <[email protected]> on behalf of Peter 
> Schultze <[email protected]>
> Sent: Wednesday, August 5, 2020 11:01 PM
> To: [email protected] <[email protected]>
> Subject: [Users] Fedora-3x template packages
>
> Hello,
>
> https://src.openvz.org/projects/OVZT has entries for Fedora-30 and
> Fedora-32. However, the most recent rpm package available in the normal
> OpenVZ 7.0 repository is fedora-23-x86_64-ez
>
> Does documentation exist on how to build a template from the available
> sources?
>
> Peter S.
>
> _______________________________________________
> Users mailing list
> [email protected]
> https://lists.openvz.org/mailman/listinfo/users
>

--
Peter Schultze
UCLA Computer Science Department                    310-825-9929
_______________________________________________
Users mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/users
_______________________________________________
Users mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/users

Reply via email to