2021-10-02 14:13:53 +05:30
|
|
|
# This makefile uses setup.py under the hood. In debian, and therefore
|
|
|
|
# ubuntu, and in fedora, python and pip are symlinks to python2 and pip2,
|
|
|
|
# not python3. So we have to specify python as python3 by default.
|
|
|
|
|
2021-08-01 16:58:48 +05:30
|
|
|
PYTHON := python3
|
2021-08-14 22:00:07 +05:30
|
|
|
PIP := pip3
|
2021-10-02 14:13:53 +05:30
|
|
|
|
|
|
|
# This can be changed when creating a package for your POSIX distribution
|
2021-08-01 16:58:48 +05:30
|
|
|
DESTDIR:= /
|
|
|
|
|
2021-07-21 15:36:11 +05:30
|
|
|
all: build
|
2021-05-10 15:15:42 +05:30
|
|
|
|
2022-07-23 15:58:32 +05:30
|
|
|
# Build only when pybatmesh/__init__.py changes. We assume here that anyone
|
2021-10-02 14:13:53 +05:30
|
|
|
# creating a new commit will first update the __version__ in
|
2022-07-23 15:58:32 +05:30
|
|
|
# pybatmesh/__init__.py
|
|
|
|
build: pybatmesh/__init__.py
|
2021-08-01 16:58:48 +05:30
|
|
|
$(PYTHON) setup.py build
|
2021-06-04 22:27:54 +05:30
|
|
|
|
2021-09-29 08:37:59 +05:30
|
|
|
install:
|
2021-08-01 16:58:48 +05:30
|
|
|
$(PYTHON) setup.py install --root="$(DESTDIR)" --optimize=1 --skip-build
|
2021-07-26 12:44:24 +05:30
|
|
|
|
2021-08-14 22:00:07 +05:30
|
|
|
uninstall:
|
2022-07-23 15:58:32 +05:30
|
|
|
$(PIP) uninstall -y pybatmesh
|
|
|
|
rm -rf /usr/share/pybatmesh /usr/lib/systemd/system/pybatmesh.service
|
|
|
|
@echo "make uninstall will not remove anything in /etc/pybatmesh" && \
|
2021-08-18 17:33:46 +05:30
|
|
|
echo "Do 'sudo make purge' to remove it."
|
2021-08-14 22:00:07 +05:30
|
|
|
|
2021-10-05 15:04:19 +05:30
|
|
|
rpm:
|
|
|
|
$(PYTHON) setup.py bdist_rpm --requires python3-dasbus,python3-systemd,iwd,systemd-networkd
|
|
|
|
|
2021-10-02 14:13:53 +05:30
|
|
|
# Remove config files, like apt purge. Purge should first do what
|
|
|
|
# uninstall does, so we add uninstall as a dependency to this rule.
|
2021-08-19 12:03:20 +05:30
|
|
|
purge: uninstall
|
2022-07-23 15:58:32 +05:30
|
|
|
rm -rf /etc/pybatmesh
|
2021-08-14 22:00:07 +05:30
|
|
|
|
2021-07-26 12:44:24 +05:30
|
|
|
clean:
|
2021-10-05 15:04:19 +05:30
|
|
|
rm -rf build *.egg-info **/__pycache__ dist
|