From 91eba2ffea987ee4f30819b6fe4a6c35e72485b1 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Fri, 17 Jun 2022 19:36:07 +0300 Subject: [PATCH] Fixed packaging --- bin/__init__.py | 0 config/slpkg.json | 1 + install.sh | 4 ++-- setup.py | 1 - slackbuild/README | 2 +- slackbuild/slack-desc | 2 +- slackbuild/slpkg.SlackBuild | 14 ++++++++++---- slpkg/__init__.py | 1 - slpkg/clean_logs.py | 6 +++--- slpkg/cli_menu.py | 2 +- slpkg/create_data.py | 6 +++--- slpkg/dependencies.py | 2 +- slpkg/downloader.py | 2 +- slpkg/main.py | 14 +++++++------- slpkg/models/models.py | 2 +- slpkg/queries.py | 6 +++--- slpkg/remove_packages.py | 8 ++++---- slpkg/slackbuild.py | 16 ++++++++-------- slpkg/update_repository.py | 10 +++++----- slpkg/views/views.py | 4 ++-- 20 files changed, 54 insertions(+), 49 deletions(-) create mode 100644 bin/__init__.py diff --git a/bin/__init__.py b/bin/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/config/slpkg.json b/config/slpkg.json index a69ed454..5d735ade 100644 --- a/config/slpkg.json +++ b/config/slpkg.json @@ -16,6 +16,7 @@ "pkg_suffix": ".tgz", "repo_tag": "_SBo", "installpkg": "upgradepkg --install-new", + "reinstall": "upgradepkg --reinstall", "removepkg": "removepkg", "colors": "on", "wget_options": "-c -N" diff --git a/install.sh b/install.sh index fc542700..694e9aa2 100755 --- a/install.sh +++ b/install.sh @@ -24,8 +24,8 @@ __version() { # Grab version from __metadata_.py file -cat slpkg/__metadata__.py | grep "__version_info__ = (" \ - | tr -d [[:space:]] | cut -c19-23 | tr , . +cat slpkg/metadata.py | grep "version_info: tuple = (" \ + | tr -d [[:space:]] | cut -c21-25 | tr , . } PRGNAM=slpkg diff --git a/setup.py b/setup.py index 3e532880..9da5d3dd 100755 --- a/setup.py +++ b/setup.py @@ -19,7 +19,6 @@ setup( keywords=['slackware', 'slpkg', 'update', 'build', 'install', 'remove', 'slackpkg', 'tool'], author=Metadata.author, - author_email=Metadata.email, url='https://dslackw.gitlab.io/slpkg/', package_data={'': ['LICENSE', 'README.rst', 'ChangeLog.txt']}, data_files=[('/etc/slpkg', ['config/slpkg.json']), diff --git a/slackbuild/README b/slackbuild/README index b4665f85..a620d3cd 100644 --- a/slackbuild/README +++ b/slackbuild/README @@ -1,4 +1,4 @@ -Slpkg is a powerful software package manager that installs, updates +Slpkg is a software package manager that installs, updates and removes packages on Slackware based systems. It automatically computes dependencies and figures out what things should occur to install packages. Slpkg makes it easier to maintain groups diff --git a/slackbuild/slack-desc b/slackbuild/slack-desc index 02fc0e25..05812858 100644 --- a/slackbuild/slack-desc +++ b/slackbuild/slack-desc @@ -8,7 +8,7 @@ |-----handy-ruler------------------------------------------------------| slpkg: slpkg (Slackware Packaging Tool) slpkg: -slpkg: Slpkg is a powerful software package manager that installs, updates, +slpkg: Slpkg is a software package manager that installs, updates, slpkg: and removes packages on Slackware based systems. It automatically slpkg: computes dependencies and figures out what things should occur slpkg: to install packages. Slpkg makes it easier to maintain groups of diff --git a/slackbuild/slpkg.SlackBuild b/slackbuild/slpkg.SlackBuild index 5126f27d..e695ac42 100755 --- a/slackbuild/slpkg.SlackBuild +++ b/slackbuild/slpkg.SlackBuild @@ -24,8 +24,8 @@ __version() { # Grab version from __metadata_.py file -cat ../slpkg/__metadata__.py | grep "__version_info__ = (" \ - | tr -d [[:space:]] | cut -c19-23 | tr , . +cat ../slpkg/metadata.py | grep "version_info: tuple = (" \ + | tr -d [[:space:]] | cut -c21-25 | tr , . } cd $(dirname $0) ; CWD=$(pwd) @@ -98,10 +98,16 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr # install configuration files mkdir -p $PKG/etc/slpkg -install -D -m0644 conf/slpkg.json $PKG/etc/slpkg/slpkg.json.new +install -D -m0644 config/slpkg.json $PKG/etc/slpkg/slpkg.json.new + +mkdir -p $PKG/usr/man/man1 +cp man/slpkg.1 $PKG/usr/man/man1 + +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz; rm $i ; done mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a README.rst ChangeLog.txt LICENSE requirements.txt $PKG/usr/doc/$PRGNAM-$VERSION +cp -a README.rst ChangeLog.txt LICENSE.txt requirements.txt $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install diff --git a/slpkg/__init__.py b/slpkg/__init__.py index 2ec89ad5..e69de29b 100644 --- a/slpkg/__init__.py +++ b/slpkg/__init__.py @@ -1 +0,0 @@ -from main import Flags diff --git a/slpkg/clean_logs.py b/slpkg/clean_logs.py index ae4f25b9..13204463 100644 --- a/slpkg/clean_logs.py +++ b/slpkg/clean_logs.py @@ -4,9 +4,9 @@ from dataclasses import dataclass -from views.views import ViewMessage -from models.models import LogsDependencies -from models.models import session as Session +from slpkg.views.views import ViewMessage +from slpkg.models.models import LogsDependencies +from slpkg.models.models import session as Session @dataclass diff --git a/slpkg/cli_menu.py b/slpkg/cli_menu.py index 2cf61608..c4495218 100644 --- a/slpkg/cli_menu.py +++ b/slpkg/cli_menu.py @@ -1,7 +1,7 @@ #!/usr/bin/python3 # -*- coding: utf-8 -*- -from metadata import Metadata +from slpkg.metadata import Metadata def usage(status): diff --git a/slpkg/create_data.py b/slpkg/create_data.py index 6f0e8e50..bf9bcd50 100644 --- a/slpkg/create_data.py +++ b/slpkg/create_data.py @@ -4,9 +4,9 @@ from dataclasses import dataclass -from metadata import Metadata -from models.models import SBoTable -from models.models import session as Session +from slpkg.metadata import Metadata +from slpkg.models.models import SBoTable +from slpkg.models.models import session as Session @dataclass diff --git a/slpkg/dependencies.py b/slpkg/dependencies.py index 1fe556de..e0c192c8 100644 --- a/slpkg/dependencies.py +++ b/slpkg/dependencies.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- -from queries import SBoQueries +from slpkg.queries import SBoQueries from dataclasses import dataclass diff --git a/slpkg/downloader.py b/slpkg/downloader.py index b4bf4bb5..177eab98 100644 --- a/slpkg/downloader.py +++ b/slpkg/downloader.py @@ -4,7 +4,7 @@ import subprocess from dataclasses import dataclass -from metadata import Metadata +from slpkg.metadata import Metadata @dataclass diff --git a/slpkg/main.py b/slpkg/main.py index 3bea122c..723cc5a9 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -6,13 +6,13 @@ import os import sys from dataclasses import dataclass -from cli_menu import usage -from metadata import Metadata -from queries import SBoQueries -from slackbuild import Slackbuilds -from remove_packages import RemovePackages -from update_repository import UpdateRepository -from clean_logs import CleanLogsDependencies +from slpkg.cli_menu import usage +from slpkg.metadata import Metadata +from slpkg.queries import SBoQueries +from slpkg.slackbuild import Slackbuilds +from slpkg.remove_packages import RemovePackages +from slpkg.update_repository import UpdateRepository +from slpkg.clean_logs import CleanLogsDependencies @dataclass diff --git a/slpkg/models/models.py b/slpkg/models/models.py index 31100e45..3a7c91e6 100644 --- a/slpkg/models/models.py +++ b/slpkg/models/models.py @@ -1,7 +1,7 @@ #!/usr/bin/python3 # -*- coding: utf-8 -*- -from metadata import Metadata +from slpkg.metadata import Metadata from dataclasses import dataclass from sqlalchemy.orm import sessionmaker from sqlalchemy.ext.declarative import declarative_base diff --git a/slpkg/queries.py b/slpkg/queries.py index 81ba707d..d99a543f 100644 --- a/slpkg/queries.py +++ b/slpkg/queries.py @@ -2,9 +2,9 @@ # -*- coding: utf-8 -*- -from metadata import Metadata -from models.models import SBoTable -from models.models import session as Session +from slpkg.metadata import Metadata +from slpkg.models.models import SBoTable +from slpkg.models.models import session as Session from dataclasses import dataclass diff --git a/slpkg/remove_packages.py b/slpkg/remove_packages.py index 54f85080..4898e5d3 100644 --- a/slpkg/remove_packages.py +++ b/slpkg/remove_packages.py @@ -4,12 +4,12 @@ import os import subprocess -from metadata import Metadata +from slpkg.metadata import Metadata from dataclasses import dataclass -from views.views import ViewMessage -from models.models import LogsDependencies -from models.models import session as Session +from slpkg.views.views import ViewMessage +from slpkg.models.models import LogsDependencies +from slpkg.models.models import session as Session @dataclass diff --git a/slpkg/slackbuild.py b/slpkg/slackbuild.py index cfb56b32..a64b3180 100644 --- a/slpkg/slackbuild.py +++ b/slpkg/slackbuild.py @@ -7,14 +7,14 @@ import hashlib import subprocess from dataclasses import dataclass -from downloader import Wget -from metadata import Metadata -from queries import SBoQueries -from utilities import Utilities -from dependencies import Requires -from views.views import ViewMessage -from models.models import LogsDependencies -from models.models import session as Session +from slpkg.downloader import Wget +from slpkg.metadata import Metadata +from slpkg.queries import SBoQueries +from slpkg.utilities import Utilities +from slpkg.dependencies import Requires +from slpkg.views.views import ViewMessage +from slpkg.models.models import LogsDependencies +from slpkg.models.models import session as Session @dataclass diff --git a/slpkg/update_repository.py b/slpkg/update_repository.py index b8bf6ffd..237e010f 100644 --- a/slpkg/update_repository.py +++ b/slpkg/update_repository.py @@ -4,11 +4,11 @@ import os from os import path -from create_data import CreateData -from downloader import Wget -from metadata import Metadata -from models.models import SBoTable -from models.models import session as Session +from slpkg.create_data import CreateData +from slpkg.downloader import Wget +from slpkg.metadata import Metadata +from slpkg.models.models import SBoTable +from slpkg.models.models import session as Session from dataclasses import dataclass diff --git a/slpkg/views/views.py b/slpkg/views/views.py index 27f26ffe..662f287c 100644 --- a/slpkg/views/views.py +++ b/slpkg/views/views.py @@ -3,8 +3,8 @@ import os from dataclasses import dataclass -from queries import SBoQueries -from metadata import Metadata +from slpkg.queries import SBoQueries +from slpkg.metadata import Metadata @dataclass