summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-06-18 16:04:43 +0200
committerhut <hut@lavabit.com>2010-06-18 16:04:43 +0200
commit582f3519f70332f88fea0055cdd1b2291e029a2e (patch)
tree2f66aec84da65f9f592ab09e0f2dae717e61a36c
parent636d93936d26fccdf6fe530568db1b4c41c3f2bf (diff)
downloadranger-582f3519f70332f88fea0055cdd1b2291e029a2e.tar.gz
Rewrote INSTALL and "make (un)install"
-rw-r--r--INSTALL48
-rw-r--r--Makefile14
2 files changed, 26 insertions, 36 deletions
diff --git a/INSTALL b/INSTALL
index 9939c11b..b5b1f066 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,45 +1,25 @@
 Installing
 ==========
 
-You don't need to install anything.
+Use the package manager of your operating system to install ranger.
 
-You can run ranger by simply starting the executable file ranger.py
-in the top directory of this package.
-Use the --clean option and it will leave no trace whatsoever on your system.
+To install ranger manually, use either:
+sudo ./setup.py install --optimize=1 --record=uninstall_info
 
-
-If you insist on conventionally install it, use the package manager
-of your operating system.  If there is no package or it is out of date,
-you can also follow these instructions:
-
-
-Step by step
-============
-
-(This is all done automagically if you type `sudo make install',
-though you might want to read the Makefile first)
-
-0. Make sure you have a recent version of python, including the
-   curses module, which is the case if this shell command prints no errors:
-   python -c 'import curses, sys; assert sys.version >= "2.6"'
-
-
-1. Copy the file "ranger.py" into any of the directories in the PATH
-   environment variable, for example to "/usr/bin/ranger"
-
-
-2. Copy the directory "ranger" into one of the python module search
-   paths, for example to "/usr/lib/python2.6/site-packages/ranger".
-
-   Ensure that the path is listed by the command:
-   python -c 'import sys; print("\n".join(sys.path))'
+or for short:
+sudo make install
 
 
 Uninstalling
 ============
 
-Use your package manager to uninstall ranger.  If you manually installed
-it, revert the steps described above.
+Ranger uses python distutils to install ranger which does not support automatic
+uninstalling.
+
+However, after installing ranger with one of the ways above, all installed
+files are recorded to "uninstall_info".  This information can be used to
+remove ranger:
+cat uninstall_info | xargs -d "\n" sudo rm --
 
-Ranger can also create a configuration directory at ~/.ranger which
-you might want to remove as well.
+or simply:
+sudo make uninstall
diff --git a/Makefile b/Makefile
index fc5b1cf8..2f2417de 100644
--- a/Makefile
+++ b/Makefile
@@ -16,8 +16,11 @@
 NAME = ranger
 VERSION = $(shell cat README | grep -m 1 -o '[0-9][0-9.]\+')
 SNAPSHOT_NAME ?= $(NAME)-$(VERSION)-$(shell git rev-parse HEAD | cut -b 1-8).tar.gz
-PYTHON ?= python
+# Find suitable python version (need python >= 2.6 or 3.1):
+PYTHON ?= $(shell python -c 'import sys; sys.exit(sys.version < "2.6")' && \
+	which python || which python3.1 || which python3 || which python2.6)
 DOCDIR ?= doc/pydoc
+DESTDIR ?= /
 PYOPTIMIZE ?= 1
 BMCOUNT ?= 5  # how often to run the benchmarks?
 
@@ -40,6 +43,13 @@ help:
 	@echo 'make snapshot: Create a tar.gz of the current git revision'
 	@echo 'make test: Run all unittests.'
 
+install:
+	$(PYTHON) setup.py install --record=uninstall_info \
+		'--root=$(DESTDIR)' --optimize=$(PYOPTIMIZE)
+
+uninstall:
+	cd $(DESTDIR) && cat $(CWD)/uninstall_info | xargs -d "\n" rm --
+
 compile: clean
 	PYTHONOPTIMIZE=$(PYOPTIMIZE) $(PYTHON) -m compileall -q ranger
 
@@ -66,4 +76,4 @@ bm:
 snapshot:
 	git archive --prefix='$(NAME)-$(VERSION)/' --format=tar HEAD | gzip > $(SNAPSHOT_NAME)
 
-.PHONY: default options compile clean doc cleandoc test bm snapshot
+.PHONY: default options compile clean doc cleandoc test bm snapshot install uninstall
'>d44123ca ^
76755b28 ^

4690ce81 ^
76755b28 ^

d44123ca ^
4690ce81 ^
d44123ca ^



db1f56c8 ^

4690ce81 ^
db1f56c8 ^




d44123ca ^
4690ce81 ^



d44123ca ^

4690ce81 ^

67db19a0 ^
4690ce81 ^

d44123ca ^
4690ce81 ^
d44123ca ^
67db19a0 ^
d44123ca ^
4690ce81 ^

d44123ca ^






4690ce81 ^
d44123ca ^
4690ce81 ^
d44123ca ^
4690ce81 ^



d44123ca ^
4690ce81 ^
d44123ca ^
4690ce81 ^
d44123ca ^
4690ce81 ^
d44123ca ^
4690ce81 ^
d44123ca ^


4690ce81 ^
d44123ca ^


4690ce81 ^
d44123ca ^


4690ce81 ^
d44123ca ^
4690ce81 ^
dcc060c7 ^
d44123ca ^


4690ce81 ^
d44123ca ^
4690ce81 ^
d44123ca ^
4690ce81 ^

d44123ca ^
d44123ca ^
4690ce81 ^
d44123ca ^

4690ce81 ^
d44123ca ^

4690ce81 ^
d44123ca ^
4690ce81 ^

d44123ca ^






4690ce81 ^
d44123ca ^
76755b28 ^
4690ce81 ^

d44123ca ^
4690ce81 ^


d44123ca ^
d44123ca ^
4690ce81 ^
d44123ca ^
4690ce81 ^
d44123ca ^
4690ce81 ^
d44123ca ^
4690ce81 ^
d44123ca ^


d44123ca ^

4690ce81 ^
d44123ca ^
76755b28 ^
4690ce81 ^

d44123ca ^
4690ce81 ^


d44123ca ^
4690ce81 ^
d44123ca ^
4690ce81 ^
d44123ca ^
4690ce81 ^
d44123ca ^








4690ce81 ^

d44123ca ^
4690ce81 ^
d44123ca ^
4690ce81 ^
d44123ca ^
4690ce81 ^
d44123ca ^

dcc060c7 ^
d44123ca ^
4690ce81 ^
d44123ca ^

4690ce81 ^



dcc060c7 ^
d44123ca ^

4690ce81 ^

d5d908dd ^
4690ce81 ^
67db19a0 ^
4690ce81 ^
d5d908dd ^
d44123ca ^



4690ce81 ^
d44123ca ^






4690ce81 ^
76755b28 ^
4690ce81 ^
dcc060c7 ^
4690ce81 ^
dcc060c7 ^
d5d908dd ^

4690ce81 ^





d5d908dd ^
4690ce81 ^

d5d908dd ^
d44123ca ^
4690ce81 ^
d44123ca ^


db1f56c8 ^
4690ce81 ^
db1f56c8 ^
4690ce81 ^
db1f56c8 ^


4690ce81 ^

67db19a0 ^

4690ce81 ^
67db19a0 ^




4690ce81 ^
db1f56c8 ^


4690ce81 ^
db1f56c8 ^



67db19a0 ^
db1f56c8 ^
d44123ca ^


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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276