forked from jesec/rtorrent
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bazel: add a build target for RPM package
- Loading branch information
Showing
6 changed files
with
67 additions
and
7 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
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 |
---|---|---|
|
@@ -29,7 +29,7 @@ jobs: | |
- name: Tag release | ||
run: | | ||
release=`echo ${{ steps.get_version.outputs.VERSION }} | cut -d'-' -f2` | ||
sed s/-jc+master/-jc-$release/ BUILD.bazel > BUILD.versioned | ||
cat BUILD.bazel | sed s/-jc+master/-jc-$release/ | sed s/jc+master/jc.$release/ > BUILD.versioned | ||
cat BUILD.versioned | ||
mv BUILD.versioned BUILD.bazel | ||
|
@@ -74,6 +74,11 @@ jobs: | |
name: rtorrent-deb-${{ matrix.arch }} | ||
path: root/rtorrent/dist/rtorrent-deb.deb | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: rtorrent-rpm-${{ matrix.arch }} | ||
path: root/rtorrent/dist/rtorrent-rpm.rpm | ||
|
||
docker-manifest: | ||
needs: docker | ||
runs-on: ubuntu-20.04 | ||
|
@@ -122,6 +127,8 @@ jobs: | |
cp artifacts/rtorrent-linux-arm64/rtorrent rtorrent-linux-arm64 | ||
cp artifacts/rtorrent-deb-amd64/rtorrent-deb.deb rtorrent-linux-amd64.deb | ||
cp artifacts/rtorrent-deb-arm64/rtorrent-deb.deb rtorrent-linux-arm64.deb | ||
cp artifacts/rtorrent-rpm-amd64/rtorrent-rpm.rpm rtorrent-linux-amd64.rpm | ||
cp artifacts/rtorrent-rpm-arm64/rtorrent-rpm.rpm rtorrent-linux-arm64.rpm | ||
- name: Create Release | ||
uses: softprops/action-gh-release@v1 | ||
|
@@ -132,7 +139,9 @@ jobs: | |
files: | | ||
rtorrent-linux-amd64 | ||
rtorrent-linux-amd64.deb | ||
rtorrent-linux-amd64.rpm | ||
rtorrent-linux-arm64 | ||
rtorrent-linux-arm64.deb | ||
rtorrent-linux-arm64.rpm | ||
rtorrent.rc | ||
[email protected] |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test") | ||
load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") | ||
load("@rules_pkg//:pkg.bzl", "pkg_deb", "pkg_tar") | ||
load("@rules_pkg//:rpm.bzl", "pkg_rpm") | ||
|
||
config_setting( | ||
name = "opt", | ||
|
@@ -151,7 +152,7 @@ pkg_tar( | |
) | ||
|
||
pkg_tar( | ||
name = "rtorrent-deb-data", | ||
name = "rtorrent-pkg-data", | ||
extension = "tar.gz", | ||
deps = [ | ||
":rtorrent-bin", | ||
|
@@ -167,10 +168,19 @@ pkg_deb( | |
"/etc/rtorrent/rtorrent.rc", | ||
"/etc/systemd/system/[email protected]", | ||
], | ||
data = ":rtorrent-deb-data", | ||
data = ":rtorrent-pkg-data", | ||
description = "a stable and high-performance BitTorrent client", | ||
homepage = "https://github.com/jesec/rtorrent", | ||
maintainer = "Jesse Chan <[email protected]>", | ||
package = "rtorrent", | ||
version = "0.9.8-jc+master", | ||
) | ||
|
||
pkg_rpm( | ||
name = "rtorrent-rpm", | ||
architecture = "all", | ||
data = [":rtorrent-pkg-data"], | ||
release = "jc+master", | ||
spec_file = "doc/rtorrent.spec", | ||
version = "0.9.8", | ||
) |
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
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
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,28 @@ | ||
Name: rtorrent | ||
License: GPLv2+ with exceptions | ||
Version: 0.9.8 | ||
Release: jc+master | ||
Summary: a stable and high-performance BitTorrent client | ||
URL: https://github.com/jesec/rtorrent | ||
|
||
%description | ||
a stable and high-performance BitTorrent client | ||
|
||
%build | ||
tar xf bazel-out/*/bin/rtorrent-pkg-data.tar.gz | ||
|
||
%install | ||
rm -rf %{buildroot} | ||
|
||
mkdir -p %{buildroot}%{_bindir}/ | ||
install -m 755 ./usr/bin/rtorrent %{buildroot}%{_bindir}/rtorrent | ||
|
||
cp -rf ./etc %{buildroot}/ | ||
|
||
%clean | ||
rm -rf %{buildroot} | ||
|
||
%files | ||
%attr(0755, root, root) %{_bindir}/rtorrent | ||
%attr(0644, root, root) /etc/systemd/system/[email protected] | ||
%attr(0644, root, root) /etc/rtorrent/rtorrent.rc |