termux / termux-create-package Goto Github PK
View Code? Open in Web Editor NEWPython script to create Termux packages easily.
Home Page: https://termux.com
License: Apache License 2.0
Python script to create Termux packages easily.
Home Page: https://termux.com
License: Apache License 2.0
https://pypi.org/project/termux-create-package
The latest version is 0.12.0, but using pip install can only install 0.7.
Binary files in binary-all
of apt-mirror
can't work for all architectures, so , please support custom multiple arch
array not only for one arch (ex: arch:"aarch64"
).
{
"arch":["aarch64","and"]
}
hi, it would be great if termux-create-package correctly added the package size when building it.
When i make deb file with manifest.jeson file. This tool create perfectly deb file but when i testing deb file it given error.
dpkg-deb (subprocess): decompressing archive member: lzma write error: Broken pipe
dpkg-deb (subprocess): cannot copy archive member from 'o.deb' to decompressor pipe: fail
d to write (Broken pipe)
dpkg-deb: error: subprocess returned error exit status 2
Errors were encountered while processing:
o.deb
This is just a notice. I've already submitted a pr #22.
Summary of the request:
TERMUX_PKG_RECOMMENDS
and TERMUX_PKG_SUGGESTS
in package control fields).termux_step_create_debscripts
in build steps override)I've created my own package by putting up JSON file and using apt install ./
But if I try to execute it using my package name then it shows no command found ( package is successfully installed)
Please help me with the issue..
Hello, I use termux-create-package and termux-apt-repo on my cell phone, everything is excellent, very versatile and easy to use, but I would like you to add the function of running a script during installation, to install things like example, python dependencies, or ask the user for a configuration, if you add it I would thank you very much, thank you for your time
As discussed on #termux, this script is missing the Homepage and Provides properties.
How To Add Custom Commands On deb packages. If I Need To Install Some Pip requirement or ruby-gem. You Know Some Times Python Based Tools Need PIP requirements. I Hope You Can Understand
Hello, I want to know if termux accepts packages made with Python 3.x.
Packages created with the command termux-create-package cannot be added to a repo using termux-apt-repo.
Steps to repoduce:
git clone 'https://github.com/termux/termux-apt-repo.git'
cd termux-apt-repo
python3 setup.py install --user
cd ..
git clone 'https://github.com/termux/termux-create-package.git'
cd termux-create-package
python3 setup.py install --user
cd ..
cat > helloworld << 'EOF'
#!/bin/bash
echo 'hello world!'
EOF
chmod +x helloworld
cat > helloworld_1.0_all.json << 'EOF'
{
"name": "helloworld",
"version": "1.0",
"arch": "all",
"description": "Hello World",
"homepage": "http://localhost",
"files": {
"helloworld": "bin/helloworld"
}
}
EOF
# build package and create repo
termux-create-package helloworld_1.0_all.json
mkdir pkg
cp helloworld_1.0_all.deb pkg/
mkdir repo
termux-apt-repo pkg/ repo/
Traceback (most recent call last):
File "/bin/termux-apt-repo", line 86, in
add_deb(deb_path, component, use_hard_links)
File "/bin/termux-apt-repo", line 23, in add_deb
deb_to_add_control_file = control_file_contents(deb_to_add_path)
File "/bin/termux-apt-repo", line 19, in control_file_contents
stderr=subprocess.DEVNULL
File "/usr/lib/python3.5/subprocess.py", line 316, in check_output
**kwargs).stdout
File "/usr/lib/python3.5/subprocess.py", line 398, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ar p pkg/helloworld_1.0_all.deb control.tar.xz | tar --to-stdout -xJf - ./control']' returned non-zero exit status 2
In my opinion, the problem is in line 59:
info = tarfile.TarInfo(name="control")
should be
info = tarfile.TarInfo(name="./control")
so that the control.tar file has the same structure as the packages compiled using build-package.sh.
# patch
cd termux-create-package
sed -i 's|info = tarfile.TarInfo(name="control")|info = tarfile.TarInfo(name="./control")|g' termux-create-package
python3 setup.py install --user
cd ..
# rebuild
rm helloworld_1.0_all.deb
rm -Rf pkg/ repo/
termux-create-package helloworld_1.0_all.json
mkdir pkg
cp helloworld_1.0_all.deb pkg/
mkdir repo
termux-apt-repo pkg/ repo/
Adding deb file: helloworld_1.0_all.deb...
Creating package file for extras and all...
Done!Make the repo/ directory accessible at $REPO_URL
Users can then access the repo by adding a file at
$PREFIX/etc/apt/sources.list.d
containing:
deb [trusted=yes] $REPO_URL termux extras[trusted=yes] is not needed if the repo has been signed with a gpg key
The problem occurs on Debian [GNU ar (GNU Binutils for Debian) 2.28] and Termux itself [GNU ar (GNU Binutils) 2.31.1].
Can it provide a json schema for completion when users edit manifest.yaml?
https://www.schemastore.org/json/
cmhughes/latexindent.pl#206 can be a reference.
TIA!
I Have Created A .deb package. And It Requied Some pip package so i have create a postinit but i don't know where to put the postinit on manifest.json and the directory. Xeffry Please Help Me. Don't Close This Issuse Until I Get The Answer. If You Close This Issuse Without Answer Then I Will Open A New One
In source code .Py. It says "resulting.deb file"
But at start it says .JSON file...?
I am so confused plz help me
For example, when PREFIX
is set, it will use $PREFIX
. if not, it will use /usr
as a fallback?
Attempting to install the package using either apt install
or dpkg --install
results in an error.
$ dpkg --install ./traceroute_2.1.0_aarch64.deb
Preparing to unpack ./traceroute_2.1.0_aarch64.deb ...
Unpacking traceroute (2.1.0) ...
dpkg: error processing archive ./traceroute_2.1.0_aarch64.deb (--install):
corrupted filesystem tarfile in package archive: unsupported PAX tar header type 'x'
Errors were encountered while processing:
./traceroute_2.1.0_aarch64.deb
I found the line for the directory recursion:
data_tarfile.add(input_file_path, arcname=output_file, recursive=False)
Note: Setting
recursive=False
toTrue
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.
Can it provide completions for common shells? I think https://docs.iterative.ai/shtab/ or https://docs.iterative.ai/shtab/#alternatives can be useful.
TIA!
When i tried to build my package i got this error
Building termux-fetch_0.1_all.deb
Traceback (most recent call last):
File "/data/data/com.termux/files/usr/bin/termux-create-package", line 134, in <module>
create_debfile(output_debfile_name, package_tmp_directory.name)
File "/data/data/com.termux/files/usr/bin/termux-create-package", line 101, in create_debfile
subprocess.check_call(["ar", 'r', debfile_output,
File "/data/data/com.termux/files/usr/lib/python3.9/subprocess.py", line 368, in check_call
retcode = call(*popenargs, **kwargs)
File "/data/data/com.termux/files/usr/lib/python3.9/subprocess.py", line 349, in call
with Popen(*popenargs, **kwargs) as p:
File "/data/data/com.termux/files/usr/lib/python3.9/subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/data/data/com.termux/files/usr/lib/python3.9/subprocess.py", line 1819, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ar'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.