diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-06-08 13:56:03 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-06-08 13:56:03 +0200 |
commit | 9332a219b62dbe5cea9413a6dd5d2c44c8eb9df9 (patch) | |
tree | 829d0d68deb691d81922b53d0194239ab43874a2 | |
parent | 6a8953c64aaf7cfcd081f0750dcfb9c89aea49e7 (diff) |
Handle exported buildfile installation in pkg-bindist
-rw-r--r-- | bpkg/system-package-manager-archive.cxx | 1 | ||||
-rw-r--r-- | bpkg/system-package-manager-debian.cxx | 11 | ||||
-rw-r--r-- | bpkg/system-package-manager-fedora.cxx | 22 |
3 files changed, 33 insertions, 1 deletions
diff --git a/bpkg/system-package-manager-archive.cxx b/bpkg/system-package-manager-archive.cxx index 1278330..2639bb1 100644 --- a/bpkg/system-package-manager-archive.cxx +++ b/bpkg/system-package-manager-archive.cxx @@ -430,6 +430,7 @@ namespace bpkg add ("include_arch=include/"); add ("share=data_root/share/"); add ("data=share/<private>/<project>/"); + add ("buildfile=share/build2/export/<project>/"); add ("doc=share/doc/<private>/<project>/"); add ("legal=doc/"); diff --git a/bpkg/system-package-manager-debian.cxx b/bpkg/system-package-manager-debian.cxx index 08767d3..8b27e37 100644 --- a/bpkg/system-package-manager-debian.cxx +++ b/bpkg/system-package-manager-debian.cxx @@ -2152,6 +2152,7 @@ namespace bpkg "config.install.include_arch='data_root/include/$(DEB_HOST_MULTIARCH)/<private>/'", "config.install.share=data_root/share/", "config.install.data=share/<private>/<project>/", + "config.install.buildfile=share/build2/export/<project>/", "config.install.doc=share/doc/<private>/<project>/", "config.install.legal=doc/", @@ -2213,11 +2214,17 @@ namespace bpkg // NOTE: keep consistent with the config.install.* values above. // + // We put exported buildfiles into the main package, which makes sense + // after some meditation: they normally contain rules and are bundled + // either with a tool (say, thrift), a module (say, libbuild2-thrift), or + // an add-on package (say, thrift-build2). + // dir_path bindir ("/usr/bin/"); dir_path sbindir ("/usr/sbin/"); dir_path etcdir ("/etc/"); dir_path incdir ("/usr/include/" + pd); dir_path incarchdir ("/usr/include/$(DEB_HOST_MULTIARCH)/" + pd); + //dir_path bfdir ("/usr/share/build2/export/"); dir_path libdir ("/usr/lib/$(DEB_HOST_MULTIARCH)/" + pd); dir_path pkgdir (libdir / dir_path ("pkgconfig")); dir_path sharedir ("/usr/share/" + pd); @@ -2295,6 +2302,8 @@ namespace bpkg // if (!gen_main) { + // Note: covers bfdir. + // for (auto p (ies.find_sub (sharedir)); p.first != p.second; ++p.first) { const path& f (p.first->first); @@ -3380,6 +3389,8 @@ namespace bpkg // if (gen_main) { + // Note: covers bfdir. + // for (auto p (ies.find_sub (sharedir)); p.first != p.second; ) { const path& f ((p.first++)->first); diff --git a/bpkg/system-package-manager-fedora.cxx b/bpkg/system-package-manager-fedora.cxx index 4034932..6862e93 100644 --- a/bpkg/system-package-manager-fedora.cxx +++ b/bpkg/system-package-manager-fedora.cxx @@ -2588,6 +2588,7 @@ namespace bpkg "config.install.include_arch=include/", "config.install.share=%{_datadir}/", "config.install.data=share/<private>/<project>/", + "config.install.buildfile=share/build2/export/<project>/", "config.install.doc=%{_docdir}/<private>/<project>/", "config.install.legal=%{_licensedir}/<private>/<project>/", @@ -2627,11 +2628,17 @@ namespace bpkg // Installed entry directories for sorting out the installed files into // the %files sections of the sub-packages. // + // We put exported buildfiles into the main package, which makes sense + // after some meditation: they normally contain rules and are bundled + // either with a tool (say, thrift), a module (say, libbuild2-thrift), or + // an add-on package (say, thrift-build2). + // dir_path bindir; dir_path sbindir; dir_path libexecdir; dir_path confdir; dir_path incdir; + dir_path bfdir; dir_path libdir; dir_path pkgdir; // Not queried, set as libdir/pkgconfig/. dir_path sharedir; @@ -2757,7 +2764,9 @@ namespace bpkg licensedir = pop_dir () / pd; mandir = pop_dir (); docdir = pop_dir () / pd; - sharedir = pop_dir () / pd; + sharedir = pop_dir (); + bfdir = sharedir / dir_path ("build2/export"); + sharedir /= pd; libdir = pop_dir () / pd; pkgdir = libdir / dir_path ("pkgconfig"); incdir = pop_dir () / pd; @@ -2916,6 +2925,15 @@ namespace bpkg << os_release.name_id << " name mapping in package manifest"; } } + + for (auto p (ies.find_sub (bfdir)); p.first != p.second; ++p.first) + { + const path& f (p.first->first); + + fail << "binless library " << pn << ' ' << pv << " installs " << f << + info << "consider specifying -common package in explicit " + << os_release.name_id << " name mapping in package manifest"; + } } if (verb >= 3) @@ -4026,6 +4044,8 @@ namespace bpkg // establish ownership of the sharedir/<private>/ directory (similar // to what we do for libdir/<private>/ above). // + // @@ TODO: same for bfdir? + // string* private_owner (nullptr); string& fs (!st.common.empty () ? common : main); |