-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile-Linux
140 lines (113 loc) · 4.35 KB
/
Makefile-Linux
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/usr/bin/make
NAME="airoscript-ng"
name=$(NAME)
# Binary install programs
INSTALL = install -c
INSTALLDATA = install -c -m 644
# Destdirs.
# prefixes
data=$(prefix)/share
# main
bindir=$(prefix)/sbin/
datadir=$(data)/$(NAME)/
docdir=$(data)/doc/$(NAME)
etcdir=$(prefix)/etc
locale=$(data)/locale
mandir=$(data)/man
srcdir=./src
# Manpages
###############################################################################
# install #
###############################################################################
install: installdirs\
install-airoscript install-themes \
install-tools \
install-docs \
install-locale \
post-install
installdirs:
@$(SHELL) $(srcdir)/mkinstalldirs $(bindir) $(datadir) \
$(docdir)/html/images $(etcdir) \
$(mandir)/man1 $(locale) \
$(datadir)/themes \
$(datadir)/airosperl \
$(docdir)/tools
install-airoscript:
@echo "Installing airoscript"
@$(INSTALL) $(srcdir)/airoscript-ng $(bindir)/$(name)
@$(INSTALL) $(srcdir)/conffiles/airoscript-ng.conf $(etcdir)
@$(INSTALL) $(srcdir)/functions/*func* $(datadir)
@$(INSTALLDATA) $(srcdir)/conffiles/screenrc $(etcdir)
install-themes:
@echo "Installing themes"
@$(INSTALLDATA) $(srcdir)/themes/*.theme $(datadir)/themes
install-tools:
@# Commented thigs because airosperl is not yet ready.
@echo "Installing tools:"
@# Binary files
@#echo "\t airosconf"
@#$(INSTALL) $(srcdir)/tools/airosconf.sh $(bindir)/airosconf
@echo "\t airoscwordlist"
@$(INSTALL) $(srcdir)/tools/airoscwordlist.pl $(bindir)/airoscwordlist
@echo "\t airopdate"
@$(INSTALL) $(srcdir)/tools/airopdate.sh $(bindir)/airopdate
@#echo "\t airosperl"
@#$(INSTALL) $(srcdir)/tools/airosperl/airosperl.pl\
#$(bindir)/airosperl.pl
@# Data files.
@#$(INSTALLDATA) $(srcdir)/conffiles/airosperl.conf $(etcdir)
@#$(INSTALLDATA) $(srcdir)/tools/airosperl/airosperl.glade $(datadir)
@# Airosperl configuration
@#$(SHELL) $(srcdir)/tools/airosconf.sh --set --to-airosperl apppath\
#"$(datadir)" --force-yes
post-install:
@echo ""
@if [ "$(aircrack_prefix)" != "/usr/local " ]; then sed -i 's/AIRPREFIX=\"\/usr\/local\"/AIRPREFIX=\"$(aircrack_prefix)\"/g' $(etcdir)/airoscript-ng.conf &>/dev/null;fi
install-docs: install-main-docs install-manpages
install-main-docs:
@echo "Installing documentation"
@echo "\t Installing standard documentation"
@for i in doc/* ; do if [ -d $$i ] && [ $$i != "." ] && [ $$i != ".." ]; then make -s -C $$i docdir="$(docdir)" INSTALLDATA="$(INSTALLDATA)" ; else $(INSTALLDATA) $$i $(docdir) ;fi ; done
install-manpages:
@# This will install any manpage on manpages dir. (Just man1 manpages)
@echo "\t Installing manpages"
@for i in $(srcdir)/manpages/*.1 ; do $(INSTALLDATA) $$i $(mandir)/man1/ ; done
###############################################################################
# locale #
###############################################################################
generate-locale:
@for i in $(srcdir)/locale/* ; do \
if [ -d $$i ] && [ $$i != "." ] && [ $$i != ".." ]; then \
make -s -C $$i &> /dev/null ; \
fi ; \
done
install-locale: generate-locale
@echo "Installing locales"
@for i in $(srcdir)/locale/* ; do \
if [ -d $$i ] && [ $$i != "." ] && [ $$i != ".." ]; then \
make -s -C $$i install localedir="$(locale)" INSTALLDATA="$(INSTALLDATA)" ; \
fi ; \
done
###############################################################################
# uninstall #
###############################################################################
uninstall: uninstall-manpages uninstall-binary uninstall-data uninstall-docs uninstall-locale
@echo "Uninstalled succesfully"
uninstall-binary:
@rm $(bindir)/$(name)
@rm $(bindir)/airopdate
uninstall-data: uninstall-locale
@rm $(etcdir)/airosperl.conf $(sysconfdir)/airoscript-ng.conf
@rm -r $(datadir)
uninstall-docs:
@rm -r $(docdir)
uninstall-manpages:
@for i in $(srcdir)/manpages/*.1 ; do $(INSTALLDATA) $$i $(mandir)/man1/ ; done
uninstall-locale:
@for i in $(srcdir)/locale/* ; do \
if [ -d $$i ] && [ $$i != "." ] && [ $$i != ".." ]; then \
make -s -C $$i uninstall localedir=$(locale) ; \
fi ; \
done
all: install
.PHONY: all install uninstall slackware debian-package airosperl locale manpages