How to Create an APK for Asustor ADM to Distribute your LAMP


I just pack ZurmoCRM for Asustor ADM successfully. It is easy for LAMP. You need a Linux with the right package to run apkg-tools.py which is a Python script and a proper configured config.json file to create APK, aka Asus PacKage. Here is the full story.

Download Tools and Reference

First, you need to register an account on Asustor Developer Corner. Login and click the Tools tab to download APKG_Utilities_2.0.zip, App_Central_Developer_Guide_2.0.1_0305.pdf, and Upload your Application.pdf.

No need to download toolchain if you don’t compile anything.

Create config.json File

Here is the config.json for ZurmoCRM for your reference. I have removed many unnecessary settings to make it easier to read.

Replace keys in general section with your LAMP information. Change the installed folder name in share-folder in register section.

{
    "general": {
        "package": "zurmocrm",
        "name": "ZurmoCRM",
        "version": "2.7.2",
        "developer": "http://zurmo.org/",
        "maintainer": "Amigo",
        "email": "amigo.chan@gmail.com",
        "website": "https://amigotechnotes.wordpress.com/",
        "architecture": "any",
        "firmware": "2.1"
    },

    "adm-desktop": {
        "app": {
            "type": "webserver"
        },

        "privilege": {
            "accessible": "users"
        }
    },

    "register": {
        "share-folder": [
            {
                "name": "zurmocrm",
                "description": "ZurmoCRM Installation Directory"
            }
        ]
    }
}

Package

Create a folder for your project and two extra folder named CONTROL and www in it. Put config.json in CONTROL and LAMP files in www.

To help others understand what he is going to install, create 3 text file description.txt, changelog.txt, and license.txt, and a 90×90 PNG file which will represent your LAMP in [App Central].  Then put them in CONTROL folder.

Here is the tree structure for easier understand.

zurmo
|-- CONTROL
|   |-- changelog.txt
|   |-- config.json
|   |-- description.txt
|   |-- icon.png
|   `-- license.txt
`-- www

Now, run apkg-tools.py with create to package. It is a python script extract from APKG_Utilities_2.0.zip. Below is an example I used to package ZurmoCRM in project folder named zurmo.

Remember to run as root or it won’t work. The owner of CONTROL folder will be changed to root, too.

amigo@Edge72z:~/Asustor> sudo ./APKG_Utilities_2.0/apkg-tools.py create ./zurmo

If everything goes well, it will create an APK and is ready to ship.

Upload and Test

Login to your device and use the Manual Install to upload your APK file. Test to see if it works.

After successfully installation, your LAMP should be display as an Icon which is the same as the PNG file you have created on ADM desktop and App Central. Click to launch your program.

Other Thoughts

If you want to make it available on App Central, follow Upload your Application.pdf and submit your program.

Reference

  1. ZurmoCRM
  2. Asustor ADM
  3. Wiki: LAMP (software bundle)
  4. Wiki: Linux
  5. Wiki: Python (programming language)
  6. Asustor Developer Corner
  7. Wiki: Toolchain

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.