Skip to content

Commit

Permalink
Create the MacOS installer.
Browse files Browse the repository at this point in the history
Signed-off-by: Wei Ren <wrn@amazon.com>
  • Loading branch information
Wei Ren committed Nov 4, 2018
1 parent a1412ff commit af31531
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -74,6 +74,8 @@ docs/_build/
target/*
# Linux installer
!target/txt2mobi3_app.deb
# MacOS installer
!target/txt2mobi3_app.dmg
# Windows installer
!target/txt2mobi3_appSetup.exe

Expand Down
29 changes: 25 additions & 4 deletions README.md
Expand Up @@ -17,17 +17,17 @@ $ txt2mobi3_app

下面以Ubuntu 16.04LTS为例:

```bash
```bash
$ sudo dpkg -i target/txt2mobi3_app.deb
```

(2) MacOS

TODO
将txt2mobi3_app.dmg移动到Application中。

(3) Windows

TODO
点击运行txt2mobi3_appSetup.exe。

## 2. 产生安装包

Expand Down Expand Up @@ -62,7 +62,28 @@ $ python -m fbs freeze

### 2.2. MacOS

TODO
以macOS Sierra 10.12.6为例:

(1) 先产生一个可以单独执行的可执行文件。

```bash
$ python -m fbs freeze
```

(2) 手动将默认封面图片和KindleGen程序等资源复制到包含有可执行文件的子目录txt2mobi3下。

```bash
$ cp -a src/main/resources/base/txt2mobi3/resources target/txt2mobi3_app/txt2mobi3/
$ cp -a src/main/resources/mac/txt2mobi3/resources/kindlegen/ target/txt2mobi3_app/txt2mobi3/resources/
```

因为fbs的一个可能bug(具体参见https://github.com/mherrmann/fbs/issues/39),所以这里我们不得不需要手动复制这些文件。

(3) 产生安装包。

```bash
$ python -m fbs installer
```

### 2.3. Windows

Expand Down
49 changes: 35 additions & 14 deletions README.rst
Expand Up @@ -15,8 +15,8 @@ written in Chinese.

.. code:: bash
$ pip install txt2mobi3_app
$ txt2mobi3_app
$ pip install txt2mobi3_app
$ txt2mobi3_app
1.2. 从安装包:
~~~~~~~~~~~~~~~
Expand All @@ -25,17 +25,17 @@ written in Chinese.

下面以Ubuntu 16.04LTS为例:

.. code:: bash
.. code:: bash

$ sudo dpkg -i target/txt2mobi3_app.deb
$ sudo dpkg -i target/txt2mobi3_app.deb

(2) MacOS

TODO
将txt2mobi3_app.dmg移动到Application中。

(3) Windows

TODO
点击运行txt2mobi3_appSetup.exe。

2. 产生安装包
-------------
Expand All @@ -51,29 +51,50 @@ TODO

.. code:: bash
$ sudo apt install ruby ruby-dev rubygems build-essential
$ sudo gem install --no-ri --no-rdoc fpm
$ sudo apt install ruby ruby-dev rubygems build-essential
$ sudo gem install --no-ri --no-rdoc fpm
(2) 产生安装包

.. code:: bash
$ python -m fbs installer
$ python -m fbs installer
生成的安装包\ ``txt2mobi3_app.deb``\ 会在\ ``target``\ 目录中。

如果想产生一个可以单独运行的可执行文件,那么就运行下面这个fbs命令。

.. code:: bash
$ python -m fbs freeze
$ python -m fbs freeze
生成的可执行文件位于\ ``target/txt2mobi3_app``\ 目录中。将\ ``target/txt2mobi3_app``\ 目录复制到别的机器上后就可运行其中的可执行文件。

2.2. MacOS
~~~~~~~~~~

TODO
以macOS Sierra 10.12.6为例:

(1) 先产生一个可以单独执行的可执行文件。

.. code:: bash
$ python -m fbs freeze
(2) 手动将默认封面图片和KindleGen程序等资源复制到包含有可执行文件的子目录txt2mobi3下。

.. code:: bash
$ cp -a src/main/resources/base/txt2mobi3/resources target/txt2mobi3_app/txt2mobi3/
$ cp -a src/main/resources/mac/txt2mobi3/resources/kindlegen/ target/txt2mobi3_app/txt2mobi3/resources/
因为fbs的一个可能bug(具体参见https://github.com/mherrmann/fbs/issues/39),所以这里我们不得不需要手动复制这些文件。

(3) 产生安装包。

.. code:: bash
$ python -m fbs installer
2.3. Windows
~~~~~~~~~~~~
Expand All @@ -87,15 +108,15 @@ TODO

.. code:: bash
$ python -m fbs installer
$ python -m fbs installer
生成的安装包\ ``txt2mobi3_appSetup.exe.ext``\ 会在\ ``target``\ 目录中。

如果想产生一个可以单独运行的可执行文件,那么就运行下面这个fbs命令。

.. code:: bash
$ python -m fbs freeze
$ python -m fbs freeze
3. README.rst
-------------
Expand All @@ -104,4 +125,4 @@ README.rst is generated from README.md via ``pandoc``.

.. code:: bash
$ pandoc --from=markdown --to=rst --output=README.rst README.md
$ pandoc --from=markdown --to=rst --output=README.rst README.md
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -19,7 +19,7 @@

setup(
name='txt2mobi3_app',
version='0.1.7',
version='0.2.0',
description='A PyQt5 application for converting Chinese novel txt files into Kindle mobi files.',
long_description=long_description,
url='https://github.com/renweizhukov/txt2mobi3_app',
Expand Down
Binary file added target/txt2mobi3_app.dmg
Binary file not shown.

0 comments on commit af31531

Please sign in to comment.