Skip to content

Commit

Permalink
Upload binary RPM too (#19)
Browse files Browse the repository at this point in the history
- Don't drop `-dev` prefix, but use `~dev`
- Set Prefix: /usr s.t. rpm is relocatabe: `rpm -i --prefix=...`
- Drop `<prefix>/lib/.build-id` files
- Remove sudo from `make install-suid`
  • Loading branch information
haampie committed Jul 19, 2022
1 parent 8f8c765 commit 2f544de
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on: [push, pull_request]
jobs:
rpm:
runs-on: ubuntu-20.04
container: registry.suse.com/bci/bci-base:15.4.27.8.3
container: registry.suse.com/bci/bci-base:15.3
steps:
- name: setup-environment
run: |
Expand All @@ -17,14 +17,14 @@ jobs:
- name: build-srpm
run: |
make rpm
sudo rpmbuild --rebuild ./rpm/SRPMS/squashfs-mount*.src.rpm --define "_topdir $(pwd)/rpm"
sudo rpm --install rpm/RPMS/x86_64/squashfs-mount*.rpm
cp rpm/SRPMS/* .
sudo rpmbuild --rebuild "$(find rpm/SRPMS -name '*.rpm' -type f -print -quit)" --define "_topdir $(pwd)/rpm"
sudo rpm --install "$(find rpm/RPMS -name '*.rpm' -type f -print -quit)"
find rpm -name '*.rpm' -type f -exec cp {} . \;
- name: upload-rpm
uses: actions/upload-artifact@v3
with:
name: rpm
path: squashfs-mount*.src.rpm
path: '*.rpm'

tag-release:
runs-on: ubuntu-20.04
Expand All @@ -38,5 +38,4 @@ jobs:
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files:
squashfs-mount*.src.rpm
files: '*.rpm'
2 changes: 1 addition & 1 deletion generate-rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ done
# Strip `-dev` from VERSION if exsists because RPM requires version numbers of
# the form X.Y.Z
# shellcheck disable=SC1003
version="$(sed 's\-.*$\\' VERSION)"
version="$(sed s/-/~/ VERSION)"
pkg_name="squashfs-mount-${version}"
mkdir -p "${build_path}"
(cd "${build_path}" && mkdir -p SOURCES BUILD RPMS SRPMS SPECS)
Expand Down
5 changes: 4 additions & 1 deletion squashfs-mount.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ Name: squashfs-mount
Version: SQMNT_VERSION
Release: 1%{?dist}
Summary: setuid mount squashfs utility.
Prefix: /usr

License: BSD3
URL: https://github.com/eth-cscs/squashfs-mount
Source0: %{name}-%{version}.tar.gz

%define _build_id_links none

%description
A small setuid binary that mounts a squashfs image in a mount namespace then executes a command as the normal user.

Expand All @@ -17,7 +20,7 @@ A small setuid binary that mounts a squashfs image in a mount namespace then exe
make %{?_smp_mflags}

%install
sudo make install-suid prefix=%{_prefix} DESTDIR=%{buildroot}
make install-suid prefix=%{_prefix} DESTDIR=%{buildroot}

%files
%license LICENSE
Expand Down

0 comments on commit 2f544de

Please sign in to comment.