Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions alibuild.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Name: alibuild
Version: %{?version}%{!?version:0}
Release: 1%{?dist}
Summary: ALICE Build Tool
License: GPL-3.0-or-later
URL: https://github.com/alisw/alibuild
Source0: alibuild-%{version}-py3-none-any.whl

BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: python3-pip

Requires: python3
Requires: git
Requires: python3-pyyaml
Requires: python3-requests
Requires: python3-distro

%description
ALICE Build Tool for building HEP software.

%prep
%build

%install
%{python3} -m pip install --root %{buildroot} --prefix %{_prefix} --no-deps --no-index %{SOURCE0}

%files
%{python3_sitelib}/alibuild_helpers/
%{python3_sitelib}/alibuild-*.dist-info/
%{_bindir}/aliBuild
%{_bindir}/alienv
%{_bindir}/aliDoctor
%{_bindir}/aliDeps
%{_bindir}/pb

%changelog
* Tue Jan 14 2025 ALICE Offline <alice-offline@cern.ch>
- See https://github.com/alisw/alibuild/releases for release notes
23 changes: 23 additions & 0 deletions build-rpm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -e

VERSION=${1:?Usage: $0 <version>}
SPEC=alibuild.spec

BUILDDIR=$(mktemp -d)
trap 'rm -rf "$BUILDDIR"' EXIT

echo "Building alibuild ${VERSION} wheel from current directory..."

# Build wheel to SOURCES
mkdir -p "$BUILDDIR/SOURCES"
SETUPTOOLS_SCM_PRETEND_VERSION="${VERSION}" pip wheel --no-deps --wheel-dir "$BUILDDIR/SOURCES" .

# Build RPM
rpmbuild -ba "${SPEC}" \
--define "version ${VERSION}" \
--define "_topdir ${BUILDDIR}"

# Copy RPMs to current directory
cp "$BUILDDIR/RPMS"/*/*.rpm "$BUILDDIR/SRPMS"/*.rpm .
echo "Done. RPMs copied to current directory."
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ alibuild_helpers = ['build_template.sh']

[tool.setuptools.packages.find]
where = ["."]
exclude = ["yaml"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated to the RPMs no? Please open a separate PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using rpmbuild I get errors for unused packages inside the RPM, that's why I added it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the whole PR ready to be tested and merged? If yes, no need to change. If not, all I am saying this is a good cleanup in any case and we can separately merge it already now.

exclude = ["debian", "docs", "docs.*", "templates", "tests", "tests.*"]

[tool.setuptools.dynamic]
readme = {file = ["README.rst"]}