termux / termux-create-package

Python script to create Termux packages easily.
https://termux.com
Apache License 2.0
417 stars 95 forks source link

Rewrite termux-create-package #35

Closed agnostic-apollo closed 2 years ago

agnostic-apollo commented 2 years ago

Check README.md for further details. It seems to be working fine for both ubuntu and termux (android 7) as per my tests. Let me know if there are any issues. I'll wait a while for feedback before bumping version and merging. A single commit was done since pretty much everything has been replaced or deleted from previous versions and this is more like an initial commit.

Release workflow and manual install instructions do need to be tested. Looks fine, final tests would need to be done after merging anyways.

Added

Changed

Install instructions

You can run following commands to install the updated script.

Termux

pkg install python && \
pip install ruamel.yaml && \
pkg install curl && \
export install_path="/data/data/com.termux/files/usr/bin" && \
mkdir -p "$install_path" && \
curl -L 'https://github.com/agnostic-apollo/termux-create-package/raw/rewrite/src/termux-create-package' -o "$install_path/termux-create-package" && \
export owner="$(stat -c "%u" "$install_path")"; chown "$owner:$owner" "$install_path/termux-create-package" && \
chmod 700 "$install_path/termux-create-package";

Linux Distros

sudo apt install python3 python3-pip  && \
sudo pip3 install ruamel.yaml && \
sudo apt install curl && \
export install_path="/usr/local/bin" && \
sudo mkdir -p "$install_path" && \
sudo curl -L 'https://github.com/agnostic-apollo/termux-create-package/raw/rewrite/src/termux-create-package' -o "$install_path/termux-create-package" && \
sudo chmod 755 "$install_path/termux-create-package";
Yisus7u7 commented 2 years ago

excellent !, this will help a lot to the automation and creation of packages for termux, many people will find it useful and it will encourage the use of deb packages to package projects

agnostic-apollo commented 2 years ago

excellent !, this will help a lot to the automation and creation of packages for termux, many people will find it useful and it will encourage the use of deb packages to package projects

Thanks. Automation was my goal too.

I have added install instructions in main comment above.

Yisus7u7 commented 2 years ago

I am already using your update.

but I need a favor, can you give me an example of how to add a postins / postrm to the package? I didn't see how to do that in the documentation and I need it.

agnostic-apollo commented 2 years ago

It is documented at https://github.com/agnostic-apollo/termux-create-package/tree/rewrite#Other-Control-Files

The maintainer scripts preinst, postinst, prerm, postrm, config and other control files conffiles, templates, shlibs are automatically added to control.tar* if they exist in control_files_dir or files_dir.

Yisus7u7 commented 2 years ago

Do you mean that if there is a folder called "control_files_dir" in the place of the script, it will automatically add the scripts that are inside that folder?

agnostic-apollo commented 2 years ago

No, those are keys where you supply the path. Check https://github.com/agnostic-apollo/termux-create-package/blob/rewrite/examples/goodbye-world/manifest-android-termux.yml#L16 and https://github.com/agnostic-apollo/termux-create-package/tree/rewrite/examples/goodbye-world/control of goodbye-world example.

Yisus7u7 commented 2 years ago

Oh, thanks!

Yisus7u7 commented 2 years ago

When will it be available?

agnostic-apollo commented 2 years ago

When will it be available?

Well, like mostly always, nobody or not many are interested in testing (huge) changes, so will just merge after bumping versions and update package in termux-packages. I am not sure who has access for python package publishing, @xeffyr seems to have it.

Yisus7u7 commented 2 years ago

Oh, ok