-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
30 lines (29 loc) · 1.09 KB
/
Makefile
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
MAKEFLAGS += -s
clean:
@rm *.tgz
@echo 'Cleanup done!'
tgz:
@tar --transform "s|bin|zypper-upgradedistro|" \
--transform "s|plugin|zypper-upgradedistro|" \
-czvf zypper-upgradedistro-$(shell grep 'Version: [0-9]' './bin/upgradedistro' | cut -f 3 -d ' ').tgz ./bin ./plugin
@echo 'Archive ready!'
install_script:
@sudo install -m 755 ./bin/upgradedistro /usr/local/bin/
@echo 'Script installed!'
install_plugin:
@sudo install -m 755 ./plugin/zypper-upgradedistro /usr/lib/zypper/commands/
@sudo install -m 644 ./plugin/zypper-upgradedistro.8 /usr/share/man/man8/
@echo 'Plugin installed!'
install: install_script install_plugin
@echo 'Installation completed!'
tag:
git tag v$(shell grep 'Version: [0-9]' './bin/upgradedistro' | cut -f 3 -d ' ')
uninstall_script:
@sudo rm /usr/local/bin/upgradedistro || true
@echo 'Script uninstalled!'
uninstall_plugin:
@sudo rm /usr/lib/zypper/commands/zypper-upgradedistro || true
@sudo rm /usr/share/man/man8/zypper-upgradedistro.8.gz || true
@echo 'Plugin uninstalled!'
uninstall: uninstall_script uninstall_plugin
@echo 'Uninstallation completed!'