termux / termux-create-package

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

How to include an entire directory? #20

Closed yuriusu22 closed 4 years ago

yuriusu22 commented 4 years ago

EDIT

I found the line for the directory recursion:

data_tarfile.add(input_file_path, arcname=output_file, recursive=False)

Note: Setting recursive=False to True will enable directory recursion. From Python docs: tarfile.TarFile.add

I think recursion should be enabled by default.


I can't figure out how to include a directory. Does packaging an entire directory supported?

Suppose I have this setup:

.
├── bin
│   └── script
└── manifest.json

Can we just include the directory bin and be placed directly to the prefix (similar to how package.json#files works in npm)? Something like this:

"files": {
  "bin": "."
}

Would somehow result to this:

/data/data/com.termux/files/usr/bin/script

It would be very helpful for large number of files.

ghost commented 4 years ago

No, directory inclusion is not supported.

And generally, in my opinion, this script should be completely rewritten to use dpkg-deb for creating debfiles. This would fix issues like https://github.com/termux/termux-create-package/issues/18 and this one as packaging will be offloaded to standard utility for making debfiles.

yuriusu22 commented 4 years ago

No, directory inclusion is not supported.

As a workaround to my problem, I've edited the Python script and enabled recursion to true (see my post above).

And generally, in my opinion, this script should be completely rewritten to use dpkg-deb for creating debfiles. This would fix issues like #18 and this one as packaging will be offloaded to standard utility for making debfiles.

I agree. It's been a couple of years since this is updated. It's time to rewrite this :smile: .

yuriusu22 commented 4 years ago

Closing as fix merged with pull #21.