[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[minion-cvs] Reorganize makefile; add install and sdist targets



Update of /home/minion/cvsroot/src/minion
In directory moria.mit.edu:/tmp/cvs-serv23283

Modified Files:
	.cvsignore Makefile TODO setup.py 
Added Files:
	MANIFEST.in 
Log Message:
Reorganize makefile; add install and sdist targets

--- NEW FILE: MANIFEST.in ---
# Can I put a comment here?
include HACKING LICENSE Makefile TODO contrib/unittest.py pycheckrc
include etc/mixminiond.conf
Index: .cvsignore
===================================================================
RCS file: /home/minion/cvsroot/src/minion/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- .cvsignore	29 May 2002 03:52:13 -0000	1.1
+++ .cvsignore	15 Dec 2002 03:47:03 -0000	1.2
@@ -1 +1,3 @@
 build
+dist
+MANIFEST

Index: Makefile
===================================================================
RCS file: /home/minion/cvsroot/src/minion/Makefile,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- Makefile	12 Dec 2002 19:56:45 -0000	1.15
+++ Makefile	15 Dec 2002 03:47:03 -0000	1.16
@@ -56,7 +56,7 @@
 	@$(FINDPYTHON); \
 	echo $$PYTHON setup.py clean; \
 	$$PYTHON setup.py clean
-	rm -rf build
+	rm -rf build dist
 	rm -f lib/mixminion/_unittest.py
 	rm -f lib/mixminion/*.pyc
 	rm -f lib/mixminion/*.pyo
@@ -72,29 +72,36 @@
 	echo $$PYTHON build/lib*/mixminion/Main.py benchmarks; \
 	($$PYTHON build/lib*/mixminion/Main.py benchmarks)
 
-# FFFF coding style target
+#======================================================================
+# Install target (minimal.)
 
-pychecker: do_build
-	( export PYTHONPATH=.; cd build/lib*; pychecker -F ../../pycheckrc ./mixminion/*.py )
+ifdef PREFIX
+PREFIXARG = --prefix="$(PREFIX)"
+export PREFIXARG
+export PREFIX
+else
+PREFIXARG=
+PREFIX=""
+export PREFIXARG
+export PREFIX
+endif
 
-lines:
-	wc -l src/*.[ch] lib/*/*.py lib/*/*/*.py
+install: do_build
+	@$(FINDPYTHON); \
+	echo $$PYTHON setup.py install $(PREFIXARG) --compile --optimize=1; \
+	$$PYTHON setup.py install $(PREFIXARG) --compile --optimize=1
 
-xxxx:
-	find lib src \( -name '*.py' -or -name '*.[ch]' \) -print0 \
-	   | xargs -0 grep 'XXXX\|FFFF\|DOCDOC\|????'
+#======================================================================
+# Source dist target
 
-xxxx001:
-	find lib src \( -name '*.py' -or -name '*.[ch]' \) -print0 \
-	   | xargs -0 grep 'XXXX001\|FFFF001\|DOCDOC\|????001'
+sdist: clean
+	@$(FINDPYTHON); \
+	echo $$PYTHON setup.py sdist; \
+	$$PYTHON setup.py sdist
 
-longlines:
-	find lib src \( -name '*.py' -or -name '*.[ch]' \) -print0 \
-	   | xargs -0 grep '^.{80,}'
+#======================================================================
+# OpenSSL-related targets
 
-#
-# Targets to make openssl get built properly.
-#
 OPENSSL_URL = ftp://ftp.openssl.org/source/openssl-0.9.7-beta4.tar.gz
 OPENSSL_FILE = openssl-0.9.7-beta4.tar.gz
 
@@ -155,3 +162,25 @@
 	fi;                                                                 \
 	rm -f ./openssl;                                                    \
 	ln -sf $$UNPACKED openssl
+
+#======================================================================
+# Coding style targets
+
+pychecker: do_build
+	( export PYTHONPATH=.; cd build/lib*; pychecker -F ../../pycheckrc \
+	  ./mixminion/*.py )
+
+lines:
+	wc -l src/*.[ch] lib/*/*.py lib/*/*/*.py
+
+xxxx:
+	find lib src \( -name '*.py' -or -name '*.[ch]' \) -print0 \
+	   | xargs -0 grep 'XXXX\|FFFF\|DOCDOC\|????'
+
+xxxx001:
+	find lib src \( -name '*.py' -or -name '*.[ch]' \) -print0 \
+	   | xargs -0 grep 'XXXX001\|FFFF001\|DOCDOC\|????001'
+
+longlines:
+	find lib src \( -name '*.py' -or -name '*.[ch]' \) -print0 \
+	   | xargs -0 grep '^.{80,}'

Index: TODO
===================================================================
RCS file: /home/minion/cvsroot/src/minion/TODO,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- TODO	12 Dec 2002 19:56:45 -0000	1.38
+++ TODO	15 Dec 2002 03:47:03 -0000	1.39
@@ -16,21 +16,21 @@
          work.  There need not be an interface for replies.  Key rotation
          need not be automated.]
 
-	. Build
-		- Marginal 'make install'
-		- Marginal 'make dist'
+	o Build
+		o Marginal 'make install'
+		o Marginal 'make dist'
 	. Integration testing
 		- Automated tests for several servers running on one machine.
 		- Tests for servers on several different machines.
 	- Documentation
 		- Contributor's guide
-		- Basic HOWTO
+		o Basic HOWTO
 		- Difference between XXXX FFFF ????
 		- Overall design
 		- More readable mixminiond.conf
 	- Patch specification:
 	  	- SPEC comments from code
-		- Incorporate e2e mixminion design
+		o Incorporate e2e mixminin design
 		- Rename stateful, stateless SURBs
 
 Required for "1.0":
@@ -128,16 +128,17 @@
 			- Hunt down leaks
 	- Build and install process
 		- Use sane arguments when testing with multiple python versions
-		. Get SSL as needed
+		o Get SSL as needed
 		- Well-tested 'make install'
 		- RPMS, debs, and so on
 		- Make sure we run on solaris and *BSD.
 		- "Somebody" should do a Windows port of the client code
+		- An init.d script.
 	- Protocol support
 		- External reply block format
 		o End-to-end payload encryption
-		. Reading messages sent to reply blocks
-		. Correct implementation of stateless reply blocks
+		o Reading messages sent to reply blocks
+		o Correct implementation of stateless reply blocks
 SPEC		o Patch to address George's 15August attack
 	- Testing
 		- Test on other (non-redhat, non-linux) systems

Index: setup.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/setup.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- setup.py	12 Dec 2002 19:56:45 -0000	1.13
+++ setup.py	15 Dec 2002 03:47:03 -0000	1.14
@@ -20,7 +20,7 @@
 
 import os, struct, shutil
 
-VERSION= '0.1'
+VERSION= '0.0.1'
 
 USE_OPENSSL=1
 
@@ -67,7 +67,43 @@
     MACROS.append( ("MM_O_ENDIAN", 1)  )
 
 #======================================================================
+# Create a startup script if we're installing.
+
+# This isn't as fully general as distutils allows.  Unfortunately, distutils
+# doesn't make it easy for us to create a script that knows where distutils
+# has been told to install.
+
+if os.environ.get('PREFIX'):
+    prefix = os.path.expanduser(os.environ["PREFIX"])
+    pathextra = os.path.join(prefix, "lib",
+			     "python"+(sys.version)[:3],
+			     "site-packages")
+else:
+    pathextra = ""
+
+SCRIPT_PATH = os.path.join("build", "mixminion")
+if not os.path.exists("build"):
+    os.mkdir("build")
+f = open(SCRIPT_PATH, 'wt')
+f.write("#!%s\n"% sys.executable)
+if pathextra:
+    f.write("import sys\nsys.path.append(%r)\n"%pathextra)
+f.write("""\
+try:
+    import mixminion.Main
+except:
+    print 'ERROR importing mixminion package.'
+    raise
+
+mixminion.Main.main(sys.argv)
+""")
+f.close()
+
+#======================================================================
+# Now, tell setup.py how to cope.
+import distutils.core
 from distutils.core import setup, Extension
+from distutils import sysconfig
 
 INCLUDE_DIRS.append("src")
 
@@ -81,8 +117,17 @@
 
 setup(name='Mixminion',
       version=VERSION,
-      description="Mixminion: Python implementation of the Type III MIX protocol (ALPHA)",
+      license="LGPL",
+      description="Mixminion: Python implementation of the Type III Mix protocol (ALPHA)",
       author="Nick Mathewson",
+      author_email="nickm@freehaven.net",
+      url="http://www.mixminion.net/";,
       package_dir={ '' : 'lib' },
       packages=['mixminion', 'mixminion.server'],
+      scripts=[SCRIPT_PATH],
       ext_modules=[extmodule])
+
+try:
+    os.unlink(SCRIPT_PATH)
+except:
+    pass