Updated for package build

This commit is contained in:
Dimitris Zlatanidis 2023-06-29 22:51:13 +03:00
parent 1d6b026f92
commit c3e0af4707
7 changed files with 13 additions and 81 deletions

View file

@ -4,6 +4,7 @@
- Updated: - Updated:
* Bullet progress bar color * Bullet progress bar color
* Logging path to /var/log/slpkg/ * Logging path to /var/log/slpkg/
* Package build with pyproject.toml file (require python3-build)
- Added: - Added:
* Process log file under /var/log/slpkg/filename_date_time.log * Process log file under /var/log/slpkg/filename_date_time.log

View file

@ -22,13 +22,8 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
__version() {
# Grab version from __metadata_.py file
cat setup.cfg | grep "version =" | tr -d "[:space:]" | cut -c9-13 | tr , .
}
PRGNAM=slpkg PRGNAM=slpkg
VERSION=${VERSION:-$(__version)} VERSION=$(cat pyproject.toml | grep "version =" | grep -oe "\([0-9.]*\)")
ARCHIVES="$PRGNAM-$VERSION.tar.gz $PRGNAM-$VERSION.tar.bz2 $PRGNAM-$VERSION.zip" ARCHIVES="$PRGNAM-$VERSION.tar.gz $PRGNAM-$VERSION.tar.bz2 $PRGNAM-$VERSION.zip"
@ -40,5 +35,6 @@ for file in $ARCHIVES; do
chmod +x $PRGNAM.SlackBuild chmod +x $PRGNAM.SlackBuild
./$PRGNAM.SlackBuild ./$PRGNAM.SlackBuild
rm $file rm $file
break
fi fi
done done

View file

@ -1,6 +1,6 @@
[build-system] [build-system]
requires = ["setuptools", "setuptools-scm"] requires = ["flit_core>=3.2.0,<4"]
build-backend = "setuptools.build_meta" build-backend = "flit_core.buildapi"
[project] [project]
name = "slpkg" name = "slpkg"
@ -20,8 +20,6 @@ classifiers = [
"Operating System :: POSIX :: Linux", "Operating System :: POSIX :: Linux",
"Programming Language :: Python", "Programming Language :: Python",
"Programming Language :: Python :: 3", "Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Unix Shell", "Programming Language :: Unix Shell",
"Topic :: Utilities", "Topic :: Utilities",
"Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Build Tools",
@ -38,11 +36,13 @@ dependencies = [
"progress>=1.6", "progress>=1.6",
] ]
[tool.setuptools] [tool.flit_core]
packages = ["slpkg", "slpkg.models", "slpkg.views", "slpkg.sbos", "slpkg.binaries"] name = "slpkg"
[project.urls] [project.urls]
homepage = "https://dslackw.gitlab.io/slpkg/" homepage = "https://dslackw.gitlab.io/slpkg/"
repository = "https://gitlab.com/dslackw/slpkg.git"
changelog = "https://gitlab.com/dslackw/slpkg/-/blob/master/ChangeLog.txt"
[project.optional-dependencies] [project.optional-dependencies]
socks = ["PySocks>=1.7.1"] socks = ["PySocks>=1.7.1"]

View file

@ -1,56 +0,0 @@
[metadata]
name = slpkg
version = 4.9.1
license_file = LICENSE
author = Dimitris Zlatanidis
author_email = dslackw@gmail.com
description = Package manager utility for Slackware Linux.
long_description = file:README.md
url = https://dslackw.gitlab.io/slpkg/
project_urls =
Source = https://dslackw.gitlab.io/slpkg/
Documentation = https://dslackw.gitlab.io/slpkg/
classifiers =
License :: OSI Approved :: MIT License
Natural Language :: English
Operating System :: POSIX
Operating System :: POSIX :: Linux
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Unix Shell
Topic :: Utilities
Topic :: Software Development :: Build Tools
Topic :: System :: Archiving :: Packaging
Topic :: System :: Software Distribution
Topic :: System :: Installation/Setup
Topic :: System :: Systems Administration
Topic :: System :: Software Distribution
[options]
packages =
slpkg
slpkg.models
slpkg.views
slpkg.sbos
slpkg.binaries
python_requires = >= 3.9
install_requires =
SQLAlchemy >= 1.4.46
pythondialog >= 3.5.3
progress >= 1.6
include_package_data = True
[options.entry_points]
console_scripts =
slpkg = slpkg.main:main
slpkg_new-configs = slpkg.new_configs:main
[options.extras_require]
socks =
PySocks >= 1.7.1
[options.packages.find]
where = .

View file

@ -1,5 +0,0 @@
from setuptools import setup
if __name__ == '__main__':
setup()

View file

@ -10,5 +10,5 @@ config() {
FILES="slpkg repositories blacklist rules" FILES="slpkg repositories blacklist rules"
for file in $FILES; do for file in $FILES; do
install -D -m0644 configs/$file.toml $PKG/etc/slpkg/$file.toml.new config etc/slpkg/$file.toml.new
done done

View file

@ -22,15 +22,10 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
__version() {
# Grab version from __metadata_.py file
cat ../setup.cfg | grep "version =" | tr -d "[:space:]" | cut -c9-13 | tr , .
}
cd $(dirname $0) ; CWD=$(pwd) cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=slpkg PRGNAM=slpkg
VERSION=${VERSION:-$(__version)} VERSION=$(cat ../pyproject.toml | grep "version =" | grep -oe "\([0-9.]*\)")
BUILD=${BUILD:-1} BUILD=${BUILD:-1}
TAG=${TAG:-_dsw} TAG=${TAG:-_dsw}
PKGTYPE=${PKGTYPE:-txz} PKGTYPE=${PKGTYPE:-txz}
@ -86,7 +81,8 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
python3 setup.py install --root=$PKG python3 -m build --wheel --no-isolation
python3 -m installer --destdir "$PKG" dist/*.whl
# Move executables to the /usr/sbin folder. # Move executables to the /usr/sbin folder.
mkdir -p $PKG/usr/sbin mkdir -p $PKG/usr/sbin