Skip to content

Commit 2e431ff

Browse files
committed
new: dev: initial commit of build skeleton and spec file
Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
1 parent c2e991b commit 2e431ff

File tree

9 files changed

+289
-21
lines changed

9 files changed

+289
-21
lines changed

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Set default behaviour to automatically normalize line endings.
2+
* text=auto
3+
4+
# Force batch scripts to always use CRLF line endings so that if a repo is
5+
# accessed in Windows via a file share from Linux, the scripts will work.
6+
*.{cmd,[cC][mM][dD]} text eol=crlf
7+
*.{bat,[bB][aA][tT]} text eol=crlf
8+
9+
# Force bash scripts to always use LF line endings so that if a repo is
10+
# accessed in Unix via a file share from Windows, the scripts will work.
11+
*.sh text eol=lf

.github/workflows/diskcache.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: RPMs
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- master
9+
10+
jobs:
11+
build_rpms:
12+
timeout-minutes: 30
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
name: [centos9, rocky9]
17+
include:
18+
- name: centos9
19+
image: quay.io/centos/centos:stream9
20+
- name: rocky9
21+
image: quay.io/rockylinux/rockylinux:9
22+
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: read
26+
container:
27+
image: ${{ matrix.image }}
28+
29+
permissions:
30+
contents: read
31+
defaults:
32+
run:
33+
shell: bash
34+
env:
35+
PYTHONIOENCODING: utf-8
36+
37+
steps:
38+
- uses: actions/checkout@v4
39+
with:
40+
fetch-depth: 0
41+
42+
# Work-around for https://github.com/actions/runner-images/issues/6775
43+
- name: Change Owner of Container Working Directory
44+
if: matrix.image
45+
run: chown root.root .
46+
47+
- name: Install deps for rpm builds (centos/rocky)
48+
run: |
49+
bash scripts/install_deps_el9.sh
50+
51+
- name: Build bdist_rpm pkgs
52+
run: |
53+
NAME="diskcache" make packages
54+
55+
- name: Upload rpm files
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: diskcache-${{ needs.get_version.outputs.version }}.${{ matrix.name }}-rpms"
59+
path: |
60+
tmp/RPMS/*/*.rpm
61+
tmp/SRPMS/*.rpm

.gitignore

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# generated/user files
31+
src/gitchangelog/_version.py
32+
33+
# PyInstaller
34+
# Usually these files are written by a python script from a template
35+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
36+
*.manifest
37+
*.spec
38+
39+
# Installer logs
40+
pip-log.txt
41+
pip-delete-this-directory.txt
42+
43+
# Unit test / coverage reports
44+
htmlcov/
45+
.tox/
46+
.nox/
47+
.coverage
48+
.coverage.*
49+
.cache
50+
nosetests.xml
51+
coverage.xml
52+
*.cover
53+
*.py,cover
54+
.hypothesis/
55+
.pytest_cache/
56+
57+
# Translations
58+
*.mo
59+
*.pot
60+
61+
# Django stuff:
62+
*.log
63+
local_settings.py
64+
db.sqlite3
65+
db.sqlite3-journal
66+
67+
# Flask stuff:
68+
instance/
69+
.webassets-cache
70+
71+
# Scrapy stuff:
72+
.scrapy
73+
74+
# Sphinx documentation
75+
docs/_build/
76+
docs/source/api/
77+
78+
# PyBuilder
79+
target/
80+
81+
# Jupyter Notebook
82+
.ipynb_checkpoints
83+
84+
# IPython
85+
profile_default/
86+
ipython_config.py
87+
88+
# pyenv
89+
.python-version
90+
91+
# pipenv
92+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
94+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
95+
# install all needed dependencies.
96+
#Pipfile.lock
97+
98+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
99+
__pypackages__/
100+
101+
# Celery stuff
102+
celerybeat-schedule
103+
celerybeat.pid
104+
105+
# SageMath parsed files
106+
*.sage.py
107+
108+
# Environments
109+
.env
110+
.venv
111+
env/
112+
venv/
113+
ENV/
114+
env.bak/
115+
venv.bak/
116+
117+
# Spyder project settings
118+
.spyderproject
119+
.spyproject
120+
121+
# Rope project settings
122+
.ropeproject
123+
124+
# mkdocs documentation
125+
/site
126+
127+
# mypy
128+
.mypy_cache/
129+
.dmypy.json
130+
dmypy.json
131+
132+
# Pyre type checker
133+
.pyre/

LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
LICENSES/MIT.txt

LICENSES/MIT.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) <year> <copyright holders>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Makefile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Prepare variables
2+
ifeq ($(TMP),)
3+
TMP := $(CURDIR)/tmp
4+
endif
5+
6+
ifndef NAME
7+
$(error NAME is not set)
8+
endif
9+
10+
# Define special targets
11+
all: packages
12+
13+
# Temporary directory, include .fmf to prevent exploring tests there
14+
tmp:
15+
mkdir -p $(TMP)/.fmf
16+
17+
# RPM packaging
18+
tarball: tmp
19+
mkdir -p $(TMP)/SOURCES
20+
spectool -g -R $(NAME).spec
21+
rpm: tarball
22+
rpmbuild --define '_topdir $(TMP)' -bb $(NAME).spec
23+
srpm: tarball
24+
rpmbuild --define '_topdir $(TMP)' -bs $(NAME).spec
25+
packages: rpm srpm
26+
27+
clean:
28+
rm -rf $(TMP)

README.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
el9 RPM toolbox
2+
===============
3+
4+
This repository includes "extra" prebuilt RPM packages and spec files for
5+
various tools like diskcache and pygtail.
6+
7+
RPM builds are done automatically with GitHub Actions. The packages are
8+
uploaded to the `release section`_ each time there is a new version (tag).
9+
The artifacts are also available in the artifacts of each GitHub Action.
10+
11+
.. _release section: https://github.com/VCTLabs/el9-rpm-toolbox/releases
12+
13+
However, there are some limitations to using the artifacts directly:
14+
15+
* Downloading of build artifacts in GitHub Ations currently requires a
16+
GitHub account
17+
* Blobs in build artifacts are zipped by the GitHub frontend by default,
18+
even zip files themselves! Build artifact zips may contain other zip
19+
files
20+
* Build artifacts will expire after some time
21+
22+
Therefore, it is recommended to download the binaries from the release
23+
section. This repo is intended primarily for Python project dependencies;
24+
issues requesting new packages will be considered based on time available,
25+
however, Pull Requests are the preferred mechanism for contributions.
26+
27+

REUSE.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version = 1
2+
3+
[[annotations]]
4+
path = "**"
5+
SPDX-FileCopyrightText = [
6+
"2025 Stephen Arnold <sarnold@vctlabs.com>",
7+
]
8+
SPDX-License-Identifier = "MIT"

scripts/install_deps_el9.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
set -e
4+
set -o pipefail
5+
set -x
6+
7+
dnf install -y 'dnf-command(config-manager)'
8+
dnf config-manager --set-enabled crb
9+
dnf install -y dnf-utils epel-release
10+
dnf search --refresh epel
11+
dnf install -y sudo git make wget rpm-build rpm-devel rpmlint rpmdevtools python3-pip

0 commit comments

Comments
 (0)