%bcond_without check %bcond_without bootstrap %bcond_without bundle_libodb %bcond_with network_checks %bcond_with static Name: build2 Version: 0.10.0 Release: 1%{?dist} Summary: Cross-platform build toolchain for developing and packaging C++ code License: MIT URL: https://build2.org/ Source0: https://pkg.cppget.org/1/alpha/%{name}/%{name}-%{version}.tar.gz Source1: https://pkg.cppget.org/1/alpha/%{name}/libbutl-%{version}.tar.gz Source2: https://pkg.cppget.org/1/alpha/%{name}/libbpkg-%{version}.tar.gz Source3: https://pkg.cppget.org/1/alpha/%{name}/bpkg-%{version}.tar.gz Source4: https://pkg.cppget.org/1/alpha/%{name}/bdep-%{version}.tar.gz Source5: macros.%{name} # The latest official release of libodb is not compatible with build2 %if %{with bundle_libodb} %global libodb_bundle_version 2.5.0-b.13 Source100: https://pkg.cppget.org/1/beta/odb/libodb-%{libodb_bundle_version}.tar.gz Source101: https://pkg.cppget.org/1/beta/odb/libodb-sqlite-%{libodb_bundle_version}.tar.gz %endif BuildRequires: gcc-c++ BuildRequires: libpkgconf-devel %if %{with bootstrap} BuildRequires: make BuildRequires: pkgconf %else BuildRequires: build2 %endif %if %{with check} # build2, bpkg BuildRequires: bzip2 # install: build2; sha256sum: build2, bpkg, bdep BuildRequires: coreutils # libbutl, build2 BuildRequires: diffutils %if %{with network_checks} # libbutl, bpkg, bdep BuildRequires: curl %endif # build2, bpkg, bdep BuildRequires: git # build2, bpkg BuildRequires: gzip # libbutl, bpkg BuildRequires: openssl # build2, bpkg BuildRequires: tar # build2, bpkg BuildRequires: xz %endif Requires: bzip2 Requires: coreutils Requires: diffutils Requires: git Requires: gzip Requires: tar Requires: xz Recommends: %{name}-rpm-macros %description %{name} is an open source (MIT), cross-platform build toolchain for developing and packaging C++ code. It is a hierarchy of tools that includes the build system, package dependency manager (for package consumption), and project dependency manager (for project development). Key features: * Next-generation, Cargo-like integrated build toolchain for C++. * Covers entire project life cycle: creation, development, testing, and delivery. * Uniform and consistent interface across all platforms and compilers. * Fast, multi-threaded build system with parallel building and testing. * Archive and version control-based package repositories. * Dependency-free, all you need is a C++ compiler. %package -n %{name}-doc Summary: %{name} documentation BuildArch: noarch %description -n %{name}-doc This package contains the %{name} documentation. %package -n libbutl Summary: %{name} utility library # BSD-2 clause: # libbutl/sha256c.c # libbutl/strptime.c # libbutl/timelocal.c # libbutl/timelocal.h # BSD-3 clause: # libbutl/sha1.c License: MIT and BSD Requires: curl Requires: openssl %description -n libbutl This package contains the %{name} utility library. %package -n libbutl-devel Summary: Development files for %{name} utility library License: MIT and BSD Requires: libbutl%{?_isa} = %{version}-%{release} %description -n libbutl-devel The libbutl-devel package contains libraries and header files for developing applications that use libbutl. %if %{with static} %package -n libbutl-static Summary: Static libraries for %{name} utility library License: MIT and BSD Requires: libbutl-devel%{?_isa} = %{version}-%{release} %description -n libbutl-static The libbutl-static package contains static libraries for developing applications that use libbutl. %endif %package -n libbpkg Summary: %{name} package dependency manager library %description -n libbpkg This package contains the %{name} package dependency manager library. %package -n libbpkg-devel Summary: Development files for %{name} package dependency manager library Requires: libbpkg%{?_isa} = %{version}-%{release} %description -n libbpkg-devel The libbpkg-devel package contains libraries and header files for developing applications that use libbpkg. %if %{with static} %package -n libbpkg-static Summary: Static libraries for %{name} package dependency manager library Requires: libbpkg-devel%{?_isa} = %{version}-%{release} %description -n libbpkg-static The libbpkg-static package contains static libraries for developing applications that use libbpkg. %endif %package -n bpkg Summary: %{name} package dependency manager %if %{with bundle_libodb} Provides: bundled(libodb) = %{libodb_bundle_version} Provides: bundled(libodb-sqlite) = %{libodb_bundle_version} %else BuildRequires: pkgconfig(libodb) BuildRequires: pkgconfig(libodb-sqlite) %endif BuildRequires: pkgconfig(sqlite3) Requires: %{name}%{?_isa} = %{version}-%{release} Requires: bzip2 Requires: coreutils Requires: curl Requires: git Requires: gzip Requires: openssl Requires: tar Requires: xz %description -n bpkg The %{name} package dependency manager is used to manipulate build configurations, packages, and repositories. %package -n bpkg-doc Summary: bpkg documentation BuildArch: noarch %description -n bpkg-doc This package contains the bpkg documentation. %package -n bdep Summary: %{name} project dependency manager %if %{with bundle_libodb} Provides: bundled(libodb) = %{libodb_bundle_version} Provides: bundled(libodb-sqlite) = %{libodb_bundle_version} %else BuildRequires: pkgconfig(libodb) BuildRequires: pkgconfig(libodb-sqlite) %endif BuildRequires: pkgconfig(sqlite3) Requires: %{name}%{?_isa} = %{version}-%{release} Requires: bpkg%{?_isa} = %{version}-%{release} Requires: coreutils Requires: curl Requires: git %description -n bdep The %{name} project dependency manager is used to manage the dependencies of a project during development. %package -n bdep-doc Summary: bdep documentation BuildArch: noarch %description -n bdep-doc This package contains the bdep documentation. %package -n %{name}-rpm-macros Summary: %{name} RPM macros BuildArch: noarch Requires: %{name}%{?_isa} = %{version}-%{release} %description -n %{name}-rpm-macros This package contains the %{name} RPM macros. %prep %if ! %{with bundle_libodb} %setup -q -c -n %{name}-toolchain-%{version} -a 1 -a 2 -a 3 -a 4 %else %setup -q -c -n %{name}-toolchain-%{version} -a 1 -a 2 -a 3 -a 4 -a 100 -a 101 %endif mv libbutl-%{version} %{name}-%{version} # fix PostScript documentation character encoding for f in $(find -name "*.ps"); do encoding=$(file -bi "${f}" | cut -f 2 -d';' | cut -f 2 -d'=') if [ "${encoding}" != "utf-8" ]; then iconv -f "${encoding}" -t utf-8 "${f}" -o "${f}.utf8" mv "${f}.utf8" "${f}" fi done %build # Define basic installation configuration. Note that this does not include: # %%{_sysconfdir} /etc # %%{_libexecdir} %%{_exec_prefix}/libexec # %%{_sharedstatedir} /var/lib # %%{_datadir} %%{_prefix}/share # %%{_infodir} /usr/share/info # %%{_localstatedir} /var # config.install.data and config.install.libexec seems to default to a value # like %%{_datadir}/${project} and %%{_libexecdir}/${project} so that data files # are not installed directly in %%{_datadir} or %%{_libexecdir} # By specifying the installation location, the default file install mode will be # 644, so we should set mode 755 for executable target install directories # explicitly %global config_install \\\ config.install.root=%{_prefix} \\\ config.install.exec_root=%{_exec_prefix} \\\ config.install.bin=%{_bindir} \\\ config.install.sbin=%{_sbindir} \\\ config.install.include=%{_includedir} \\\ config.install.lib=%{_libdir} \\\ config.install.man=%{_mandir} \\\ config.install.pkgconfig=%{_libdir}/pkgconfig \\\ config.install.bin.mode=755 \\\ config.install.sbin.mode=755 \\\ config.install.lib.mode=755 \\\ config.install.chroot=%{?buildroot} %if %{with bootstrap} CXX=g++ CXXFLAGS="${CXXFLAGS:-%{build_cxxflags}}" LDFLAGS="${LDFLAGS:-%{build_ldflags}}" pushd %{name}-%{version} # bootstrap, phase 1: minimal build system export CXX export CXXFLAGS export LDFLAGS %make_build -f bootstrap.gmake # bootstrap, phase 2: statically linked build system build2/b-boot \ config.bin.lib=static \ config.cxx=${CXX} \ config.cxx.coptions="${CXXFLAGS}" \ config.cxx.poptions+="$(pkgconf --cflags-only-I libpkgconf)" \ config.cxx.loptions+="$(pkgconf --libs-only-L libpkgconf) ${LDFLAGS}" \ build2/exe{b} mv build2/b build2/b-boot # configure and build final, shared library build system build2/b-boot configure \ %if ! %{with static} config.bin.lib=shared \ %endif config.cxx=${CXX} \ config.cxx.coptions="${CXXFLAGS}" \ config.cxx.loptions="${LDFLAGS}" \ %{config_install} build2/b-boot popd %if %{with bundle_libodb} # configure libodb to build static and not install %{name}-%{version}/build2/b configure: \ libodb-%{libodb_bundle_version}/ \ libodb-sqlite-%{libodb_bundle_version}/ \ config.bin.lib=static \ config.cxx=${CXX} \ config.cxx.coptions="${CXXFLAGS}" \ config.cxx.loptions="${LDFLAGS}" \ config.import.libodb="libodb-%{libodb_bundle_version}/" \ config.install=false %endif # configure bpkg and bdep and their dependencies %{name}-%{version}/build2/b configure: \ libbpkg-%{version}/ \ bpkg-%{version}/ \ bdep-%{version}/ \ %if ! %{with static} config.bin.lib=shared \ %endif config.cxx=${CXX} \ config.cxx.coptions="${CXXFLAGS}" \ config.cxx.loptions="${LDFLAGS}" \ %if %{with bundle_libodb} config.import.libodb="libodb-%{libodb_bundle_version}/" \ config.import.libodb_sqlite="libodb-sqlite-%{libodb_bundle_version}/" \ %endif config.import.libbutl="%{name}-%{version}/libbutl-%{version}/" \ config.import.libbpkg="libbpkg-%{version}/" \ %{config_install} # build bpkg and bdep %{name}-%{version}/build2/b bpkg-%{version}/ bdep-%{version}/ %else # ! %%{with bootstrap} %if %{with bundle_libodb} # configure libodb to build static and not install %build2 configure: \ libodb-%{libodb_bundle_version}/ \ libodb-sqlite-%{libodb_bundle_version}/ \ config.bin.lib=static \ config.import.libodb="libodb-%{libodb_bundle_version}/" \ config.install=false %endif # configure build2, bpkg, and bdep and their dependencies %build2_configure \ %{name}-%{version}/ \ libbpkg-%{version}/ \ bpkg-%{version}/ \ bdep-%{version}/ \ %if %{with static} config.bin.lib=both \ %endif %if %{with bundle_libodb} config.import.libodb="libodb-%{libodb_bundle_version}/" \ config.import.libodb_sqlite="libodb-sqlite-%{libodb_bundle_version}/" \ %endif config.import.libbutl="%{name}-%{version}/libbutl-%{version}/" \ config.import.libbpkg="libbpkg-%{version}/" # build build2, bpkg, and bdep b %{name}-%{version}/ bpkg-%{version}/ bdep-%{version}/ %endif %install %if %{with bootstrap} %{name}-%{version}/build2/b-boot install: \ %else b install: \ %endif %{name}-%{version}/libbutl-%{version}/ \ %{name}-%{version}/ \ libbpkg-%{version}/ \ bpkg-%{version}/ \ bdep-%{version}/ # move licenses from %%{_docdir} to %%{_defaultlicensedir} for p in %{name} libbutl libbpkg bpkg bdep; do mkdir -p %{buildroot}%{_defaultlicensedir}/${p} mv %{buildroot}%{_docdir}/${p}/LICENSE %{buildroot}%{_defaultlicensedir}/${p} done install -Dpm0644 %{SOURCE5} %{buildroot}%{_rpmmacrodir}/macros.%{name} %check %if %{with check} %if %{with bootstrap} export PATH=$PWD/bpkg-%{version}/bpkg:$PATH export PATH=$PWD/%{name}-%{version}/build2:$PATH export LD_LIBRARY_PATH=$PWD/libbpkg-%{version}/libbpkg:${LD_LIBRARY_PATH} export LD_LIBRARY_PATH=$PWD/%{name}-%{version}/libbutl-%{version}/libbutl:${LD_LIBRARY_PATH} %endif b test: \ %{name}-%{version}/libbutl-%{version}/ \ %{name}-%{version}/ \ libbpkg-%{version}/ \ bpkg-%{version}/ \ bdep-%{version}/ \ %if ! %{with network_checks} config.bdep.test.repository='' %endif %endif %ldconfig_scriptlets %files %dir %{_defaultlicensedir}/%{name} %dir %{_docdir}/%{name} %license %{_defaultlicensedir}/%{name}/LICENSE %doc %{_docdir}/%{name}/NEWS %doc %{_docdir}/%{name}/README %{_bindir}/b %{_mandir}/man1/b.1* %files -n %{name}-doc %dir %{_docdir}/%{name} %doc %{_docdir}/%{name}/%{name}-build-system-manual* %doc %{_docdir}/%{name}/b.xhtml %doc %{_docdir}/%{name}/manifest %files -n libbutl %dir %{_defaultlicensedir}/libbutl %license %{_defaultlicensedir}/libbutl/LICENSE %{_libdir}/libbutl-0.10.so %files -n libbutl-devel %dir %{_docdir}/libbutl %doc %{_docdir}/libbutl/manifest %doc %{_docdir}/libbutl/NEWS %doc %{_docdir}/libbutl/README %{_includedir}/libbutl %{_libdir}/libbutl.so %{_libdir}/pkgconfig/libbutl.shared.pc %if %{with static} %files -n libbutl-static %{_libdir}/libbutl.a %{_libdir}/pkgconfig/libbutl.static.pc %endif %files -n libbpkg %dir %{_defaultlicensedir}/libbpkg %license %{_defaultlicensedir}/libbpkg/LICENSE %{_libdir}/libbpkg-0.10.so %files -n libbpkg-devel %dir %{_docdir}/libbpkg %doc %{_docdir}/libbpkg/manifest %doc %{_docdir}/libbpkg/NEWS %doc %{_docdir}/libbpkg/README %{_includedir}/libbpkg %{_libdir}/libbpkg.so %{_libdir}/pkgconfig/libbpkg.shared.pc %if %{with static} %files -n libbpkg-static %{_libdir}/libbpkg.a %{_libdir}/pkgconfig/libbpkg.static.pc %endif %files -n bpkg %dir %{_defaultlicensedir}/bpkg %dir %{_docdir}/bpkg %license %{_defaultlicensedir}/bpkg/LICENSE %doc %{_docdir}/bpkg/NEWS %doc %{_docdir}/bpkg/README %{_bindir}/bpkg %{_mandir}/man1/bpkg.1* %{_mandir}/man1/bpkg-*1.* %files -n bpkg-doc %dir %{_docdir}/bpkg %doc %{_docdir}/bpkg/%{name}-package-manager-manual* %doc %{_docdir}/bpkg/bpkg*.xhtml %doc %{_docdir}/bpkg/manifest %files -n bdep %dir %{_defaultlicensedir}/bdep %dir %{_docdir}/bdep %license %{_defaultlicensedir}/bdep/LICENSE %doc %{_docdir}/bdep/NEWS %doc %{_docdir}/bdep/README %{_bindir}/bdep %{_mandir}/man1/bdep.1* %{_mandir}/man1/bdep-*1.* %files -n bdep-doc %dir %{_docdir}/bdep %doc %{_docdir}/bdep/bdep*.xhtml %doc %{_docdir}/bdep/manifest %files -n %{name}-rpm-macros %{_rpmmacrodir}/macros.%{name} %changelog * Tue Mar 19 2019 Matthew Krupcale - 0.10.0-1 - Update to 0.10.0 * Thu Feb 21 2019 Matthew Krupcale - 0.9.0-1 - Initial package