View Single Post
Old 12-20-2009, 08:19 PM   #128
DaveNB
Connoisseur
DaveNB has a complete set of Star Wars action figures.DaveNB has a complete set of Star Wars action figures.DaveNB has a complete set of Star Wars action figures.DaveNB has a complete set of Star Wars action figures.
 
Posts: 86
Karma: 399
Join Date: Jun 2007
Device: Nook, Sony PRS-500, Nokia 770 (FBReader)
Step by Step instructions for building your own stand alone OS X Python applications.

Got a few folks asking how to do this step by step. Here is what I did to compile standalone Python applications.

IMPORTANT: After compiling these programs, I recommend immediately deleting them from your hard drive to avoid getting into any legal enganglements (DMCA), do not use them to illegally strip DRM if it is illegal for you to do so in your country. This is only meant as an exercise in learning to compile stand alone Python programs.

NOTE: ineptkey.py will not compile for OS X (it has Windows dependencies), you need it to generate the adept.der file that has the decryption key for your DRM protected ePubs and you will have to find some other way to do this.

WARNING:
-You should be comfortable with issuing Unix Command Line commands in Terminal and you need admin level permissions on your computer complete these instructions. Read through all of the instructions first and if you don't understand any of this or if it scares you, this is probably NOT for you. You CAN potentially screw up your computer pretty bad or lose data if you don't know what you're doing in the command line, you have been warned!!!

-I have not personally reviewed the PyCrypto nor the Adept ineptepub.pyw and ineptpdf.pyw source code and cannot guarantee the fitness or safety of these programs. You do this at your own risk, I'm not responsible if you crash your computer, screw up your OS X install/system, lose data, etc.

Quote:
1) Create a folder on your Desktop and call it Adept
2) Locate on the internet from a reliable source, Download and Install the pycrypto 2.0.1 for 10.5 package.
3) Download, unzip and place the Python programs you want to compile into the Adept folder. Rename them so that the filenames end in ".py" instead of ".pyw"
4) Open your Terminal application.
5) Type: cd ~/Desktop/Adept
6) Type: curl -O http://peak.telecommunity.com/dist/ez_setup.py
7) Type: sudo python2.5 ez_setup.py -U setuptools
8) Type: ls /usr/local/bin to make sure that the following files are present: easy_install, easy_install-2.5, py2applet
You may want to add /usr/local/bin to your environment path to make things easier for you. If these files are not present, you did not successfully install the py2applet package and you will need to read through the web page referenced below for further information.
9) Type: /usr/local/bin/py2applet --make-setup <name of the Python program you want to build>.py
If successful, the output should say: Wrote setup.py
10) Type: python2.5 setup.py py2app
11) The resulting OS X application will be in a folder called "dist". Copy the application to your Desktop, try running it.
12) Before you try building another Python application, you should delete the "build" and "dist" folders by Typing: rm -rf build dist

Repeat steps 9 - 12 for building additional Python programs.
These instructions are taken from this URL/Online resource: http://svn.pythonmac.org/py2app/py2a...doc/index.html

If it is legal for you to strip DRM from the ePubs that you own where you live, PLEASE DO NOT use this capability for piracy and have due consideration for the Authors and Copyright holders of your ePubs.

Good luck,

Dave

Last edited by DaveNB; 12-21-2009 at 12:09 AM.
DaveNB is offline   Reply With Quote