-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (74 loc) · 2.95 KB
/
Makefile
File metadata and controls
85 lines (74 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# version 0.0.2
# created by : Team ViewTech
# date : 2025-06-05 | 08.47 WIB
# developer : Xenzi & Polygon (pejuang kentang)
########################################
# Daftar package per OS
PACKAGEBASH_TERMUX := curl python bc ncurses-utils file ossp-uuid uuid-utils less zsh boxes figlet ruby clang tree jq ripgrep coreutils xz-utils just fzf gum silversearcher-ag grep brotli toilet binutils python-pip bzip2 neofetch
PACKAGEBASH_DEBIAN := curl python3 bc ncurses-bin file ossp-uuid uuid-runtime less zsh boxes figlet ruby clang tree jq ripgrep coreutils xz-utils fzf silversearcher-ag grep brotli toilet binutils python3-pip bzip2 neofetch
PACKAGEBASH_UBUNTU := $(PACKAGEBASH_DEBIAN)
PACKAGEPY := dns-client requests bs4 rich pycryptodome rich-cli certifi npyscreen prompt_toolkit requests lzstring faker phonenumbers blessed geopy cloudscraper emoji fuzzywuzzy
TERMUX_PATH := /data/data/com.termux/files/usr/bin/bash
PYTHON_VERSION := $(shell python -V | sed 's/[[:space:]]//g' | cut -c 1-10 | tr '[:upper:]' '[:lower:]')
# cek os type
detectCLI:
@echo "[?] Mengecek lingkungan..."
@if [ -f "$(TERMUX_PATH)" ]; then \
echo "[✓] Termux terdeteksi!"; \
OS_TYPE="termux"; \
elif [ -f "/etc/debian_version" ]; then \
grep -qi ubuntu /etc/os-release && OS_TYPE="ubuntu" || OS_TYPE="debian"; \
echo "[✓] $$OS_TYPE terdeteksi!"; \
else \
echo "[!] OS tidak didukung!"; \
exit 1; \
fi; \
echo $$OS_TYPE > .os_type
# install package for bash
install-system: detectCLI
@echo "[?] Menginstall package dari bash..."
@OS_TYPE=$$(cat .os_type); \
if [ "$$OS_TYPE" = "termux" ]; then \
PACKAGES="$(PACKAGEBASH_TERMUX)"; \
INSTALL_CMD="pkg install -y"; \
elif [ "$$OS_TYPE" = "debian" ] || [ "$$OS_TYPE" = "ubuntu" ]; then \
PACKAGES="$(PACKAGEBASH_DEBIAN)"; \
INSTALL_CMD="sudo apt-get install -y"; \
fi; \
for pkg in $$PACKAGES; do \
echo "[>] Menginstall $$pkg..."; \
yes|$$INSTALL_CMD $$pkg >/dev/null 2>&1; \
if command -v $$pkg >/dev/null 2>&1 || dpkg -l | grep -qw $$pkg; then \
echo "[✓] Berhasil menginstall $$pkg"; \
else \
echo "[✗] Gagal menginstall $$pkg"; \
echo "[!] Jalankan manual: $$INSTALL_CMD $$pkg"; \
fi; \
done
# install package for python
install-py: detectCLI
@OS_TYPE=$$(cat .os_type); \
if command -v python3 >/dev/null 2>&1; then \
echo "[✓] Python3 ditemukan"; \
echo "[>] Menginstall Python package: $(PACKAGEPY)..."; \
pip3 install $(PACKAGEPY); \
echo "[>] Python Berhasil DI setup"; \
else \
echo "[✗] Python3 tidak ditemukan! Silakan install terlebih dahulu."; \
fi
@if ! test -d "$$HOME/.local"; then \
mkdir "$$HOME/.local"; \
fi
# UPDATE REPO
update: detectCLI
@echo "[>] Melakukan update ..";sleep 1
@git pull
install: install-system install-py
fix:
rm -rf $$PREFIX/lib/$(PYTHON_VERSION)/site-packages/requests
pip uninstall requests -y
pip uninstall psutil -y
pip install requests
pip install "urllib3<2"
all: install
.PHONY: detectCLI install-system install-py update fix install all