xnet-toolkit
Version:
Professional Network Administration and Security Toolkit
50 lines (39 loc) • 1.17 kB
Plain Text
# XNET packaging makefile
VERSION := $(shell grep -m1 "version=" ../setup.py | cut -d '"' -f2)
PYTHON := python3
PIP := pip3
DESTDIR ?= /usr/local
BINDIR ?= $(DESTDIR)/bin
DATADIR ?= $(DESTDIR)/share/xnet
DOCDIR ?= $(DESTDIR)/share/doc/xnet
MANDIR ?= $(DESTDIR)/share/man/man1
.PHONY: all deb rpm pkg wheel clean install uninstall
all: wheel
wheel:
cd .. && $(PYTHON) setup.py bdist_wheel
deb:
@echo "Building Debian package..."
cd .. && $(PYTHON) -m pip install stdeb
cd .. && $(PYTHON) setup.py --command-packages=stdeb.command bdist_deb
rpm:
@echo "Building RPM package..."
cd .. && $(PYTHON) setup.py bdist_rpm
pkg:
@echo "Building macOS package..."
cd .. && $(PYTHON) setup.py bdist_pkg
clean:
cd .. && $(PYTHON) setup.py clean --all
rm -rf ../build ../dist ../*.egg-info ../deb_dist
install:
install -d $(BINDIR)
install -d $(DATADIR)
install -d $(DOCDIR)
install -m755 ../bin/xnet $(BINDIR)/
install -m644 ../README.md $(DOCDIR)/
install -m644 ../LICENSE $(DOCDIR)/
$(PIP) install -e ..
uninstall:
rm -f $(BINDIR)/xnet
rm -rf $(DATADIR)
rm -rf $(DOCDIR)
$(PIP) uninstall -y xnet-toolkit