-
Notifications
You must be signed in to change notification settings - Fork 525
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add rpm build rules according to badfish example (#565)
- Loading branch information
Showing
6 changed files
with
127 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
name: RPM build in Fedora Copr | ||
|
||
# build new transitions rpms only when tagged or when working on dev-rpm | ||
on: | ||
push: | ||
branches: | ||
- "dev-rpm" | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
name: Submit a build from Fedora container | ||
container: fedora:latest | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out proper version of sources | ||
uses: actions/checkout@v1 | ||
|
||
- name: Install API token for copr-cli | ||
env: | ||
API_TOKEN_CONTENT: ${{ secrets.COPR_API_TOKEN }} | ||
run: | | ||
mkdir -p "$HOME/.config" | ||
echo "$API_TOKEN_CONTENT" > "$HOME/.config/copr" | ||
- name: Install tooling for source RPM build | ||
run: | | ||
dnf -y install @development-tools @rpm-development-tools copr-cli make | ||
- name: Build the source RPM | ||
run: | | ||
cd rpm && chmod +x ./build-helper && make srpm | ||
- name: Submit the build by uploading the source RPM | ||
run: | | ||
copr build aleneum/python3-transitions rpm/*.src.rpm |
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,5 @@ | ||
*.spec | ||
*.tar.gz | ||
*.src.rpm | ||
noarch/ | ||
python3-transitions.spec/ |
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,36 @@ | ||
PYTHON := python3 | ||
BUILD_HELPER := ./build-helper | ||
|
||
VERSION = $(shell $(BUILD_HELPER) --version) | ||
RELEASE = $(shell $(BUILD_HELPER) --release) | ||
DATE = $(shell date +'%a %b %d %Y') | ||
TARBALL = python3-transitions-$(VERSION).tar.gz | ||
|
||
all: python3-transitions.spec python3-transitions-$(VERSION).tar.gz | ||
|
||
.PHONY: $(TARBALL) | ||
$(TARBALL): | ||
rm -f $(TARBALL) | ||
( cd .. && git archive --prefix python3-transitions-$(VERSION)/ HEAD ) \ | ||
| gzip > "$@" | ||
|
||
python3-transitions.spec: python3-transitions.spec.tpl ../setup.py | ||
@echo " GEN $@" ; \ | ||
sed -e "s|@VERSION@|$(VERSION)|g" \ | ||
-e "s|@RELEASE@|$(RELEASE)|g" \ | ||
-e "s|@DATE@|$(DATE)|g" \ | ||
$< > $@.output ; \ | ||
mv "$@.output" "$@" # move when successful | ||
|
||
srpm: all | ||
dir=`pwd` ; \ | ||
rm -f *.src.rpm ; \ | ||
rpmbuild --define "_sourcedir $$dir" \ | ||
--define "_rpmdir $$dir" \ | ||
--define "_builddir $$dir" \ | ||
--define "_specdir $$dir" \ | ||
--define "_srcrpmdir $$dir" \ | ||
-bs *.spec | ||
|
||
clean: | ||
rm -rf *.src.rpm *.tar.gz *.spec noarch |
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,10 @@ | ||
#! /bin/sh | ||
|
||
case $1 in | ||
--version) | ||
cd .. ; ${PYTHON-python3} setup.py --version | ||
;; | ||
--release) | ||
echo "git.$(date +"%Y%m%d_%H%M%S")" | ||
;; | ||
esac |
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,39 @@ | ||
%global sum A lightweight, object-oriented finite state machine implementation in Python with many extensions | ||
%global desc \ | ||
A lightweight, object-oriented state machine implementation in Python with many extensions. \ | ||
Compatible with Python 2.7+ and 3.0+. | ||
|
||
|
||
Name: python3-transitions | ||
Version: @VERSION@ | ||
Release: @RELEASE@%{?dist} | ||
Summary: %{sum} | ||
|
||
License: MIT | ||
URL: https://github.com/pytransitions/transitions | ||
Source0: %{url}/archive/v%{version}/python3-transitions-%{version}.tar.gz | ||
|
||
BuildArch: noarch | ||
BuildRequires: python3-setuptools | ||
BuildRequires: python3-devel | ||
|
||
%description | ||
%{desc} | ||
|
||
%prep | ||
%autosetup -n %{name}-%{version} | ||
|
||
%build | ||
%py3_build | ||
|
||
%install | ||
%py3_install | ||
|
||
%files -n %{name} | ||
%doc README.md | ||
%license LICENSE | ||
%{python3_sitelib}/* | ||
|
||
%changelog | ||
* @DATE@ Alexander Neumann <aleneum@gmail.com> - @VERSION@-@RELEASE@ | ||
- built from upstream, changelog ignored |