Updated setup

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2020-02-13 20:41:15 +01:00
parent 1d00a34dd5
commit cc3708b966
4 changed files with 13 additions and 42 deletions

View file

@ -4,6 +4,7 @@ Fixed:
and patches directory #122
Updated:
- Removed status progress bar
- Setup and installing
3.8.0 - 05/02/2020
Added:

View file

@ -25,8 +25,6 @@
import os
import sys
import time
import shutil
from slpkg.md5sum import md5
from slpkg.__metadata__ import MetaData as _meta_
try:
@ -79,7 +77,16 @@ setup(
package_data={"": ["LICENSE", "README.md", "CHANGELOG"]},
data_files=[("man/man8", ["man/slpkg.8"]),
("/etc/bash_completion.d", ["conf/slpkg.bash-completion"]),
("/etc/fish/completions", ["conf/slpkg.fish"])],
("/etc/fish/completions", ["conf/slpkg.fish"]),
("/etc/slpkg", ["conf/slpkg.conf",
"conf/repositories.conf",
"conf/blacklist",
"conf/slackware-mirrors",
"conf/default-repositories",
"conf/custom-repositories",
"conf/rlworkman.deps",
"conf/pkg_security"])
],
install_requires=install_requires,
extras_require={
"optional": optional_requires,
@ -104,29 +111,3 @@ setup(
"Topic :: Utilities"],
python_requires=">=3.7"
)
# Install configuration files with pip.
if "install" in sys.argv:
conf_file = [
"conf/slpkg.conf",
"conf/repositories.conf",
"conf/blacklist",
"conf/slackware-mirrors",
"conf/default-repositories",
"conf/custom-repositories",
"conf/rlworkman.deps",
"conf/pkg_security"
]
if not os.path.exists(_meta_.conf_path):
os.makedirs(_meta_.conf_path)
for conf in conf_file:
filename = conf.split("/")[-1]
if os.path.isfile(_meta_.conf_path + filename):
old = md5(_meta_.conf_path + filename)
new = md5(conf)
if old != new:
shutil.copy2(conf, _meta_.conf_path + filename + ".new")
else:
shutil.copy2(conf, _meta_.conf_path)
shutil.copy2(conf_file[0],
_meta_.conf_path + conf_file[0].split("/")[-1] + ".orig")

View file

@ -77,22 +77,11 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
# skip pip installs
sed -i 's/if "install"/if ""/' setup.py
python3 setup.py install --root=$PKG
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
mkdir -p $PKG/etc/slpkg
# install configurations files
CONFIGS="slpkg.conf repositories.conf blacklist slackware-mirrors default-repositories \
custom-repositories rlworkman.deps pkg_security"
for file in $CONFIGS; do
install -D -m0644 conf/$file $PKG/etc/slpkg/${file}.new
done
# keep original configuration file for reset
cp -p conf/slpkg.conf $PKG/etc/slpkg/slpkg.conf.orig
@ -111,4 +100,4 @@ cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}
$INSTALL $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz
$INSTALL $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz

View file

@ -76,7 +76,7 @@ class MetaData:
__all__ = "slpkg"
__author__ = "dslackw"
__version_info__ = (3, 8, 0)
__version_info__ = (3, 8, 1)
__version__ = "{0}.{1}.{2}".format(*__version_info__)
__license__ = "GNU General Public License v3 (GPLv3)"
__email__ = "d.zlatanidis@gmail.com"