Iolaum / fcust

Linux Common Folder Custodian
Other
0 stars 0 forks source link

Converting to fedora rpm package #2

Closed Iolaum closed 3 years ago

Iolaum commented 3 years ago

WIP

An example can be seen here from the fpm ruby gem.

Iolaum commented 3 years ago

fpm package looks unmaintained and adds a dependency on a shady? fpm python package

Iolaum commented 3 years ago

looking into pyp2rpm next.

Iolaum commented 3 years ago

Used pyp2rpm to create sample fcust.spec file.

Notes:

Iolaum commented 3 years ago

Some useful information on packaging for fedora:

Iolaum commented 3 years ago

As of 123c1053b117d27460c47bdb1cc1a06323160add we get:

$ fedpkg --release f32 --path ./rpm lint
Failed to get repository name from Git url or pushurl
python-fcust.src: W: file-size-mismatch fcust-0.0.7.tar.gz = 17589, https://files.pythonhosted.org/packages/source/f/fcust/fcust-0.0.7.tar.gz = 17415
python3-fcust.noarch: W: no-manual-page-for-binary fcust
3 packages and 1 specfiles checked; 0 errors, 2 warnings.

Note: file-size-mismatch is beause I was testing against a development verion.

What do I need to fix no-manual-page-for-binary

Iolaum commented 3 years ago

From 6597b5ba612026802aff901457be057527b38b14, solution was to use:

data_files = [('/usr/share/man/man1/', ['docs/_build/man/fcust.1'])],

because the map page gets placed in man/man1 it automatically gets compressed and identified properly

Iolaum commented 3 years ago

Testing a fedora rpm package:

$ podman run -it fedora
$ podman cp noarch/python3-fcust-0.0.8-1.fc32.noarch.rpm 96a4135a9ebe:/home/
[96a4135a9ebe]# dnf install /home/python3-fcust-0.0.8-1.fc32.noarch.rpm
[96a4135a9ebe]# useradd -ms /bin/bash user1
[96a4135a9ebe]# useradd -ms /bin/bash user2
[96a4135a9ebe]# mkdir /home/family
[96a4135a9ebe]# groupadd family
[96a4135a9ebe]# usermod -a -G family user1
[96a4135a9ebe]# usermod -a -G family user2
[96a4135a9ebe]# chown user1:family /home/family/
[96a4135a9ebe]# ls -la /home/
[96a4135a9ebe]# su user1
[96a4135a9ebe]$ cd /home/family/
[96a4135a9ebe]$ echo test > test
[96a4135a9ebe]$ ls -la
total 16
drwxr-xr-x. 2 user1 family 4096 Oct 13 20:26 .
drwxr-xr-x. 5 root  root   4096 Oct 13 20:22 ..
-rw-rw-r--. 1 user1 user1     5 Oct 13 20:26 test
[96a4135a9ebe]$ fcust /home/family/
Initiating maintenance on /home/family/
fcust - INFO - CommonFolder class instantiated for: /home/family
fcust - INFO - Starting permissions enforcement
fcust - DEBUG - Fixing group for /home/family/test
fcust - INFO - Finished permissions enforcement
Common folder maintenance completed.
[96a4135a9ebe]$ ls -la
[96a4135a9ebe]$ cat /tmp/fcust/user1.log 
2020-10-13 20:35:02,409 - fcust - INFO - CommonFolder class instantiated for: /home/family
2020-10-13 20:35:02,409 - fcust - INFO - Starting permissions enforcement
2020-10-13 20:35:02,410 - fcust - DEBUG - Fixing group for /home/family/test
2020-10-13 20:35:02,410 - fcust - INFO - Finished permissions enforcement

It looks like our package is ready to be tested "live".

Iolaum commented 3 years ago

Has been fixed. Package is created with make fedpkg.