Skip to content

Commit 52ad7fd

Browse files
authoredJul 7, 2024··
Merge pull request #34 from mcgillij/fix_issues
Fix issues with autoconf
2 parents 1347791 + 2f82984 commit 52ad7fd

File tree

11 files changed

+48
-47
lines changed

11 files changed

+48
-47
lines changed
 

Diff for: ‎.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ __pycache__/
33
*.py[cod]
44
*$py.class
55

6+
# PKGBUILD in the root that I use to build the package and the tarball/package
7+
PKGBUILD
8+
*.gz
9+
*.zst
610
# C extensions
711
*.so
812

Diff for: ‎INSTALL.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ At runtime: `python`, `numpy`, `click`, `rich` and `pyyaml`
66
Our standard builds use pyproject, mainly with poetry.
77

88
# Preparing the sources
9-
The dist files are template files, which means you must first `autoconf` them. You could also just `sed` all the `.in` files if you don't want to use autotools.
9+
The dist files are template files, which means you must first `autoconf` them. You could also just `sed` all the `.in` files if you don't want to use `autotools`.
1010

1111
``` sh
1212
git clone https://github.com/mcgillij/amdfan.git
1313
cd amdfan
1414

1515
autoconf
16-
./configure --prefix=/usr --libdir=/usr/lib
16+
./configure --prefix=/usr --libdir=/usr/lib --bindir=/usr/bin
1717
```
1818

1919
# Service files
@@ -23,19 +23,19 @@ There are two ways to obtain the systemd service file. One is available during r
2323
amdfan print-default --service | sudo tee /usr/lib/systemd/system/amdfan.service
2424
```
2525

26-
If you ran `./configure` succesfully, you'll also find the service files for OpenRC and systemd under `dist/${init}/`.
26+
If you ran `./configure` successfully, you'll also find the service files for OpenRC and systemd under `dist/${init}/`.
2727

2828

2929
# Configuration files
30-
Similiar to above, you can obtain the sources from the runtime. This is not necessary, as this file is generated automatically after the daemon runs for the first time.
30+
Similarly as above, you can obtain the sources from the runtime. This is not necessary, as this file is generated automatically after the daemon runs for the first time.
3131

3232
``` bash
3333
amdfan print-default --configuration | sudo tee /etc/amdfan.yml
3434
```
3535

3636

3737
# Executable files
38-
The executable files are contained within amdfan. This directory is a python module, and can either be loaded as `python -m amdgpu`. If you want to import the module, you may be interested in checking out `amdfan.commands`, which contains most of the subcommands.
38+
The executable files are contained within amdfan. This directory is a python module, and can either be loaded as `python -m amdfan`. If you want to import the module, you may be interested in checking out `amdfan.commands`, which contains most of the subcommands.
3939

4040
Otherwise, just use python-exec with something like
4141

@@ -50,7 +50,7 @@ if __name__ == '__main__':
5050

5151

5252
# Installing from PyPi
53-
You can also install amdfan from pypi using something like poetry.
53+
You can also install amdfan from PyPi using something like poetry.
5454

5555
``` bash
5656
poetry init

Diff for: ‎PKGBUILD

-27
This file was deleted.

Diff for: ‎README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ There are two ways to control your fans with Amdfan. Note that in order to contr
5656

5757
The recommended way is through a system service started at boot. This will control the fans based on the detected temperature at a given interval.
5858

59-
In case you don't want to use a service, you may also control the fans manually. While this is only adviced to do when first setting up your configuration, keep in mind you can also use it to temporarily take control away from the daemon until you revert the fan speed back to `auto`.
59+
In case you don't want to use a service, you may also control the fans manually. While this is only advised to do when first setting up your configuration, keep in mind you can also use it to temporarily take control away from the daemon until you revert the fan speed back to `auto`.
6060

