Use setuptools to build the project
This commit is contained in:
parent
c6871ac81a
commit
97419c30f9
15
PKGBUILD
15
PKGBUILD
@ -10,7 +10,10 @@ arch=('any')
|
|||||||
url="https://github.com/Fuxino/simple_backup.git"
|
url="https://github.com/Fuxino/simple_backup.git"
|
||||||
license=('GPL3')
|
license=('GPL3')
|
||||||
makedepends=('git'
|
makedepends=('git'
|
||||||
'python-setuptools')
|
'python-setuptools'
|
||||||
|
'python-build'
|
||||||
|
'python-installer'
|
||||||
|
'python-wheel')
|
||||||
depends=('python'
|
depends=('python'
|
||||||
'rsync'
|
'rsync'
|
||||||
'python-dotenv'
|
'python-dotenv'
|
||||||
@ -26,14 +29,20 @@ pkgver()
|
|||||||
git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
|
git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prepare()
|
||||||
|
{
|
||||||
|
git -C ${srcdir}/${pkgname} clean -dfx
|
||||||
|
}
|
||||||
|
|
||||||
build()
|
build()
|
||||||
{
|
{
|
||||||
cd ${srcdir}/${pkgname}
|
cd ${srcdir}/${pkgname}
|
||||||
python3 setup.py build
|
python -m build --wheel --no-isolation
|
||||||
}
|
}
|
||||||
|
|
||||||
package()
|
package()
|
||||||
{
|
{
|
||||||
cd ${srcdir}/${pkgname}
|
cd ${srcdir}/${pkgname}
|
||||||
python3 setup.py install --root=${pkgdir} --optimize=1 --skip-build
|
python -m installer --destdir=${pkgdir} dist/*.whl
|
||||||
|
install -Dm644 ${srcdir}/${pkgname}/${pkgname}.conf ${pkgdir}/etc/${pkgname}/${pkgname}.conf
|
||||||
}
|
}
|
||||||
|
35
README.md
35
README.md
@ -1,10 +1,37 @@
|
|||||||
# simple_backup
|
simple_backup
|
||||||
|
============
|
||||||
A simple backup script
|
A simple backup script
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
simple_backup is a Python script that allows you to backup your files.
|
simple_backup is a Python script that allows you to backup your files.
|
||||||
It reads from a configuration file the files/directories that must be copied,
|
Parameters like input files/directories, output directory etc. can be specified in a configuration file, or on the command line. Run:
|
||||||
the destination directory for the backup and a few other options.
|
|
||||||
|
```bash
|
||||||
|
simple_backup -h
|
||||||
|
```
|
||||||
|
|
||||||
|
to print all possible command line options.
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
rsync is used to perform the backup.
|
The script uses rsync to actually run the backup, so you will have to install it on your system. For example on Arch Linux:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo pacman -Syu rsync
|
||||||
|
```
|
||||||
|
|
||||||
|
## Install
|
||||||
|
To install the program, first clone the repository:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/Fuxino/simple_backup.git
|
||||||
|
```
|
||||||
|
|
||||||
|
Then run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd simple_backup
|
||||||
|
python -m build --wheel
|
||||||
|
python -m installer dist/*.whl
|
||||||
|
|
||||||
|
For Arch Linux, a PKGBUILD that automates this process is provided.
|
||||||
|
|
||||||
|
3
pyproject.toml
Normal file
3
pyproject.toml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[build-system]
|
||||||
|
requires = ['setuptools']
|
||||||
|
build-backend = 'setuptools.build_meta'
|
@ -1 +0,0 @@
|
|||||||
python-dotenv>=1.0.0
|
|
@ -22,6 +22,10 @@ classifiers =
|
|||||||
|
|
||||||
[options]
|
[options]
|
||||||
packages = simple_backup
|
packages = simple_backup
|
||||||
|
python_requires = >=3.7
|
||||||
|
install_requires =
|
||||||
|
python-dotenv
|
||||||
|
systemd-python
|
||||||
|
|
||||||
[options.entry_points]
|
[options.entry_points]
|
||||||
console_scripts =
|
console_scripts =
|
||||||
|
8
setup.py
8
setup.py
@ -1,8 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
"""Setup script"""
|
|
||||||
|
|
||||||
from setuptools import setup
|
|
||||||
|
|
||||||
setup()
|
|
||||||
|
|
14
simple_backup.conf
Normal file
14
simple_backup.conf
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#Example config file for simple_backup
|
||||||
|
|
||||||
|
[default]
|
||||||
|
#Input directories. Use a comma to separate items
|
||||||
|
inputs=/home/my_home,/etc
|
||||||
|
|
||||||
|
#Output directory
|
||||||
|
backup_dir=/media/Backup
|
||||||
|
|
||||||
|
#Exclude patterns. Use a comma to separate items
|
||||||
|
exclude=.gvfs,.local/share/gvfs-metadata,.cache,.dbus,.Trash,.local/share/Trash,.macromedia,.adobe,.recently-used,.recently-used.xbel,.thumbnails
|
||||||
|
|
||||||
|
#Number of snapshots to keep (use -1 to keep all)
|
||||||
|
keep=-1
|
Loading…
x
Reference in New Issue
Block a user