Browse code

2007-06-19 Michal Ludvig <michal@logix.cz>

* setup.py: Check for S3CMD_PACKAGING and don't install
manpages and docs if defined.
* INSTALL: Document the above change.



git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@126 830e0280-6d2a-0410-9c65-932aecc39d9d

Michal Ludvig authored on 2007/06/19 19:18:35
Showing 3 changed files
... ...
@@ -1,3 +1,9 @@
1
+2007-06-19  Michal Ludvig  <michal@logix.cz>
2
+
3
+	* setup.py: Check for S3CMD_PACKAGING and don't install
4
+	  manpages and docs if defined.
5
+	* INSTALL: Document the above change.
6
+
1 7
 2007-06-17  Michal Ludvig  <michal@logix.cz>
2 8
 
3 9
 	* s3cmd: Added encryption key support to --configure
... ...
@@ -66,6 +66,19 @@ There are three options to run s3cmd from source tarball:
66 66
    find out the actual package name and how to install it then.
67 67
 
68 68
 
69
+Note to distibutions package maintainers
70
+----------------------------------------
71
+Define shell environment variable S3CMD_PACKAGING=yes if you
72
+don't want setup.py to install manpages and doc files. You'll
73
+have to install them manually in your .spec or similar package
74
+build scripts.
75
+
76
+On the other hand if you want setup.py to install manpages 
77
+and docs, but to other than default path, define env 
78
+variables $S3CMD_INSTPATH_MAN and $S3CMD_INSTPATH_DOC. Check 
79
+out setup.py for details and default values.
80
+
81
+
69 82
 Where to get help
70 83
 -----------------
71 84
 If in doubt, or if something doesn't work as expected, 
... ...
@@ -14,8 +14,17 @@ try:
14 14
 except:
15 15
 	pass
16 16
 
17
-man_path = os.getenv("S3CMD_INSTPATH_MAN") or "share/man"
18
-doc_path = os.getenv("S3CMD_INSTPATH_DOC") or "share/doc/packages"
17
+## Don't install manpages and docs when $S3CMD_PACKAGING is set
18
+## This was a requirement of Debian package maintainer. 
19
+if not os.getenv("S3CMD_PACKAGING"):
20
+	man_path = os.getenv("S3CMD_INSTPATH_MAN") or "share/man"
21
+	doc_path = os.getenv("S3CMD_INSTPATH_DOC") or "share/doc/packages"
22
+	data_files = [	
23
+		(doc_path+"/s3cmd", [ "README", "INSTALL", "NEWS" ]),
24
+		(man_path+"/man1", [ "s3cmd.1" ] ),
25
+	]
26
+else:
27
+	data_files = None
19 28
 
20 29
 ## Main distutils info
21 30
 setup(
... ...
@@ -24,10 +33,7 @@ setup(
24 24
 	version = S3.PkgInfo.version,
25 25
 	packages = [ 'S3' ],
26 26
 	scripts = ['s3cmd'],
27
-	data_files = [
28
-		(doc_path+"/s3cmd", [ "README", "INSTALL", "NEWS" ]),
29
-		(man_path+"/man1", [ "s3cmd.1" ] ),
30
-	],
27
+	data_files = data_files,
31 28
 
32 29
 	## Packaging details
33 30
 	author = "Michal Ludvig",