diff options
author | CoprDistGit <infra@openeuler.org> | 2023-05-10 04:52:50 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-05-10 04:52:50 +0000 |
commit | 7d75ec66c842c991943ab54b15447a6a243cfb75 (patch) | |
tree | 25deff30eaf69a35ceddf107fcb91bb11490b9e8 | |
parent | 6a631d7721ae23852eb2bc231eaff7dcc09ee46a (diff) |
automatic import of python-pmbootstrapopeneuler20.03
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-pmbootstrap.spec | 883 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 885 insertions, 0 deletions
@@ -0,0 +1 @@ +/pmbootstrap-1.52.0.tar.gz diff --git a/python-pmbootstrap.spec b/python-pmbootstrap.spec new file mode 100644 index 0000000..3a969e2 --- /dev/null +++ b/python-pmbootstrap.spec @@ -0,0 +1,883 @@ +%global _empty_manifest_terminate_build 0 +Name: python-pmbootstrap +Version: 1.52.0 +Release: 1 +Summary: A sophisticated chroot / build / flash tool to develop and install postmarketOS +License: GPLv3 +URL: https://www.postmarketos.org +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/1d/b7/d3d43ee534da10753777103b388e35b0936d25e14c9c4c8e70469297efd3/pmbootstrap-1.52.0.tar.gz +BuildArch: noarch + +Requires: python3-argcomplete + +%description +# pmbootstrap + +Sophisticated chroot/build/flash tool to develop and install +[postmarketOS](https://postmarketos.org). + +## Development + +pmbootstrap is being developed on SourceHut +([what](https://postmarketos.org/blog/2022/07/25/considering-sourcehut/)): + +https://git.sr.ht/~postmarketos/pmbootstrap + +Send patches via mail or web UI to +[pmbootstrap-devel](https://lists.sr.ht/~postmarketos/pmbootstrap-devel) +([subscribe](mailto:~postmarketos/pmbootstrap-devel+subscribe@lists.sr.ht)): +``` +~postmarketos/pmbootstrap-devel@lists.sr.ht +``` + +You can set the default values for sending email in the git checkout +``` +$ git config sendemail.to "~postmarketos/pmbootstrap-devel@lists.sr.ht" +$ git config format.subjectPrefix "PATCH pmbootstrap" +``` + +Run CI scripts locally with: +``` +$ pmbootstrap ci +``` + +Run a single test file: +``` +$ pytest -vv ./test/test_keys.py +``` + +## Issues + +Issues are being tracked +[here](https://gitlab.com/postmarketOS/pmbootstrap/-/issues). + +## Requirements +* Linux distribution on the host system (`x86`, `x86_64`, or `aarch64`) + * [Windows subsystem for Linux (WSL)](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux) + does **not** work! Please use [VirtualBox](https://www.virtualbox.org/) instead. + * [Linux kernel 3.17 or higher](https://postmarketos.org/oldkernel) +* Python 3.7+ +* OpenSSL +* git +* ps +* tar + +## Usage Examples +Please refer to the [postmarketOS wiki](https://wiki.postmarketos.org) for +in-depth coverage of topics such as +[porting to a new device](https://wiki.postmarketos.org/wiki/Porting_to_a_new_device) +or [installation](https://wiki.postmarketos.org/wiki/Installation_guide). The +help output (`pmbootstrap -h`) has detailed usage instructions for every +command. Read on for some generic examples of what can be done with +`pmbootstrap`. + +### Installing pmbootstrap +<https://wiki.postmarketos.org/wiki/Installing_pmbootstrap> + +### Basics +Initial setup: +``` +$ pmbootstrap init +``` + +Run this in a second window to see all shell commands that get executed: +``` +$ pmbootstrap log +``` + +Quick health check and config overview: +``` +$ pmbootstrap status +``` + +### Packages +Build `aports/main/hello-world`: +``` +$ pmbootstrap build hello-world +``` + +Cross-compile to `armhf`: +``` +$ pmbootstrap build --arch=armhf hello-world +``` + +Build with source code from local folder: +``` +$ pmbootstrap build linux-postmarketos-mainline --src=~/code/linux +``` + +Update checksums: +``` +$ pmbootstrap checksum hello-world +``` + +Generate a template for a new package: +``` +$ pmbootstrap newapkbuild "https://gitlab.com/postmarketOS/osk-sdl/-/archive/0.52/osk-sdl-0.52.tar.bz2" +``` + +### Chroots +Enter the `armhf` building chroot: +``` +$ pmbootstrap chroot -b armhf +``` + +Run a command inside a chroot: +``` +$ pmbootstrap chroot -- echo test +``` + +Safely delete all chroots: +``` +$ pmbootstrap zap +``` + +### Device Porting Assistance +Analyze Android +[`boot.img`](https://wiki.postmarketos.org/wiki/Glossary#boot.img) files (also +works with recovery OS images like TWRP): +``` +$ pmbootstrap bootimg_analyze ~/Downloads/twrp-3.2.1-0-fp2.img +``` + +Check kernel configs: +``` +$ pmbootstrap kconfig check +``` + +Edit a kernel config: +``` +$ pmbootstrap kconfig edit --arch=armhf postmarketos-mainline +``` + +### Root File System +Build the rootfs: +``` +$ pmbootstrap install +``` + +Build the rootfs with full disk encryption: +``` +$ pmbootstrap install --fde +``` + +Update existing installation on SD card: +``` +$ pmbootstrap install --sdcard=/dev/mmcblk0 --rsync +``` + +Run the image in QEMU: +``` +$ pmbootstrap qemu --image-size=1G +``` + +Flash to the device: +``` +$ pmbootstrap flasher flash_kernel +$ pmbootstrap flasher flash_rootfs --partition=userdata +``` + +Export the rootfs, kernel, initramfs, `boot.img` etc.: +``` +$ pmbootstrap export +``` + +Extract the initramfs +``` +$ pmbootstrap initfs extract +``` + +Build and flash Android recovery zip: +``` +$ pmbootstrap install --android-recovery-zip +$ pmbootstrap flasher --method=adb sideload +``` + +### Repository Maintenance +List pmaports that don't have a binary package: +``` +$ pmbootstrap repo_missing --arch=armhf --overview +``` + +Increase the `pkgrel` for each aport where the binary package has outdated +dependencies (e.g. after soname bumps): +``` +$ pmbootstrap pkgrel_bump --auto +``` + +Generate cross-compiler aports based on the latest version from Alpine's +aports: +``` +$ pmbootstrap aportgen binutils-armhf gcc-armhf +``` + +Manually rebuild package index: +``` +$ pmbootstrap index +``` + +Delete local binary packages without existing aport of same version: +``` +$ pmbootstrap zap -m +``` + +### Debugging +Use `-v` on any action to get verbose logging: +``` +$ pmbootstrap -v build hello-world +``` + +Parse a single deviceinfo and return it as JSON: +``` +$ pmbootstrap deviceinfo_parse pine64-pinephone +``` + +Parse a single APKBUILD and return it as JSON: +``` +$ pmbootstrap apkbuild_parse hello-world +``` + +Parse a package from an APKINDEX and return it as JSON: +``` +$ pmbootstrap apkindex_parse $WORK/cache_apk_x86_64/APKINDEX.8b865e19.tar.gz hello-world +``` + +`ccache` statistics: +``` +$ pmbootstrap stats --arch=armhf +``` + +`distccd` log: +``` +$ pmbootstrap log_distccd +``` + +### Use alternative sudo + +pmbootstrap supports `doas` and `sudo`. +If multiple sudo implementations are installed, pmbootstrap will use `doas`. +You can set the `PMB_SUDO` environmental variable to define the sudo +implementation you want to use. + +### Select SSH keys to include and make authorized in new images + +If the config file option `ssh_keys` is set to `True` (it defaults to `False`), +then all files matching the glob `~/.ssh/id_*.pub` will be placed in +`~/.ssh/authorized_keys` in the user's home directory in newly-built images. + +Sometimes, for example if you have a large number of SSH keys, you may wish to +select a different set of public keys to include in an image. To do this, set +the `ssh_key_glob` configuration parameter in the pmbootstrap config file to a +string containing a glob that is to match the file or files you wish to +include. + +For example, a `~/.config/pmbootstrap.cfg` may contain: + + [pmbootstrap] + # ... + ssh_keys = True + ssh_key_glob = ~/.ssh/postmarketos-dev.pub + # ... + +## License +[GPLv3](LICENSE) + + +%package -n python3-pmbootstrap +Summary: A sophisticated chroot / build / flash tool to develop and install postmarketOS +Provides: python-pmbootstrap +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-pmbootstrap +# pmbootstrap + +Sophisticated chroot/build/flash tool to develop and install +[postmarketOS](https://postmarketos.org). + +## Development + +pmbootstrap is being developed on SourceHut +([what](https://postmarketos.org/blog/2022/07/25/considering-sourcehut/)): + +https://git.sr.ht/~postmarketos/pmbootstrap + +Send patches via mail or web UI to +[pmbootstrap-devel](https://lists.sr.ht/~postmarketos/pmbootstrap-devel) +([subscribe](mailto:~postmarketos/pmbootstrap-devel+subscribe@lists.sr.ht)): +``` +~postmarketos/pmbootstrap-devel@lists.sr.ht +``` + +You can set the default values for sending email in the git checkout +``` +$ git config sendemail.to "~postmarketos/pmbootstrap-devel@lists.sr.ht" +$ git config format.subjectPrefix "PATCH pmbootstrap" +``` + +Run CI scripts locally with: +``` +$ pmbootstrap ci +``` + +Run a single test file: +``` +$ pytest -vv ./test/test_keys.py +``` + +## Issues + +Issues are being tracked +[here](https://gitlab.com/postmarketOS/pmbootstrap/-/issues). + +## Requirements +* Linux distribution on the host system (`x86`, `x86_64`, or `aarch64`) + * [Windows subsystem for Linux (WSL)](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux) + does **not** work! Please use [VirtualBox](https://www.virtualbox.org/) instead. + * [Linux kernel 3.17 or higher](https://postmarketos.org/oldkernel) +* Python 3.7+ +* OpenSSL +* git +* ps +* tar + +## Usage Examples +Please refer to the [postmarketOS wiki](https://wiki.postmarketos.org) for +in-depth coverage of topics such as +[porting to a new device](https://wiki.postmarketos.org/wiki/Porting_to_a_new_device) +or [installation](https://wiki.postmarketos.org/wiki/Installation_guide). The +help output (`pmbootstrap -h`) has detailed usage instructions for every +command. Read on for some generic examples of what can be done with +`pmbootstrap`. + +### Installing pmbootstrap +<https://wiki.postmarketos.org/wiki/Installing_pmbootstrap> + +### Basics +Initial setup: +``` +$ pmbootstrap init +``` + +Run this in a second window to see all shell commands that get executed: +``` +$ pmbootstrap log +``` + +Quick health check and config overview: +``` +$ pmbootstrap status +``` + +### Packages +Build `aports/main/hello-world`: +``` +$ pmbootstrap build hello-world +``` + +Cross-compile to `armhf`: +``` +$ pmbootstrap build --arch=armhf hello-world +``` + +Build with source code from local folder: +``` +$ pmbootstrap build linux-postmarketos-mainline --src=~/code/linux +``` + +Update checksums: +``` +$ pmbootstrap checksum hello-world +``` + +Generate a template for a new package: +``` +$ pmbootstrap newapkbuild "https://gitlab.com/postmarketOS/osk-sdl/-/archive/0.52/osk-sdl-0.52.tar.bz2" +``` + +### Chroots +Enter the `armhf` building chroot: +``` +$ pmbootstrap chroot -b armhf +``` + +Run a command inside a chroot: +``` +$ pmbootstrap chroot -- echo test +``` + +Safely delete all chroots: +``` +$ pmbootstrap zap +``` + +### Device Porting Assistance +Analyze Android +[`boot.img`](https://wiki.postmarketos.org/wiki/Glossary#boot.img) files (also +works with recovery OS images like TWRP): +``` +$ pmbootstrap bootimg_analyze ~/Downloads/twrp-3.2.1-0-fp2.img +``` + +Check kernel configs: +``` +$ pmbootstrap kconfig check +``` + +Edit a kernel config: +``` +$ pmbootstrap kconfig edit --arch=armhf postmarketos-mainline +``` + +### Root File System +Build the rootfs: +``` +$ pmbootstrap install +``` + +Build the rootfs with full disk encryption: +``` +$ pmbootstrap install --fde +``` + +Update existing installation on SD card: +``` +$ pmbootstrap install --sdcard=/dev/mmcblk0 --rsync +``` + +Run the image in QEMU: +``` +$ pmbootstrap qemu --image-size=1G +``` + +Flash to the device: +``` +$ pmbootstrap flasher flash_kernel +$ pmbootstrap flasher flash_rootfs --partition=userdata +``` + +Export the rootfs, kernel, initramfs, `boot.img` etc.: +``` +$ pmbootstrap export +``` + +Extract the initramfs +``` +$ pmbootstrap initfs extract +``` + +Build and flash Android recovery zip: +``` +$ pmbootstrap install --android-recovery-zip +$ pmbootstrap flasher --method=adb sideload +``` + +### Repository Maintenance +List pmaports that don't have a binary package: +``` +$ pmbootstrap repo_missing --arch=armhf --overview +``` + +Increase the `pkgrel` for each aport where the binary package has outdated +dependencies (e.g. after soname bumps): +``` +$ pmbootstrap pkgrel_bump --auto +``` + +Generate cross-compiler aports based on the latest version from Alpine's +aports: +``` +$ pmbootstrap aportgen binutils-armhf gcc-armhf +``` + +Manually rebuild package index: +``` +$ pmbootstrap index +``` + +Delete local binary packages without existing aport of same version: +``` +$ pmbootstrap zap -m +``` + +### Debugging +Use `-v` on any action to get verbose logging: +``` +$ pmbootstrap -v build hello-world +``` + +Parse a single deviceinfo and return it as JSON: +``` +$ pmbootstrap deviceinfo_parse pine64-pinephone +``` + +Parse a single APKBUILD and return it as JSON: +``` +$ pmbootstrap apkbuild_parse hello-world +``` + +Parse a package from an APKINDEX and return it as JSON: +``` +$ pmbootstrap apkindex_parse $WORK/cache_apk_x86_64/APKINDEX.8b865e19.tar.gz hello-world +``` + +`ccache` statistics: +``` +$ pmbootstrap stats --arch=armhf +``` + +`distccd` log: +``` +$ pmbootstrap log_distccd +``` + +### Use alternative sudo + +pmbootstrap supports `doas` and `sudo`. +If multiple sudo implementations are installed, pmbootstrap will use `doas`. +You can set the `PMB_SUDO` environmental variable to define the sudo +implementation you want to use. + +### Select SSH keys to include and make authorized in new images + +If the config file option `ssh_keys` is set to `True` (it defaults to `False`), +then all files matching the glob `~/.ssh/id_*.pub` will be placed in +`~/.ssh/authorized_keys` in the user's home directory in newly-built images. + +Sometimes, for example if you have a large number of SSH keys, you may wish to +select a different set of public keys to include in an image. To do this, set +the `ssh_key_glob` configuration parameter in the pmbootstrap config file to a +string containing a glob that is to match the file or files you wish to +include. + +For example, a `~/.config/pmbootstrap.cfg` may contain: + + [pmbootstrap] + # ... + ssh_keys = True + ssh_key_glob = ~/.ssh/postmarketos-dev.pub + # ... + +## License +[GPLv3](LICENSE) + + +%package help +Summary: Development documents and examples for pmbootstrap +Provides: python3-pmbootstrap-doc +%description help +# pmbootstrap + +Sophisticated chroot/build/flash tool to develop and install +[postmarketOS](https://postmarketos.org). + +## Development + +pmbootstrap is being developed on SourceHut +([what](https://postmarketos.org/blog/2022/07/25/considering-sourcehut/)): + +https://git.sr.ht/~postmarketos/pmbootstrap + +Send patches via mail or web UI to +[pmbootstrap-devel](https://lists.sr.ht/~postmarketos/pmbootstrap-devel) +([subscribe](mailto:~postmarketos/pmbootstrap-devel+subscribe@lists.sr.ht)): +``` +~postmarketos/pmbootstrap-devel@lists.sr.ht +``` + +You can set the default values for sending email in the git checkout +``` +$ git config sendemail.to "~postmarketos/pmbootstrap-devel@lists.sr.ht" +$ git config format.subjectPrefix "PATCH pmbootstrap" +``` + +Run CI scripts locally with: +``` +$ pmbootstrap ci +``` + +Run a single test file: +``` +$ pytest -vv ./test/test_keys.py +``` + +## Issues + +Issues are being tracked +[here](https://gitlab.com/postmarketOS/pmbootstrap/-/issues). + +## Requirements +* Linux distribution on the host system (`x86`, `x86_64`, or `aarch64`) + * [Windows subsystem for Linux (WSL)](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux) + does **not** work! Please use [VirtualBox](https://www.virtualbox.org/) instead. + * [Linux kernel 3.17 or higher](https://postmarketos.org/oldkernel) +* Python 3.7+ +* OpenSSL +* git +* ps +* tar + +## Usage Examples +Please refer to the [postmarketOS wiki](https://wiki.postmarketos.org) for +in-depth coverage of topics such as +[porting to a new device](https://wiki.postmarketos.org/wiki/Porting_to_a_new_device) +or [installation](https://wiki.postmarketos.org/wiki/Installation_guide). The +help output (`pmbootstrap -h`) has detailed usage instructions for every +command. Read on for some generic examples of what can be done with +`pmbootstrap`. + +### Installing pmbootstrap +<https://wiki.postmarketos.org/wiki/Installing_pmbootstrap> + +### Basics +Initial setup: +``` +$ pmbootstrap init +``` + +Run this in a second window to see all shell commands that get executed: +``` +$ pmbootstrap log +``` + +Quick health check and config overview: +``` +$ pmbootstrap status +``` + +### Packages +Build `aports/main/hello-world`: +``` +$ pmbootstrap build hello-world +``` + +Cross-compile to `armhf`: +``` +$ pmbootstrap build --arch=armhf hello-world +``` + +Build with source code from local folder: +``` +$ pmbootstrap build linux-postmarketos-mainline --src=~/code/linux +``` + +Update checksums: +``` +$ pmbootstrap checksum hello-world +``` + +Generate a template for a new package: +``` +$ pmbootstrap newapkbuild "https://gitlab.com/postmarketOS/osk-sdl/-/archive/0.52/osk-sdl-0.52.tar.bz2" +``` + +### Chroots +Enter the `armhf` building chroot: +``` +$ pmbootstrap chroot -b armhf +``` + +Run a command inside a chroot: +``` +$ pmbootstrap chroot -- echo test +``` + +Safely delete all chroots: +``` +$ pmbootstrap zap +``` + +### Device Porting Assistance +Analyze Android +[`boot.img`](https://wiki.postmarketos.org/wiki/Glossary#boot.img) files (also +works with recovery OS images like TWRP): +``` +$ pmbootstrap bootimg_analyze ~/Downloads/twrp-3.2.1-0-fp2.img +``` + +Check kernel configs: +``` +$ pmbootstrap kconfig check +``` + +Edit a kernel config: +``` +$ pmbootstrap kconfig edit --arch=armhf postmarketos-mainline +``` + +### Root File System +Build the rootfs: +``` +$ pmbootstrap install +``` + +Build the rootfs with full disk encryption: +``` +$ pmbootstrap install --fde +``` + +Update existing installation on SD card: +``` +$ pmbootstrap install --sdcard=/dev/mmcblk0 --rsync +``` + +Run the image in QEMU: +``` +$ pmbootstrap qemu --image-size=1G +``` + +Flash to the device: +``` +$ pmbootstrap flasher flash_kernel +$ pmbootstrap flasher flash_rootfs --partition=userdata +``` + +Export the rootfs, kernel, initramfs, `boot.img` etc.: +``` +$ pmbootstrap export +``` + +Extract the initramfs +``` +$ pmbootstrap initfs extract +``` + +Build and flash Android recovery zip: +``` +$ pmbootstrap install --android-recovery-zip +$ pmbootstrap flasher --method=adb sideload +``` + +### Repository Maintenance +List pmaports that don't have a binary package: +``` +$ pmbootstrap repo_missing --arch=armhf --overview +``` + +Increase the `pkgrel` for each aport where the binary package has outdated +dependencies (e.g. after soname bumps): +``` +$ pmbootstrap pkgrel_bump --auto +``` + +Generate cross-compiler aports based on the latest version from Alpine's +aports: +``` +$ pmbootstrap aportgen binutils-armhf gcc-armhf +``` + +Manually rebuild package index: +``` +$ pmbootstrap index +``` + +Delete local binary packages without existing aport of same version: +``` +$ pmbootstrap zap -m +``` + +### Debugging +Use `-v` on any action to get verbose logging: +``` +$ pmbootstrap -v build hello-world +``` + +Parse a single deviceinfo and return it as JSON: +``` +$ pmbootstrap deviceinfo_parse pine64-pinephone +``` + +Parse a single APKBUILD and return it as JSON: +``` +$ pmbootstrap apkbuild_parse hello-world +``` + +Parse a package from an APKINDEX and return it as JSON: +``` +$ pmbootstrap apkindex_parse $WORK/cache_apk_x86_64/APKINDEX.8b865e19.tar.gz hello-world +``` + +`ccache` statistics: +``` +$ pmbootstrap stats --arch=armhf +``` + +`distccd` log: +``` +$ pmbootstrap log_distccd +``` + +### Use alternative sudo + +pmbootstrap supports `doas` and `sudo`. +If multiple sudo implementations are installed, pmbootstrap will use `doas`. +You can set the `PMB_SUDO` environmental variable to define the sudo +implementation you want to use. + +### Select SSH keys to include and make authorized in new images + +If the config file option `ssh_keys` is set to `True` (it defaults to `False`), +then all files matching the glob `~/.ssh/id_*.pub` will be placed in +`~/.ssh/authorized_keys` in the user's home directory in newly-built images. + +Sometimes, for example if you have a large number of SSH keys, you may wish to +select a different set of public keys to include in an image. To do this, set +the `ssh_key_glob` configuration parameter in the pmbootstrap config file to a +string containing a glob that is to match the file or files you wish to +include. + +For example, a `~/.config/pmbootstrap.cfg` may contain: + + [pmbootstrap] + # ... + ssh_keys = True + ssh_key_glob = ~/.ssh/postmarketos-dev.pub + # ... + +## License +[GPLv3](LICENSE) + + +%prep +%autosetup -n pmbootstrap-1.52.0 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-pmbootstrap -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 10 2023 Python_Bot <Python_Bot@openeuler.org> - 1.52.0-1 +- Package Spec generated @@ -0,0 +1 @@ +6e58e663a7a1becd911019dcc317bdd9 pmbootstrap-1.52.0.tar.gz |