diff --git a/Changelog b/Changelog index 6441d2b..8892a1a 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,7 @@ +2016-01-29 version 0.2.4 +1.修复一个配置的bug +2.提供32位的deb包 + 2016-01-27 version 0.2.3 1.打包为deb包 2.软件字体更换为DroidSansFallbackFull diff --git a/README.md b/README.md index e312bbf..8177391 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ https://github.com/yingDev/Tickeys ##编译安装(需要安装依赖): * 以下方法需要**先执行**`sudo apt-get install python-dev python-pip python-kivy xdotool gksu`来安装依赖,一般这样就可以满足运行条件了。 -* 安装库(注意版本): sudo pip install cython==0.20.2 notify2 pyinstaller==3.0 kivy==1.9.0 +* 安装库(注意版本): sudo pip install cython==0.20.2 notify2 pyinstaller==3.0 kivy==1.9.0 evdev #### 快速编译安装:执行`sudo apt-get install python-dev python-pip python-kivy xdotool && sudo easy_install tickeys`。 diff --git a/build.spec b/build.spec index c6c4a41..08f2691 100644 --- a/build.spec +++ b/build.spec @@ -2,22 +2,28 @@ # coding: utf-8 block_cipher = None -a = Analysis(['./tickeys/run.py'], - pathex=['./tickeys'], - binaries=[ - ], # 动态库 - datas=[("./tickeys/tickeys.png",".")], # 数据文件,可以是任意文件类型,例如ini配置文件、字体文件、图片等 - hiddenimports=['six','packaging', 'packaging.version', 'packaging.specifiers'], - hookspath=None, - runtime_hooks=None, - excludes=None, - win_no_prefer_redirects=None, - win_private_assemblies=None, - cipher=block_cipher) +a = Analysis( + ['./tickeys/run.py'], + pathex=['./tickeys'], + binaries=[ + ('lib/64/libmodplug.so.1',"."), + ('lib/64/libSDL2_ttf-2.0.so.0',"."), + ('lib/64/libSDL2_image-2.0.so.0',"."), + ('lib/64/libSDL2_mixer-2.0.so.0',"."), + ('lib/64/libSDL2-2.0.so.0',"."), + ('lib/64/libsndio.so.6.0',"."), + ], # 动态库 + datas=[("./tickeys/tickeys.png",".")], # 数据文件,可以是任意文件类型,例如ini配置文件、字体文件、图片等 + hiddenimports=['six','packaging', 'packaging.version', 'packaging.specifiers'], + hookspath=None, + runtime_hooks=None, + excludes=None, + win_no_prefer_redirects=None, + win_private_assemblies=None, + cipher=block_cipher) a.datas += Tree("./tickeys/Resources", prefix = "Resources") a.datas += Tree("./tickeys/kivy", prefix = "kivy") -pyz = PYZ(a.pure, a.zipped_data, - cipher=block_cipher) +pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) exe = EXE(pyz, a.scripts, a.binaries, diff --git a/build32.sh b/build32.sh new file mode 100644 index 0000000..abb5a56 --- /dev/null +++ b/build32.sh @@ -0,0 +1,2 @@ +#!/bin/bash +pyinstaller build32.spec \ No newline at end of file diff --git a/build32.spec b/build32.spec new file mode 100644 index 0000000..6b6a048 --- /dev/null +++ b/build32.spec @@ -0,0 +1,37 @@ +# -*- mode: python -*- +# coding: utf-8 +block_cipher = None + +a = Analysis( + ['./tickeys/run.py'], + pathex=['./tickeys'], + binaries=[ + ('lib/32/libmodplug.so.1',"."), + ('lib/32/libSDL2_ttf-2.0.so.0',"."), + ('lib/32/libSDL2_image-2.0.so.0',"."), + ('lib/32/libSDL2_mixer-2.0.so.0',"."), + ('lib/32/libSDL2-2.0.so.0',"."), + ('lib/32/libsndio.so.6.0',"."), + ], # 动态库 + datas=[("./tickeys/tickeys.png",".")], # 数据文件,可以是任意文件类型,例如ini配置文件、字体文件、图片等 + hiddenimports=['six','packaging', 'packaging.version', 'packaging.specifiers'], + hookspath=None, + runtime_hooks=None, + excludes=None, + win_no_prefer_redirects=None, + win_private_assemblies=None, + cipher=block_cipher) +a.datas += Tree("./tickeys/Resources", prefix = "Resources") +a.datas += Tree("./tickeys/kivy", prefix = "kivy") +pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + name='Tickeys', + debug=False, + strip=None, + upx=True, + console=True + ) diff --git a/deb32.sh b/deb32.sh new file mode 100644 index 0000000..cf5d13c --- /dev/null +++ b/deb32.sh @@ -0,0 +1,4 @@ +#!/bin/bash +sh build32.sh +cd dist +sudo sh make_deb32.sh \ No newline at end of file diff --git a/dist/make_deb.sh b/dist/make_deb.sh index 89757b4..cf95b57 100644 --- a/dist/make_deb.sh +++ b/dist/make_deb.sh @@ -1,30 +1,46 @@ #!/bin/bash -echo "Creating tickeys.deb" +version=0.2.4 +folder_name=tickeys_$version\_amd64 + +echo "Creating $folder_name.deb" #Creating a .deb.. -mkdir -p tickeys/usr/local/bin -mkdir -p tickeys/usr/share/applications -mkdir -p tickeys/usr/share/app-install/desktop -mkdir -p tickeys/usr/share/Tickeys/icons -mkdir -p tickeys/DEBIAN +mkdir -p $folder_name/usr/bin +mkdir -p $folder_name/usr/local/bin +mkdir -p $folder_name/usr/share/applications +mkdir -p $folder_name/usr/share/app-install/desktop +mkdir -p $folder_name/usr/share/Tickeys/icons +mkdir -p $folder_name/DEBIAN + +chmod -R 0755 $folder_name/DEBIAN +cp postrm $folder_name/DEBIAN/postrm +chmod -R 0755 $folder_name/DEBIAN/postrm +cp postrm $folder_name/DEBIAN/postrm +chmod -R 0755 $folder_name/DEBIAN/postrm -cp tickeys.png tickeys/usr/share/Tickeys/icons/tickeys.png +cp tickeys.png $folder_name/usr/share/Tickeys/icons/tickeys.png -deb_control="Source: Tickeys +deb_control="Source: $folder_name Priority: extra Maintainer: Bill Author: Bill Build-Depends: debhelper (>= 8.0.0) +Depends: xdotool(>= 2), gksu Standards-Version: 3.9.2 Package: tickeys -Version: 0.2.3 -Architecture: i386 -Installed-Size: 32253411 -Description: Instant audio feedback when typing, For Linux. (https://github.com/BillBillBillBill/Tickeys-linux) +Version: $version +Section: misc +Homepage: https://github.com/BillBillBillBill/Tickeys-linux +Architecture: amd64 +Installed-Size: 32253 +Description: Tickeys是一款很强大的键盘音效软件。 + Tickeys 自带了多种声音效果方案,有打字机、冒泡、机械键盘、剑气等。 + 每天都听着键盘声音是不是很烦闷,现在有了这款神器你就可以瞬间帮助自己的键盘加上逼格特效。 + 项目主页:https://github.com/BillBillBillBill/Tickeys-linux " -echo "$deb_control" > tickeys/DEBIAN/control -chown root tickeys/DEBIAN/control +echo "$deb_control" > $folder_name/DEBIAN/control +chown root $folder_name/DEBIAN/control desktop="#!/usr/bin/env xdg-open [Desktop Entry] @@ -42,17 +58,17 @@ Name=Tickeys Comment=Instant audio feedback when typing. For Linux. " -echo "$desktop" > tickeys/usr/share/applications/Tickeys.desktop -chmod a+x tickeys/usr/share/applications/Tickeys.desktop -chown root tickeys/usr/share/applications/Tickeys.desktop - -echo "$desktop" > tickeys/usr/share/app-install/desktop/Tickeys.desktop -chmod a+x tickeys/usr/share/app-install/desktop/Tickeys.desktop -chown root tickeys/usr/share/app-install/desktop/Tickeys.desktop +echo "$desktop" > $folder_name/usr/share/applications/Tickeys.desktop +chmod a+x $folder_name/usr/share/applications/Tickeys.desktop +chown root $folder_name/usr/share/applications/Tickeys.desktop -cp Tickeys tickeys/usr/local/bin/Tickeys +echo "$desktop" > $folder_name/usr/share/app-install/desktop/Tickeys.desktop +chmod a+x $folder_name/usr/share/app-install/desktop/Tickeys.desktop +chown root $folder_name/usr/share/app-install/desktop/Tickeys.desktop -dpkg-deb -z9 -b tickeys +cp Tickeys $folder_name/usr/local/bin/Tickeys +ln -s /usr/local/bin/Tickeys $folder_name/usr/bin/tickeys +dpkg-deb -z9 -b $folder_name echo "ok." diff --git a/dist/make_deb32.sh b/dist/make_deb32.sh new file mode 100644 index 0000000..cc7dabb --- /dev/null +++ b/dist/make_deb32.sh @@ -0,0 +1,74 @@ +#!/bin/bash + +version=0.2.4 +folder_name=tickeys_$version\_i386 + +echo "Creating $folder_name.deb" +#Creating a .deb.. +mkdir -p $folder_name/usr/bin +mkdir -p $folder_name/usr/local/bin +mkdir -p $folder_name/usr/share/applications +mkdir -p $folder_name/usr/share/app-install/desktop +mkdir -p $folder_name/usr/share/Tickeys/icons +mkdir -p $folder_name/DEBIAN + +chmod -R 0755 $folder_name/DEBIAN +cp postrm $folder_name/DEBIAN/postrm +chmod -R 0755 $folder_name/DEBIAN/postrm +cp postinst $folder_name/DEBIAN/postinst +chmod -R 0755 $folder_name/DEBIAN/postinst + +cp tickeys.png $folder_name/usr/share/Tickeys/icons/tickeys.png + +deb_control="Source: $folder_name +Priority: extra +Maintainer: Bill +Author: Bill +Build-Depends: debhelper (>= 8.0.0) +Depends: xdotool(>= 2), gksu +Standards-Version: 3.9.2 +Package: tickeys +Version: $version +Section: misc +Homepage: https://github.com/BillBillBillBill/Tickeys-linux +Architecture: i386 +Installed-Size: 32253 +Description: Tickeys是一款很强大的键盘音效软件。 + Tickeys 自带了多种声音效果方案,有打字机、冒泡、机械键盘、剑气等。 + 每天都听着键盘声音是不是很烦闷,现在有了这款神器你就可以瞬间帮助自己的键盘加上逼格特效。 + 项目主页:https://github.com/BillBillBillBill/Tickeys-linux +" + +echo "$deb_control" > $folder_name/DEBIAN/control +chown root $folder_name/DEBIAN/control + +desktop="#!/usr/bin/env xdg-open +[Desktop Entry] +Version=1.0 +Type=Application +Categories=Application; +Exec=gksu /usr/local/bin/Tickeys +Icon=/usr/share/Tickeys/icons/tickeys.png +Terminal=false +Hidden=false +NoDisplay=false +StartupNotify=true +X-GNOME-Autostart-enabled=true +Name=Tickeys +Comment=Instant audio feedback when typing. For Linux. +" + +echo "$desktop" > $folder_name/usr/share/applications/Tickeys.desktop +chmod a+x $folder_name/usr/share/applications/Tickeys.desktop +chown root $folder_name/usr/share/applications/Tickeys.desktop + +echo "$desktop" > $folder_name/usr/share/app-install/desktop/Tickeys.desktop +chmod a+x $folder_name/usr/share/app-install/desktop/Tickeys.desktop +chown root $folder_name/usr/share/app-install/desktop/Tickeys.desktop + +cp Tickeys $folder_name/usr/local/bin/Tickeys +ln -s /usr/local/bin/Tickeys $folder_name/usr/bin/tickeys + +dpkg-deb -z9 -b $folder_name + +echo "ok." diff --git a/dist/postinst b/dist/postinst new file mode 100755 index 0000000..db3b5e9 --- /dev/null +++ b/dist/postinst @@ -0,0 +1,7 @@ +#!/bin/sh +set -e +# Automatically added by dh_icons +if which update-icon-caches >/dev/null 2>&1 ; then + update-icon-caches /usr/share/icons/ubuntu-mono-dark /usr/share/icons/ubuntu-mono-light +fi +# End automatically added section diff --git a/dist/postrm b/dist/postrm new file mode 100644 index 0000000..5fa06f4 --- /dev/null +++ b/dist/postrm @@ -0,0 +1,11 @@ +#!/bin/sh +rm -f /usr/bin/tickeys +rm -f /usr/share/icons/Tickeys/tickeys.png +rm -f /usr/share/applications/Tickeys.desktop +rm -f /etc/xdg/autostart/Tickeys.desktop +rm -f ~/.config/autostart/Tickeys.desktop +rm -f ~/.config/openbox/autostart/Tickeys.desktop +set -e +# Automatically added by dh_installmenu +if [ -x "`which update-menus 2>/dev/null`" ]; then update-menus ; fi +# End automatically added section diff --git a/dist/uninstall.sh b/dist/uninstall.sh deleted file mode 100644 index aa3eedb..0000000 --- a/dist/uninstall.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -rm /usr/bin/tickeys -rm /usr/share/icons/Tickeys/tickeys.png -rm /usr/share/applications/Tickeys.desktop -rm /etc/xdg/autostart/Tickeys.desktop -rm ~/.config/autostart/Tickeys.desktop -rm ~/.config/openbox/autostart/Tickeys.desktop -echo Uninstall tickeys success \ No newline at end of file diff --git a/lib/32/libSDL2-2.0.so.0 b/lib/32/libSDL2-2.0.so.0 new file mode 100644 index 0000000..4cffee8 Binary files /dev/null and b/lib/32/libSDL2-2.0.so.0 differ diff --git a/lib/32/libSDL2_image-2.0.so.0 b/lib/32/libSDL2_image-2.0.so.0 new file mode 100644 index 0000000..64c3883 Binary files /dev/null and b/lib/32/libSDL2_image-2.0.so.0 differ diff --git a/lib/32/libSDL2_mixer-2.0.so.0 b/lib/32/libSDL2_mixer-2.0.so.0 new file mode 100644 index 0000000..6164e2e Binary files /dev/null and b/lib/32/libSDL2_mixer-2.0.so.0 differ diff --git a/lib/32/libSDL2_ttf-2.0.so.0 b/lib/32/libSDL2_ttf-2.0.so.0 new file mode 100644 index 0000000..901e7e6 Binary files /dev/null and b/lib/32/libSDL2_ttf-2.0.so.0 differ diff --git a/lib/32/libmodplug.so.1 b/lib/32/libmodplug.so.1 new file mode 100644 index 0000000..2b1ede7 Binary files /dev/null and b/lib/32/libmodplug.so.1 differ diff --git a/lib/32/libsndio.so.6.0 b/lib/32/libsndio.so.6.0 new file mode 100644 index 0000000..d89a50d Binary files /dev/null and b/lib/32/libsndio.so.6.0 differ diff --git a/lib/libSDL2-2.0.so.0 b/lib/64/libSDL2-2.0.so.0 similarity index 100% rename from lib/libSDL2-2.0.so.0 rename to lib/64/libSDL2-2.0.so.0 diff --git a/lib/libSDL2_image-2.0.so.0 b/lib/64/libSDL2_image-2.0.so.0 similarity index 100% rename from lib/libSDL2_image-2.0.so.0 rename to lib/64/libSDL2_image-2.0.so.0 diff --git a/lib/libSDL2_mixer-2.0.so.0 b/lib/64/libSDL2_mixer-2.0.so.0 similarity index 100% rename from lib/libSDL2_mixer-2.0.so.0 rename to lib/64/libSDL2_mixer-2.0.so.0 diff --git a/lib/libSDL2_ttf-2.0.so.0 b/lib/64/libSDL2_ttf-2.0.so.0 similarity index 100% rename from lib/libSDL2_ttf-2.0.so.0 rename to lib/64/libSDL2_ttf-2.0.so.0 diff --git a/lib/64/libmodplug.so.1 b/lib/64/libmodplug.so.1 new file mode 100644 index 0000000..40715d7 Binary files /dev/null and b/lib/64/libmodplug.so.1 differ diff --git a/lib/libsndio.so.6.0 b/lib/64/libsndio.so.6.0 similarity index 100% rename from lib/libsndio.so.6.0 rename to lib/64/libsndio.so.6.0 diff --git a/tickeys/__init__.py b/tickeys/__init__.py index 473ba0e..1005176 100644 --- a/tickeys/__init__.py +++ b/tickeys/__init__.py @@ -1,6 +1,6 @@ __author__ = 'Huang Xiongbiao' __email__ = 'billo@qq.com' -__version__ = '0.2.3' +__version__ = '0.2.4' debug_mode = False from run import main diff --git a/tickeys/config.py b/tickeys/config.py index 5ae8ce2..97a6899 100644 --- a/tickeys/config.py +++ b/tickeys/config.py @@ -21,7 +21,14 @@ def init_config(self): def read_config(self): try: - if not os.path.exists("/usr/share/Tickeys/config") or not os.path.exists("/usr/share/Tickeys/config/tickeys.conf"): + config_path = [ + "/usr/share/Tickeys", + "/usr/share/Tickeys/config", + "/usr/share/Tickeys/config/tickeys.conf" + ] + if not all([os.path.exists(cp) for cp in config_path]): + if not os.path.exists("/usr/share/Tickeys"): + os.mkdir("/usr/share/Tickeys") if not os.path.exists("/usr/share/Tickeys/config"): os.mkdir("/usr/share/Tickeys/config") self.init_config() diff --git a/tickeys/requirements.txt b/tickeys/requirements.txt index ff241a4..0751092 100644 --- a/tickeys/requirements.txt +++ b/tickeys/requirements.txt @@ -1,6 +1,5 @@ -cython -Pygments +cython==0.20.2 evdev -Kivy -cx_freeze +kivy==1.9.0 +pyinstaller==3.0 notify2 \ No newline at end of file diff --git a/tickeys_0.2.3.deb b/tickeys_0.2.3.deb deleted file mode 100644 index 3425b30..0000000 Binary files a/tickeys_0.2.3.deb and /dev/null differ