diff --git a/BUILD.md b/BUILD.md index e01a221e..054a89df 100644 --- a/BUILD.md +++ b/BUILD.md @@ -15,7 +15,7 @@ Note that python-stem appears in Debian wheezy and newer (so by extension Tails ```sh sudo apt-get install -y build-essential fakeroot python-all python-stdeb python-flask python-stem python-qt4 -./build_deb.sh +./install/build_deb.sh sudo dpkg -i deb_dist/onionshare_*.deb ``` @@ -23,7 +23,7 @@ sudo dpkg -i deb_dist/onionshare_*.deb ```sh sudo yum install -y rpm-build python-flask python-stem pyqt4 -./build_rpm.sh +./install/build_rpm.sh sudo yum install -y dist/onionshare-*.rpm ``` @@ -54,7 +54,7 @@ Each time you start work: To build the .app: ```sh -pyinstaller -w -y setup/onionshare-osx.spec +pyinstaller -w -y install/onionshare-osx.spec ``` Now you should have `dist/OnionShare.app`. @@ -62,7 +62,7 @@ Now you should have `dist/OnionShare.app`. To build a .dmg (this script builds the .app for you): ```sh -./build_dmg.sh +./install/build_dmg.sh ``` Now you should have `dist/OnionShare.dmg`. @@ -95,13 +95,13 @@ If you want to sign binaries with Authenticode: ### To make a .exe: -* Open a command prompt, cd into the onionshare directory, and type: `pyinstaller -y setup\onionshare-win.spec`. Inside the `dist` folder there will be a folder called `onionshare` with `onionshare.exe` in it. +* Open a command prompt, cd into the onionshare directory, and type: `pyinstaller -y install\onionshare-win.spec`. Inside the `dist` folder there will be a folder called `onionshare` with `onionshare.exe` in it. ### To build the installer: -Note that you must have a code signing certificate installed in order to use the `build_exe.bat` script, because it tries code signing both `onionshare.exe` and `OnionShare_Setup.exe`. +Note that you must have a code signing certificate installed in order to use the `install\build_exe.bat` script, because it tries code signing both `onionshare.exe` and `OnionShare_Setup.exe`. -Open a command prompt, cd to the onionshare directory, and type: `build_exe.bat` +Open a command prompt, cd to the onionshare directory, and type: `install\build_exe.bat` A NSIS window will pop up, and once it's done you will have `dist\OnionShare_Setup.exe`. diff --git a/build_deb.sh b/install/build_deb.sh similarity index 70% rename from build_deb.sh rename to install/build_deb.sh index 5461283d..6201cb8c 100755 --- a/build_deb.sh +++ b/install/build_deb.sh @@ -1,9 +1,12 @@ #!/bin/sh +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )" +cd $DIR + VERSION=`cat version` # clean up from last build -rm -r deb_dist +rm -r deb_dist >/dev/null 2>&1 # build binary package python setup.py --command-packages=stdeb.command bdist_deb diff --git a/build_dmg.sh b/install/build_dmg.sh similarity index 95% rename from build_dmg.sh rename to install/build_dmg.sh index 9b451bb5..987ccb3b 100755 --- a/build_dmg.sh +++ b/install/build_dmg.sh @@ -1,6 +1,6 @@ #!/bin/bash -ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )" DMG_DIR=$ROOT/dist/dmg DMG_TMP_NAME=$ROOT/dist/tmp.dmg DMG_NAME=$ROOT/dist/OnionShare.dmg @@ -14,7 +14,7 @@ echo Deleting dist folder rm -rf $ROOT/dist &>/dev/null 2>&1 # build the .app -echo Building OnionShare.app +echo Building OnionShare.app pyinstaller -w -y $ROOT/setup/onionshare-osx.spec # create the .dmg diff --git a/build_exe.bat b/install/build_exe.bat similarity index 84% rename from build_exe.bat rename to install/build_exe.bat index 04a3b2ff..b8cfc51d 100644 --- a/build_exe.bat +++ b/install/build_exe.bat @@ -1,5 +1,5 @@ REM use pyinstaller to builder a folder with onionshare.exe -pyinstaller -y setup\onionshare-win.spec +pyinstaller -y install\onionshare-win.spec REM sign onionshare.exe signtool.exe sign /v /d "OnionShare" /a /tr "http://www.startssl.com/timestamp" dist\onionshare\onionshare.exe @@ -8,7 +8,7 @@ REM run onionshare once, to compile the .py files into .pyc dist\onionshare\onionshare.exe --help REM build an installer, dist\OnionShare_Setup.exe -makensisw setup\onionshare.nsi +makensisw install\onionshare.nsi REM sign OnionShare_Setup.exe signtool.exe sign /v /d "OnionShare" /a /tr "http://www.startssl.com/timestamp" dist\OnionShare_Setup.exe diff --git a/build_rpm.sh b/install/build_rpm.sh similarity index 71% rename from build_rpm.sh rename to install/build_rpm.sh index 45fbe178..7f9d260a 100755 --- a/build_rpm.sh +++ b/install/build_rpm.sh @@ -1,9 +1,12 @@ #!/bin/sh +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )" +cd $DIR + VERSION=`cat version` # clean up from last build -rm -r build dist +rm -r build dist >/dev/null 2>&1 # build binary package python setup.py bdist_rpm --requires="python-flask, python-stem, pyqt4" diff --git a/check_lacked_trans.py b/install/check_lacked_trans.py similarity index 100% rename from check_lacked_trans.py rename to install/check_lacked_trans.py diff --git a/setup/dmg_background.png b/install/dmg_background.png similarity index 100% rename from setup/dmg_background.png rename to install/dmg_background.png diff --git a/setup/license.txt b/install/license.txt similarity index 100% rename from setup/license.txt rename to install/license.txt diff --git a/setup/onionshare-launcher.py b/install/onionshare-launcher.py similarity index 100% rename from setup/onionshare-launcher.py rename to install/onionshare-launcher.py diff --git a/setup/onionshare-osx.spec b/install/onionshare-osx.spec similarity index 92% rename from setup/onionshare-osx.spec rename to install/onionshare-osx.spec index dc72000e..ddc87c07 100644 --- a/setup/onionshare-osx.spec +++ b/install/onionshare-osx.spec @@ -1,5 +1,5 @@ # -*- mode: python -*- -a = Analysis(['setup/onionshare-launcher.py'], +a = Analysis(['install/onionshare-launcher.py'], pathex=['.'], hiddenimports=['onionshare', 'onionshare_gui'], hookspath=None, @@ -48,5 +48,5 @@ app = BUNDLE(exe, upx=True, name='OnionShare.app', appname='OnionShare', - icon='setup/onionshare.icns', + icon='install/onionshare.icns', version=open('version').read().strip()) diff --git a/setup/onionshare-win.spec b/install/onionshare-win.spec similarity index 91% rename from setup/onionshare-win.spec rename to install/onionshare-win.spec index 1a6f3d77..74ae03c1 100644 --- a/setup/onionshare-win.spec +++ b/install/onionshare-win.spec @@ -1,5 +1,5 @@ # -*- mode: python -*- -a = Analysis(['setup/onionshare-launcher.py'], +a = Analysis(['install/onionshare-launcher.py'], hiddenimports=['onionshare', 'onionshare_gui'], hookspath=None, runtime_hooks=None) @@ -29,7 +29,7 @@ exe = EXE(pyz, debug=False, strip=False, upx=True, - icon='setup/onionshare.ico', + icon='install/onionshare.ico', console=False ) coll = COLLECT(exe, a.binaries, diff --git a/setup/onionshare.desktop b/install/onionshare.desktop similarity index 100% rename from setup/onionshare.desktop rename to install/onionshare.desktop diff --git a/setup/onionshare.icns b/install/onionshare.icns similarity index 100% rename from setup/onionshare.icns rename to install/onionshare.icns diff --git a/setup/onionshare.ico b/install/onionshare.ico similarity index 100% rename from setup/onionshare.ico rename to install/onionshare.ico diff --git a/setup/onionshare.nsi b/install/onionshare.nsi similarity index 100% rename from setup/onionshare.nsi rename to install/onionshare.nsi diff --git a/setup/onionshare80.xpm b/install/onionshare80.xpm similarity index 100% rename from setup/onionshare80.xpm rename to install/onionshare80.xpm diff --git a/ppa_release.sh b/install/ppa_release.sh similarity index 80% rename from ppa_release.sh rename to install/ppa_release.sh index 2fe74d2b..ff369a95 100755 --- a/ppa_release.sh +++ b/install/ppa_release.sh @@ -4,9 +4,12 @@ # If you want to use it, you'll need your own ~/.dput.cf and ssh key. # More info: https://help.launchpad.net/Packaging/PPA/Uploading +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )" +cd $DIR + VERSION=`cat version` -rm -rf deb_dist +rm -rf deb_dist >/dev/null 2>&1 python setup.py --command-packages=stdeb.command sdist_dsc cd deb_dist/onionshare-$VERSION dpkg-buildpackage -S diff --git a/setup.py b/setup.py index 6e797197..485e1bf9 100644 --- a/setup.py +++ b/setup.py @@ -64,8 +64,8 @@ setup( include_package_data=True, scripts=['bin/onionshare', 'bin/onionshare-gui'], data_files=[ - (os.path.join(sys.prefix, 'share/applications'), ['setup/onionshare.desktop']), - (os.path.join(sys.prefix, 'share/pixmaps'), ['setup/onionshare80.xpm']), + (os.path.join(sys.prefix, 'share/applications'), ['install/onionshare.desktop']), + (os.path.join(sys.prefix, 'share/pixmaps'), ['install/onionshare80.xpm']), (os.path.join(sys.prefix, 'share/onionshare/images'), [ 'images/logo.png', 'images/drop_files.png', @@ -88,4 +88,3 @@ setup( ]) ] ) -