initial commit

This commit is contained in:
askiiart 2025-01-06 16:22:50 -06:00
commit e51c7c25fd
Signed by untrusted user who does not match committer: askiiart
GPG key ID: 6A32977DAF31746A
3 changed files with 72 additions and 0 deletions

23
README.md Normal file
View file

@ -0,0 +1,23 @@
# How to package RPMS
A guide by someone who doesn't know what they're doing.
We'll be using [polycat](https://github.com/2IMT/polycat) as an example, a fairly simple C++ program
## Setup
First off, you're gonna want to install `fedora-packager` and `rpmdevtools`.
```sh
sudo dnf install fedora-packager rpmdevtools
```
Next, set up the directories for RPM packaging development.
## Resources
- [Macros](https://docs.fedoraproject.org/en-US/packaging-guidelines/RPMMacros/) (the ones that are vabiables)
- Build systems
- [CMake](https://docs.fedoraproject.org/en-US/packaging-guidelines/CMake/)
- [Meson](https://docs.fedoraproject.org/en-US/packaging-guidelines/Meson/)
-

37
polycat.spec Normal file
View file

@ -0,0 +1,37 @@
Name: polycat
Version: r93.0c836d5
Release: 1%{?dist}
Summary: runcat module for polybar (or waybar)
License: MIT
URL: https://github.com/2IMT/polycat
BuildRequires: cmake make g++ git tar
Requires: glibc
%description
A runcat module for polybar (or waybar) written in C++
%prep
git clone --recursive https://github.com/2IMT/polycat.git --depth 1 --shallow-submodules
%build
cd ./polycat/
%cmake -DCMAKE_BUILD_TYPE=RELEASE
%cmake_build
%install
cd ./polycat/
mkdir -p %{buildroot}%{_bindir}
install -Dm755 ./redhat-linux-build/polycat %{buildroot}%{_bindir}/polycat
mkdir -p %{buildroot}%{datadir}/fonts/polycat/
install -Dm644 ./res/polycat.ttf %{buildroot}%{_datadir}/fonts/polycat/polycat.ttf
%files
/usr/bin/polycat
/usr/share/fonts/polycat/polycat.ttf
%changelog
* Mon Jan 06 2025 askiiart <dev@askiiart.net>
- First version

12
update-version.sh Executable file
View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -ex
DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
cd $DIR
git clone https://github.com/2IMT/polycat.git
cd polycat/
VERSION=$(printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)")
cd ..
rm -rf polycat/
sed -i "s/Version:.*/Version: $VERSION/g" polycat.spec