6161
![screenshot](https://raw.githubusercontent.com/mcgillij/amdfan/main/images/manual.png)
6262

@@ -98,7 +98,7 @@ If a configuration file is not found, a default one will be generated. If you wa
9898
- `frequency` (default `5`): how often (in seconds) we wait between updates
9999
- `cards` (required): a list of card names (from `/sys/class/drm`) which we want to control.
100100

101-
Note! You can send a SIGHUP signal to the daemon to request a reload of the config without restarting the whole service.
101+
Note! You can send a **SIGHUP** signal to the daemon to request a reload of the config without restarting the whole service.
102102

103103
# Install
104104

Diff for: ‎amdfan/commands.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ def cli(
5454
help="Run the controller",
5555
)
5656
@click.option("--notification-fd", type=int)
57-
# @click.option("--background", is_flag=True, default=True)
5857
def run_daemon(notification_fd):
5958
FanController.start_daemon(
6059
notification_fd=notification_fd, pidfile=os.path.join(PIDFILE_DIR, "amdfan.pid")
@@ -77,7 +76,7 @@ def show_table(cards: Dict) -> Table:
7776
def monitor_cards(fps, single_run) -> None:
7877
scanner = Scanner()
7978
if not single_run:
80-
c.print("AMD Fan Control - ctrl-c to quit")
79+
c.print("AMD Fan Control - Ctrl-c to quit")
8180

8281
with Live(refresh_per_second=fps) as live:
8382
while 1:

Diff for: ‎amdfan/defaults.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
Description=amdfan controller
4040
4141
[Service]
42-
ExecStart=/usr/bin/amdfan --daemon
42+
ExecStart=/usr/bin/amdfan daemon
43+
ExecReload=kill -HUP $MAINPID
4344
Restart=always
4445
4546
[Install]

Diff for: ‎clean_build

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#####!/bin/bash
2+
#
3+
set -xue -o pipefail
4+
5+
echo "cleaning up previous run"
6+
rm -rf dist/*.whl dist/*.gz configure config.status autom4te.cache config.log *.gz *.zst *.log
7+
echo "autoconf"
8+
autoconf
9+
echo "./configure"
10+
./configure --prefix=/usr --libdir=/usr/lib --bindir=/usr/bin
11+
echo "Copy the PKGBUILD to the root dir for running makepkg"
12+
cp dist/pacman/PKGBUILD .
13+
echo "run linting"
14+
poetry run flake8 --verbose
15+
echo "run mypy"
16+
poetry run mypy amdfan/
17+
echo "run the tests"
18+
poetry run pytest
19+
echo "running poetry build"
20+
poetry build
21+
echo "getting the md5sum of the tarball"
22+
md5sum dist/*.gz
23+
echo "Copying the tarball to the root dir"
24+
cp dist/*.gz .

Diff for: ‎dist/configure.ac renamed to ‎configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
AC_INIT([amdfan], [0.1.28])
2+
AC_INIT([amdfan], [0.2.1])
33
AC_CONFIG_FILES([dist/pacman/PKGBUILD])
44
AC_CONFIG_FILES([dist/openrc/amdfan dist/systemd/amdfan.service])
55
AC_OUTPUT

Diff for: ‎dist/pacman/PKGBUILD.in

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33

44
pkgname=amdfan
55
pkgdesc="Python daemon for controlling the fans on amdgpu cards"
6-
pkgver=0.1.28
6+
pkgver=0.2.1
77
pkgrel=1
88
arch=('any')
99
license=('GPL2')
1010
depends=('python' 'python-yaml' 'python-numpy' 'python-rich' 'python-click')
11-
makedepends=('python-setuptools' 'python-poetry' 'python-build' 'python-installer')
11+
makedepends=('python-poetry' 'python-build' 'python-installer')
1212
url="https://github.com/mcgillij/amdfan"
1313
source=("https://github.com/mcgillij/amdfan/releases/download/$pkgver/amdfan-$pkgver.tar.gz")
1414
#source=("amdfan-$pkgver.tar.gz")
15-
md5sums=('7fe30661ba0d5117f32e4bab1db76888')
15+
md5sums=('0b93cfba6b58f4b567bd5d5b91b875ec')
1616

1717
build() {
1818
cd "$srcdir/$pkgname-$pkgver"
@@ -22,6 +22,6 @@ build() {
2222
package() {
2323
cd "$srcdir/$pkgname-$pkgver"
2424
python -m installer --destdir="$pkgdir" dist/*.whl
25-
mkdir -p "$pkgdir/@libdir@/systemd/system"
26-
install -Dm644 amdfan/packaging/pacman/amdfan.service "$pkgdir/@libdir@/systemd/system/"
25+
mkdir -p "$pkgdir@libdir@/systemd/system"
26+
install -Dm644 dist/systemd/amdfan.service "$pkgdir@libdir@/systemd/system/"
2727
}

Diff for: ‎dist/systemd/amdfan.service.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ After=multi-user.target
44
Requires=multi-user.target
55

66
[Service]
7-
ExecStart=@bindir@/amdfan --daemon
7+
ExecStart=@bindir@/amdfan daemon
88
ExecReload=kill -HUP $MAINPID
99
Restart=always
1010

Diff for: ‎pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "amdfan"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
description = "Fan monitor and controller for AMD gpus in Linux"
55
authors = ["mcgillij <mcgillivray.jason@gmail.com>"]
66
license = "GPL-2.0-only"
@@ -9,6 +9,7 @@ homepage = "https://mcgillij.dev/pages/amdfan.html"
99
repository = "https://github.com/mcgillij/amdfan"
1010
documentation = "https://mcgillij.dev/pages/amdfan.html"
1111
keywords = ["fan", "gpu", "temp", "monitor", "amd"]
12+
include = ["dist/systemd/amdfan.service"]
1213
classifiers = [
1314
"Environment :: Console",
1415
"Environment :: GPU",
@@ -29,7 +30,6 @@ pyyaml = "^6.0"
2930
click = "^8.1.3"
3031
rich = "^13.0.0"
3132

32-
3333
[tool.poetry.group.dev.dependencies]
3434
pylint = "*"
3535
flake8 = "*"

0 commit comments

Comments
 (0)
Please sign in to comment.