##
##  rpmmacros -- OpenPKG RPM macro specification
##

%openpkg_layout                         layout=symlinked macrosfile=%{macrosfile} debug=no shared=yes

#   filesystem layout where dst/tmp/pkg are symlinked from .openpkg/
%__openpkg_layout_symlinked_specdir()   %{__openpkg_basedir}/%{?name}
%__openpkg_layout_symlinked_sourcedir() %{__openpkg_basedir}/.openpkg/dst/%{?name}
%__openpkg_layout_symlinked_builddir()  %{__openpkg_basedir}/.openpkg/tmp:+%{__openpkg_SE_subdir}
%__openpkg_layout_symlinked_tmppath()   %{__openpkg_basedir}/.openpkg/tmp:+%{__openpkg_SE_subdir}
%__openpkg_layout_symlinked_rpmdir()    %{__openpkg_basedir}/.openpkg/pkg/bin
%__openpkg_layout_symlinked_srcrpmdir() %{__openpkg_basedir}/.openpkg/pkg/src

#   filesystem layout where dst/tmp/pkg are in the parent directory
%__openpkg_layout_parent_specdir()      %{__openpkg_basedir}/%{?name}
%__openpkg_layout_parent_sourcedir()    %{__openpkg_basedir}/../dst/%{?name}
%__openpkg_layout_parent_builddir()     %{__openpkg_basedir}/../tmp:+%{__openpkg_SE_subdir}
%__openpkg_layout_parent_tmppath()      %{__openpkg_basedir}/../tmp:+%{__openpkg_SE_subdir}
%__openpkg_layout_parent_rpmdir()       %{__openpkg_basedir}/../pkg/bin
%__openpkg_layout_parent_srcrpmdir()    %{__openpkg_basedir}/../pkg/src

#   support for custom "openpkg dev release" command
%__openpkg_basedir_local                %{lua: print(openpkg.canonicalize(rpm.realpath(util.rsubst(rpm.realpath("%{macrosfile}"), "/[^/]+$", "/..")))) }
%openpkg_dev_release                    %{__openpkg_basedir_local}/.openpkg/openpkg-dev-release

