-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: valid, reproducible RPM package
- Loading branch information
1 parent
f130230
commit 1672c1c
Showing
6 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[rpkg] | ||
user_macros = "${git_props:root}/rpkg.macros" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
function studio-cli_version { | ||
if [ "$GITHUB_REF_NAME" = "" ]; then | ||
echo "0.1.0+$(git rev-parse --short HEAD)" | ||
else | ||
echo "$GITHUB_REF_NAME" | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-latest}" | ||
|
||
FROM registry.fedoraproject.org/fedora:${FEDORA_MAJOR_VERSION} AS builder | ||
|
||
ENV OUTPUT_ROOT=/app/output | ||
|
||
WORKDIR /app | ||
|
||
ADD . /app | ||
|
||
RUN dnf install \ | ||
--disablerepo='*' \ | ||
--enablerepo='fedora,updates' \ | ||
--setopt install_weak_deps=0 \ | ||
--nodocs \ | ||
--assumeyes \ | ||
'dnf-command(builddep)' \ | ||
rpkg \ | ||
rpm-build && \ | ||
mkdir -p $OUTPUT_ROOT/{,output,atomic-studio/rpms} && \ | ||
rpkg spec --outdir "$OUTPUT_ROOT" && \ | ||
dnf builddep -y output/studio-cli.spec && \ | ||
rpkg local --outdir "$OUTPUT_ROOT/output" && \ | ||
mv ${OUTPUT_ROOT}/output/noarch/* "${OUTPUT_ROOT}/atomic-studio/rpms" | ||
|
||
FROM scratch | ||
|
||
ENV OUTPUT_ROOT=/app/output | ||
COPY --from=builder ${OUTPUT_ROOT}/atomic-studio/rpms /rpms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Name: studio-cli | ||
Vendor: atomic-studio-org | ||
Version: {{{ studio-cli_version }}} | ||
Release: 0%{?dist} | ||
Summary: Manager for Atomic Studio | ||
License: Apache-2.0 | ||
URL: https://github.com/%{vendor}/%{name} | ||
# Detailed information about the source Git repository and the source commit | ||
# for the created rpm package | ||
VCS: {{{ git_dir_vcs }}} | ||
|
||
# git_dir_pack macro places the repository content (the source files) into a tarball | ||
# and returns its filename. The tarball will be used to build the rpm. | ||
Source: {{{ git_dir_pack }}} | ||
|
||
BuildArch: noarch | ||
Supplements: podman | ||
|
||
%description | ||
Manages Atomic Studio installations | ||
|
||
%global debug_package %{nil} | ||
%global pname studio | ||
|
||
%prep | ||
{{{ git_dir_setup_macro }}} | ||
|
||
%build | ||
|
||
%install | ||
mkdir -p %{_libexecdir}/studio-cli | ||
install -D -m 0755 src/studio %{buildroot}%{_bindir}/%{pname} | ||
cp -r src/libexec/* %{_libexecdir}/studio-cli | ||
|
||
%files | ||
%license LICENSE | ||
%attr(0755,root,root) %{_bindir}/%{pname} | ||
|
||
%changelog | ||
%autochangelog |