diff --git a/.github/workflows/empaquetamiento.yml b/.github/workflows/empaquetamiento.yml
new file mode 100644
index 0000000..18596ba
--- /dev/null
+++ b/.github/workflows/empaquetamiento.yml
@@ -0,0 +1,204 @@
+on:
+ pull_request:
+ branches: [main]
+ types: ["labeled"]
+name: construir
+jobs:
+ crear_release:
+ name: Creando lanzamiento
+ runs-on: ubuntu-latest
+ outputs:
+ upload_url: ${{ steps.release.outputs.upload_url }}
+ steps:
+ - name: Creando lanzamiento
+ uses: actions/create-release@v1
+ id: release
+ with:
+ draft: false
+ prerelease: false
+ release_name: "ApmPKG v1.5.0 Nix y archivos dentro de home"
+ tag_name: 1.5.0
+ env:
+ GITHUB_TOKEN: ${{ github.token }}
+ artefactos_debian:
+ name: Creando artefactos para debian
+ runs-on: ubuntu-latest
+ needs: crear_release
+ outputs:
+ link: ${{ steps.construir_deb.outputs.link }}
+ steps:
+ - name: Construir y subir (debian)
+ uses: kedap/poa@debian
+ id: construir_deb
+ with:
+ repositorio: "${{ github.repository }}"
+ nombre: "apmpkg"
+ rama: "develop" #Cambiame posteriormente por develop o algo asi
+ ruta-control: "poa/control"
+ ruta-script: "poa/debian.sh"
+ descarga_subida_debian:
+ name: Descargando y subiendo artefactos para debian
+ runs-on: ubuntu-latest
+ needs: [artefactos_debian, crear_release]
+ steps:
+ - name: Descargando artefactos de debian
+ run: curl -O ${{ needs.artefactos_debian.outputs.link }}
+ - name: Subir artefacto
+ uses: actions/upload-artifact@v2
+ with:
+ name: paquete_debian_64.deb
+ path: ./apmpkg-amd64.deb
+ - name: Subir artefactos debian
+ uses: actions/upload-release-asset@v1
+ env:
+ GITHUB_TOKEN: ${{ github.token }}
+ with:
+ upload_url: ${{ needs.crear_release.outputs.upload_url }}
+ asset_path: ./apmpkg-amd64.deb
+ asset_name: apmpkg-amd64.deb
+ asset_content_type: application/vnd.debian.binary-package
+ artefacto_apmpkg:
+ name: Creando artefactos para apmpkg y subirlos a upload.sh
+ runs-on: ubuntu-latest
+ needs: crear_release
+ outputs:
+ link: ${{ steps.construir_abi.outputs.link }}
+ steps:
+ - name: Construir y subir (apmpkg)
+ uses: kedap/poa@apmpkg
+ id: construir_abi
+ with:
+ repositorio: "${{ github.repository }}"
+ nombre: "apmpkg"
+ rama: "develop"
+ ruta-abc: "poa/apmpkg.abc"
+ descarga_subida_apmpkg:
+ name: Descargando y subiendo artefactos para apmpkg
+ runs-on: ubuntu-latest
+ needs: [artefacto_apmpkg, crear_release]
+ steps:
+ - name: Descargando artefactos de apmpkg
+ run: curl -O ${{ needs.artefacto_apmpkg.outputs.link }}
+ - name: Subir artefacto
+ uses: actions/upload-artifact@v2
+ with:
+ name: paquete_abi.abi.tar.gz
+ path: ./apmpkg-1.5.0.abi.tar.gz
+ - name: Subir
+ uses: actions/upload-release-asset@v1
+ env:
+ GITHUB_TOKEN: ${{ github.token }}
+ with:
+ upload_url: ${{ needs.crear_release.outputs.upload_url }}
+ asset_path: ./apmpkg-1.5.0.abi.tar.gz
+ asset_name: apmpkg-1.5.0.abi.tar.gz
+ asset_content_type: application/gzip
+ artefacto_rpm_fedora:
+ name: Creando artefactos rpm (fedora) y subirlos a upload.sh
+ runs-on: ubuntu-latest
+ needs: crear_release
+ outputs:
+ link: ${{ steps.construir_rpm_fedora.outputs.link }}
+ steps:
+ - name: Construir y subir (rpm fedora)
+ uses: kedap/poa@rpm_fedora
+ id: construir_rpm_fedora
+ with:
+ repositorio: "${{ github.repository }}"
+ nombre: "apmpkg"
+ ruta-spec: "poa/apmpkg.spec"
+ version: 1.5.0
+ rama: "develop"
+ descarga_subida_rpm_fedora:
+ name: Descargando y subiendo artefactos rpm (fedora)
+ runs-on: ubuntu-latest
+ needs: [artefacto_rpm_fedora, crear_release]
+ steps:
+ - name: Descargando artefactos de fedora
+ run: curl -O ${{ needs.artefacto_rpm_fedora.outputs.link }}
+ - name: Subir artefacto
+ uses: actions/upload-artifact@v2
+ with:
+ name: paquete_rpm_fedora.rpm
+ path: ./apmpkg*.rpm
+ - name: Subir
+ uses: actions/upload-release-asset@v1
+ env:
+ GITHUB_TOKEN: ${{ github.token }}
+ with:
+ upload_url: ${{ needs.crear_release.outputs.upload_url }}
+ asset_path: ./apmpkg-1.5.0-1.fc34.x86_64.rpm
+ asset_name: apmpkg-1.5.0-1.fc34.x86_64.rpm
+ asset_content_type: application/x-rpm
+ artefacto_zst_pacman:
+ name: Creando artefactos para archlinux (pacman) y subirlos a upload.sh
+ runs-on: ubuntu-latest
+ needs: crear_release
+ outputs:
+ link: ${{ steps.construir_zst.outputs.link }}
+ steps:
+ - name: Construir y subir (zst pacman)
+ uses: kedap/poa@archlinux
+ id: construir_zst
+ with:
+ repositorio: "${{ github.repository }}"
+ nombre: "apmpkg"
+ rama: "develop"
+ ruta-pkgbuild: "poa/PKGBUILD"
+ descarga_subida_zst_pacman:
+ name: Descargando y subiendo artefactos para archlinux (pacman)
+ runs-on: ubuntu-latest
+ needs: [artefacto_zst_pacman, crear_release]
+ steps:
+ - name: Descargando artefactos de pacman
+ run: curl -O ${{ needs.artefacto_zst_pacman.outputs.link }}
+ - name: Subir artefacto
+ uses: actions/upload-artifact@v2
+ with:
+ name: paquete_pacman.pkg.tar.zst
+ path: ./apmpkg*.pkg.*
+ - name: Subir
+ uses: actions/upload-release-asset@v1
+ env:
+ GITHUB_TOKEN: ${{ github.token }}
+ with:
+ upload_url: ${{ needs.crear_release.outputs.upload_url }}
+ asset_path: ./apmpkg-1.5.0-1-x86_64.pkg.tar.zst
+ asset_name: apmpkg-1.5.0-1.pkg.tar.zst
+ asset_content_type: application/zstd
+ artefacto_apk:
+ name: Creando artefactos para alpine subirlos a upload.sh
+ runs-on: ubuntu-latest
+ needs: crear_release
+ outputs:
+ link: ${{ steps.construir_apk.outputs.link }}
+ steps:
+ - name: Construir y subir (apk alpine)
+ uses: kedap/poa@alpine
+ id: construir_apk
+ with:
+ repositorio: "${{ github.repository }}"
+ nombre: "apmpkg"
+ rama: "develop"
+ ruta-apkbuild: "poa/APKBUILD"
+ descarga_subida_apk:
+ name: Descargando y subiendo artefactos para alpine (apk)
+ runs-on: ubuntu-latest
+ needs: [artefacto_apk, crear_release]
+ steps:
+ - name: Descargando artefactos de alpine
+ run: curl -O ${{ needs.artefacto_apk.outputs.link }}
+ - name: Subir artefacto
+ uses: actions/upload-artifact@v2
+ with:
+ name: paquete_alpine.apk
+ path: ./apmpkg*.apk
+ - name: Subir
+ uses: actions/upload-release-asset@v1
+ env:
+ GITHUB_TOKEN: ${{ github.token }}
+ with:
+ upload_url: ${{ needs.crear_release.outputs.upload_url }}
+ asset_path: ./apmpkg-1.5.0-r0.apk
+ asset_name: apmpkg-1.5.0-r0.apk
+ asset_content_type: application/gzip
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index 2a9c33f..ce92ef2 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -2,7 +2,7 @@ name: Rust
on:
push:
- branches: [ main, develop ]
+ branches: [ develop ]
pull_request:
branches: [ main, develop ]
diff --git a/Cargo.lock b/Cargo.lock
index 2a4e55e..2ca5b6f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2,6 +2,15 @@
# It is not intended for manual editing.
version = 3
+[[package]]
+name = "addr2line"
+version = "0.16.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3e61f2b7f93d2c7d2b08263acaa4a363b3e276806c68af6134c44f523bf1aacd"
+dependencies = [
+ "gimli",
+]
+
[[package]]
name = "adler"
version = "1.0.2"
@@ -14,9 +23,15 @@ version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6"
+[[package]]
+name = "anyhow"
+version = "1.0.43"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "28ae2b3dec75a406790005a200b1bd89785afc02517a00ca99ecfe093ee9e6cf"
+
[[package]]
name = "apmpkg"
-version = "1.4.1"
+version = "1.5.0"
dependencies = [
"clap",
"colored",
@@ -29,10 +44,132 @@ dependencies = [
"reqwest",
"sha2",
"tar",
+ "testdir",
"tokio",
"toml",
]
+[[package]]
+name = "async-channel"
+version = "1.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319"
+dependencies = [
+ "concurrent-queue",
+ "event-listener",
+ "futures-core",
+]
+
+[[package]]
+name = "async-executor"
+version = "1.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965"
+dependencies = [
+ "async-task 4.0.3",
+ "concurrent-queue",
+ "fastrand",
+ "futures-lite 1.12.0",
+ "once_cell",
+ "slab",
+]
+
+[[package]]
+name = "async-fs"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8b3ca4f8ff117c37c278a2f7415ce9be55560b846b5bc4412aaa5d29c1c3dae2"
+dependencies = [
+ "async-lock",
+ "blocking 1.0.2",
+ "futures-lite 1.12.0",
+]
+
+[[package]]
+name = "async-io"
+version = "1.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a811e6a479f2439f0c04038796b5cfb3d2ad56c230e0f2d3f7b04d68cfee607b"
+dependencies = [
+ "concurrent-queue",
+ "futures-lite 1.12.0",
+ "libc",
+ "log",
+ "once_cell",
+ "parking 2.0.0",
+ "polling",
+ "slab",
+ "socket2 0.4.0",
+ "waker-fn",
+ "winapi",
+]
+
+[[package]]
+name = "async-lock"
+version = "2.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e6a8ea61bf9947a1007c5cada31e647dbc77b103c679858150003ba697ea798b"
+dependencies = [
+ "event-listener",
+]
+
+[[package]]
+name = "async-net"
+version = "1.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5373304df79b9b4395068fb080369ec7178608827306ce4d081cba51cac551df"
+dependencies = [
+ "async-io",
+ "blocking 1.0.2",
+ "futures-lite 1.12.0",
+]
+
+[[package]]
+name = "async-process"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b21b63ab5a0db0369deb913540af2892750e42d949faacc7a61495ac418a1692"
+dependencies = [
+ "async-io",
+ "blocking 1.0.2",
+ "cfg-if 1.0.0",
+ "event-listener",
+ "futures-lite 1.12.0",
+ "libc",
+ "once_cell",
+ "signal-hook",
+ "winapi",
+]
+
+[[package]]
+name = "async-task"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c17772156ef2829aadc587461c7753af20b7e8db1529bc66855add962a3b35d3"
+
+[[package]]
+name = "async-task"
+version = "4.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e91831deabf0d6d7ec49552e489aed63b7456a7a3c46cff62adad428110b0af0"
+
+[[package]]
+name = "async-trait"
+version = "0.1.51"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "atomic-waker"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a"
+
[[package]]
name = "atty"
version = "0.2.14"
@@ -50,6 +187,21 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
+[[package]]
+name = "backtrace"
+version = "0.3.61"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e7a905d892734eea339e896738c14b9afce22b5318f64b951e70bf3844419b01"
+dependencies = [
+ "addr2line",
+ "cc",
+ "cfg-if 1.0.0",
+ "libc",
+ "miniz_oxide",
+ "object",
+ "rustc-demangle",
+]
+
[[package]]
name = "base64"
version = "0.13.0"
@@ -77,6 +229,34 @@ dependencies = [
"generic-array",
]
+[[package]]
+name = "blocking"
+version = "0.4.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d2468ff7bf85066b4a3678fede6fe66db31846d753ff0adfbfab2c6a6e81612b"
+dependencies = [
+ "async-channel",
+ "atomic-waker",
+ "futures-lite 0.1.11",
+ "once_cell",
+ "parking 1.0.6",
+ "waker-fn",
+]
+
+[[package]]
+name = "blocking"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c5e170dbede1f740736619b776d7251cb1b9095c435c34d8ca9f57fcd2f335e9"
+dependencies = [
+ "async-channel",
+ "async-task 4.0.3",
+ "atomic-waker",
+ "fastrand",
+ "futures-lite 1.12.0",
+ "once_cell",
+]
+
[[package]]
name = "bumpalo"
version = "3.7.0"
@@ -89,6 +269,12 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040"
+[[package]]
+name = "cache-padded"
+version = "1.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba"
+
[[package]]
name = "cc"
version = "1.0.69"
@@ -134,6 +320,15 @@ dependencies = [
"winapi",
]
+[[package]]
+name = "concurrent-queue"
+version = "1.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3"
+dependencies = [
+ "cache-padded",
+]
+
[[package]]
name = "core-foundation"
version = "0.9.1"
@@ -237,12 +432,27 @@ dependencies = [
"cfg-if 1.0.0",
]
+[[package]]
+name = "event-listener"
+version = "2.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59"
+
[[package]]
name = "exitcode"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de853764b47027c2e862a995c34978ffa63c1501f2e15f987ba11bd4f9bba193"
+[[package]]
+name = "fastrand"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b394ed3d285a429378d3b384b9eb1285267e7df4b166df24b7a6939a04dc392e"
+dependencies = [
+ "instant",
+]
+
[[package]]
name = "filetime"
version = "0.2.14"
@@ -298,6 +508,20 @@ dependencies = [
"percent-encoding",
]
+[[package]]
+name = "futures"
+version = "0.3.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1adc00f486adfc9ce99f77d717836f0c5aa84965eb0b4f051f4e83f7cab53f8b"
+dependencies = [
+ "futures-channel",
+ "futures-core",
+ "futures-io",
+ "futures-sink",
+ "futures-task",
+ "futures-util",
+]
+
[[package]]
name = "futures-channel"
version = "0.3.16"
@@ -305,6 +529,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74ed2411805f6e4e3d9bc904c95d5d423b89b3b25dc0250aa74729de20629ff9"
dependencies = [
"futures-core",
+ "futures-sink",
]
[[package]]
@@ -313,6 +538,42 @@ version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af51b1b4a7fdff033703db39de8802c673eb91855f2e0d47dcf3bf2c0ef01f99"
+[[package]]
+name = "futures-io"
+version = "0.3.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377"
+
+[[package]]
+name = "futures-lite"
+version = "0.1.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "97999970129b808f0ccba93211201d431fcc12d7e1ffae03a61b5cedd1a7ced2"
+dependencies = [
+ "fastrand",
+ "futures-core",
+ "futures-io",
+ "memchr",
+ "parking 2.0.0",
+ "pin-project-lite 0.1.12",
+ "waker-fn",
+]
+
+[[package]]
+name = "futures-lite"
+version = "1.12.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48"
+dependencies = [
+ "fastrand",
+ "futures-core",
+ "futures-io",
+ "memchr",
+ "parking 2.0.0",
+ "pin-project-lite 0.2.7",
+ "waker-fn",
+]
+
[[package]]
name = "futures-sink"
version = "0.3.16"
@@ -325,6 +586,12 @@ version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbe54a98670017f3be909561f6ad13e810d9a51f3f061b902062ca3da80799f2"
+[[package]]
+name = "futures-timer"
+version = "3.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c"
+
[[package]]
name = "futures-util"
version = "0.3.16"
@@ -332,10 +599,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67eb846bfd58e44a8481a00049e82c43e0ccb5d61f8dc071057cb19249dd4d78"
dependencies = [
"autocfg",
+ "futures-channel",
"futures-core",
+ "futures-io",
+ "futures-sink",
"futures-task",
- "pin-project-lite",
+ "memchr",
+ "pin-project-lite 0.2.7",
"pin-utils",
+ "slab",
]
[[package]]
@@ -359,6 +631,12 @@ dependencies = [
"wasi",
]
+[[package]]
+name = "gimli"
+version = "0.25.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7"
+
[[package]]
name = "glob"
version = "0.3.0"
@@ -390,6 +668,125 @@ version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
+[[package]]
+name = "heim"
+version = "0.1.0-beta.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d1014732324a9baf5a691525faabb33909bf6f40dcc2b03c8f2fb07bb01e7e3f"
+dependencies = [
+ "heim-common",
+ "heim-process",
+ "heim-runtime",
+]
+
+[[package]]
+name = "heim-common"
+version = "0.1.0-rc.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d767e6e47cf88abe7c9a5ebb4df82f180d30d9c0ba0269b6d166482461765834"
+dependencies = [
+ "cfg-if 1.0.0",
+ "core-foundation",
+ "futures-core",
+ "futures-util",
+ "lazy_static",
+ "libc",
+ "mach",
+ "nix 0.19.1",
+ "pin-utils",
+ "uom",
+ "winapi",
+]
+
+[[package]]
+name = "heim-cpu"
+version = "0.1.0-rc.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ba5fb13a3b90581d22b4edf99e87c54316444622ae123d36816a227a7caa6df"
+dependencies = [
+ "cfg-if 1.0.0",
+ "futures",
+ "glob",
+ "heim-common",
+ "heim-runtime",
+ "lazy_static",
+ "libc",
+ "mach",
+ "ntapi",
+ "smol 1.2.5",
+ "winapi",
+]
+
+[[package]]
+name = "heim-host"
+version = "0.1.0-rc.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9abf6cd02bc4f6e6aa31a7f80702a2d0e574f4f2c6156a93c3550eb036304722"
+dependencies = [
+ "cfg-if 1.0.0",
+ "heim-common",
+ "heim-runtime",
+ "lazy_static",
+ "libc",
+ "log",
+ "mach",
+ "ntapi",
+ "platforms 1.0.3",
+ "winapi",
+]
+
+[[package]]
+name = "heim-net"
+version = "0.1.0-rc.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d13afa5e9b71c813c1e087bb27f51ae87d3a6d68a2bdd045bae4322dfae4948b"
+dependencies = [
+ "bitflags 1.2.1",
+ "cfg-if 1.0.0",
+ "heim-common",
+ "heim-runtime",
+ "libc",
+ "macaddr",
+ "nix 0.19.1",
+]
+
+[[package]]
+name = "heim-process"
+version = "0.1.1-beta.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fd969deb2a89a488b6a9bf18a65923ae4cdef6b128fa2dedb74ef5c694deb5ae"
+dependencies = [
+ "async-trait",
+ "cfg-if 0.1.10",
+ "darwin-libproc",
+ "futures",
+ "heim-common",
+ "heim-cpu",
+ "heim-host",
+ "heim-net",
+ "heim-runtime",
+ "lazy_static",
+ "libc",
+ "mach",
+ "memchr",
+ "ntapi",
+ "ordered-float",
+ "smol 0.1.18",
+ "winapi",
+]
+
+[[package]]
+name = "heim-runtime"
+version = "0.1.0-rc.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "54ec7e5238c8f0dd0cc60914d31a5a7aadd4cde74c966a76c1caed1f5224e9b8"
+dependencies = [
+ "futures",
+ "futures-timer",
+ "once_cell",
+ "smol 1.2.5",
+]
+
[[package]]
name = "hermit-abi"
version = "0.1.19"
@@ -418,7 +815,7 @@ checksum = "60daa14be0e0786db0f03a9e57cb404c9d756eed2b6c62b9ea98ec5743ec75a9"
dependencies = [
"bytes",
"http",
- "pin-project-lite",
+ "pin-project-lite 0.2.7",
]
[[package]]
@@ -449,8 +846,8 @@ dependencies = [
"httparse",
"httpdate",
"itoa",
- "pin-project-lite",
- "socket2",
+ "pin-project-lite 0.2.7",
+ "socket2 0.4.0",
"tokio",
"tower-service",
"tracing",
@@ -551,6 +948,12 @@ dependencies = [
"cfg-if 1.0.0",
]
+[[package]]
+name = "macaddr"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baee0bbc17ce759db233beb01648088061bf678383130602a298e6998eedb2d8"
+
[[package]]
name = "mach"
version = "0.3.2"
@@ -641,6 +1044,18 @@ dependencies = [
"void",
]
+[[package]]
+name = "nix"
+version = "0.19.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b2ccba0cfe4fdf15982d1674c69b1fd80bad427d293849982668dfe454bd61f2"
+dependencies = [
+ "bitflags 1.2.1",
+ "cc",
+ "cfg-if 1.0.0",
+ "libc",
+]
+
[[package]]
name = "nix"
version = "0.20.0"
@@ -662,6 +1077,36 @@ dependencies = [
"winapi",
]
+[[package]]
+name = "num-integer"
+version = "0.1.44"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
+dependencies = [
+ "autocfg",
+ "num-traits",
+]
+
+[[package]]
+name = "num-rational"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07"
+dependencies = [
+ "autocfg",
+ "num-integer",
+ "num-traits",
+]
+
+[[package]]
+name = "num-traits"
+version = "0.2.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
+dependencies = [
+ "autocfg",
+]
+
[[package]]
name = "num_cpus"
version = "1.13.0"
@@ -672,11 +1117,20 @@ dependencies = [
"libc",
]
+[[package]]
+name = "object"
+version = "0.26.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c55827317fb4c08822499848a14237d2874d6f139828893017237e7ab93eb386"
+dependencies = [
+ "memchr",
+]
+
[[package]]
name = "once_cell"
-version = "1.8.0"
+version = "1.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56"
+checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0"
[[package]]
name = "opaque-debug"
@@ -717,6 +1171,27 @@ dependencies = [
"vcpkg",
]
+[[package]]
+name = "ordered-float"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "18869315e81473c951eb56ad5558bbc56978562d3ecfb87abb7a1e944cea4518"
+dependencies = [
+ "num-traits",
+]
+
+[[package]]
+name = "parking"
+version = "1.0.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6cb300f271742d4a2a66c01b6b2fa0c83dfebd2e0bf11addb879a3547b4ed87c"
+
+[[package]]
+name = "parking"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72"
+
[[package]]
name = "parking_lot"
version = "0.11.1"
@@ -760,6 +1235,12 @@ version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
+[[package]]
+name = "pin-project-lite"
+version = "0.1.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777"
+
[[package]]
name = "pin-project-lite"
version = "0.2.7"
@@ -784,6 +1265,25 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "feb3b2b1033b8a60b4da6ee470325f887758c95d5320f52f9ce0df055a55940e"
+[[package]]
+name = "platforms"
+version = "1.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cc77a3fc329982cbf3ea772aa265b742a550998bad65747c630406ee52dac425"
+
+[[package]]
+name = "polling"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "92341d779fa34ea8437ef4d82d440d5e1ce3f3ff7f824aa64424cd481f9a1f25"
+dependencies = [
+ "cfg-if 1.0.0",
+ "libc",
+ "log",
+ "wepoll-ffi",
+ "winapi",
+]
+
[[package]]
name = "ppv-lite86"
version = "0.2.10"
@@ -813,7 +1313,7 @@ dependencies = [
"nix 0.17.0",
"num_cpus",
"once_cell",
- "platforms",
+ "platforms 0.2.1",
"thiserror",
"unescape",
]
@@ -913,7 +1413,7 @@ dependencies = [
"mime",
"native-tls",
"percent-encoding",
- "pin-project-lite",
+ "pin-project-lite 0.2.7",
"serde",
"serde_json",
"serde_urlencoded",
@@ -926,6 +1426,12 @@ dependencies = [
"winreg",
]
+[[package]]
+name = "rustc-demangle"
+version = "0.1.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342"
+
[[package]]
name = "ryu"
version = "1.0.5"
@@ -942,6 +1448,12 @@ dependencies = [
"winapi",
]
+[[package]]
+name = "scoped-tls"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2"
+
[[package]]
name = "scopeguard"
version = "1.1.0"
@@ -1013,6 +1525,16 @@ dependencies = [
"opaque-debug",
]
+[[package]]
+name = "signal-hook"
+version = "0.3.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9c98891d737e271a2954825ef19e46bd16bdb98e2746f2eec4f7a4ef7946efd1"
+dependencies = [
+ "libc",
+ "signal-hook-registry",
+]
+
[[package]]
name = "signal-hook-registry"
version = "1.4.0"
@@ -1034,6 +1556,56 @@ version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"
+[[package]]
+name = "smol"
+version = "0.1.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "620cbb3c6e34da57d3a248cda0cd01cd5848164dc062e764e65d06fe3ea7aed5"
+dependencies = [
+ "async-task 3.0.0",
+ "blocking 0.4.7",
+ "concurrent-queue",
+ "fastrand",
+ "futures-io",
+ "futures-util",
+ "libc",
+ "once_cell",
+ "scoped-tls",
+ "slab",
+ "socket2 0.3.19",
+ "wepoll-sys-stjepang",
+ "winapi",
+]
+
+[[package]]
+name = "smol"
+version = "1.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85cf3b5351f3e783c1d79ab5fc604eeed8b8ae9abd36b166e8b87a089efd85e4"
+dependencies = [
+ "async-channel",
+ "async-executor",
+ "async-fs",
+ "async-io",
+ "async-lock",
+ "async-net",
+ "async-process",
+ "blocking 1.0.2",
+ "futures-lite 1.12.0",
+ "once_cell",
+]
+
+[[package]]
+name = "socket2"
+version = "0.3.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e"
+dependencies = [
+ "cfg-if 1.0.0",
+ "libc",
+ "winapi",
+]
+
[[package]]
name = "socket2"
version = "0.4.0"
@@ -1086,6 +1658,20 @@ dependencies = [
"winapi",
]
+[[package]]
+name = "testdir"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1c13a556e110c7d373db3c12464a80e4d24ed25942381242b17aad43aee98085"
+dependencies = [
+ "anyhow",
+ "backtrace",
+ "heim",
+ "once_cell",
+ "smol 1.2.5",
+ "whoami",
+]
+
[[package]]
name = "textwrap"
version = "0.9.0"
@@ -1154,7 +1740,7 @@ dependencies = [
"num_cpus",
"once_cell",
"parking_lot",
- "pin-project-lite",
+ "pin-project-lite 0.2.7",
"signal-hook-registry",
"tokio-macros",
"winapi",
@@ -1191,7 +1777,7 @@ dependencies = [
"futures-core",
"futures-sink",
"log",
- "pin-project-lite",
+ "pin-project-lite 0.2.7",
"tokio",
]
@@ -1217,7 +1803,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d"
dependencies = [
"cfg-if 1.0.0",
- "pin-project-lite",
+ "pin-project-lite 0.2.7",
"tracing-core",
]
@@ -1278,6 +1864,17 @@ version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
+[[package]]
+name = "uom"
+version = "0.30.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e76503e636584f1e10b9b3b9498538279561adcef5412927ba00c2b32c4ce5ed"
+dependencies = [
+ "num-rational",
+ "num-traits",
+ "typenum",
+]
+
[[package]]
name = "url"
version = "2.2.2"
@@ -1314,6 +1911,12 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
+[[package]]
+name = "waker-fn"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca"
+
[[package]]
name = "want"
version = "0.3.0"
@@ -1408,6 +2011,34 @@ dependencies = [
"wasm-bindgen",
]
+[[package]]
+name = "wepoll-ffi"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb"
+dependencies = [
+ "cc",
+]
+
+[[package]]
+name = "wepoll-sys-stjepang"
+version = "1.0.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fdfbb03f290ca0b27922e8d48a0997b4ceea12df33269b9f75e713311eb178d"
+dependencies = [
+ "cc",
+]
+
+[[package]]
+name = "whoami"
+version = "1.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f7741161a40200a867c96dfa5574544efa4178cf4c8f770b62dd1cc0362d7ae1"
+dependencies = [
+ "wasm-bindgen",
+ "web-sys",
+]
+
[[package]]
name = "winapi"
version = "0.3.9"
diff --git a/Cargo.toml b/Cargo.toml
index 02502ec..de821a5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "apmpkg"
-version = "1.4.1"
+version = "1.5.0"
authors = ["kedap
+ +
+ +[Spanish](./README.md) + +# NEWS +- Version has been released: v1.5 For everybody!!! +- Creation of the binaries for all available distributions +- ApmPKG is uploaded is in [AUR](https://aur.archlinux.org/packages/apmpkg/) +- Adding support for Nix +- Fixing the bug caused with `apmpkg create abc hello-world` +- You can add files in `/home` of different users +- In binary installation the pre-installation scripts are not executed + +* * * +A package manager that wants to be a powerful universal tool for Linux in order to create and install packages. +![Captura](img/captura_prin.png) + +## Creating packages + +This is a tool written in rust and bash, that uses native package managers for the resolution of dependencies, you can create packages from a simple file with TOML syntax and you can even create it from a PKGBUILD! +The managers that are supported by ApmPKG: + +- [x] Apt +- [x] Pacman +- [x] Dnf +- [x] Snap +- [x] Flatpak +- [x] Zypper +- [x] Yum +- [x] Apk +- [x] Pkg (termux) +- [x] Slapt-get +- [x] Nix +- [ ] Emerge +- [ ] Yay + +In the same way, binaries can be created for an offline installation. [binary](doc/modos_de_instalacion.md/#instalacion-desde-un-archivo-binario-de-instalacion) to know [more information here](doc/modos_de_instalacion.md) + +## Intallation +* * * +Although it is something difficult or strange, in the same way we can install apmpkg with the same apmpkg, even because we believe that the distribution of packages is important we try to make available and create native binaries for each distribution where package managers are supported, but first you must have the dependencies, among them: +- pip3/pip2 +- npm +- bundle +- wget +- fakeroot +- git +- rsync + +For this you can go to the section of [release](https://github.com/Kedap/apmpkg/releases/) where the packages are uploaded, if you want to have more information, [click here](doc/instalacion.md) + +# Feature +![Esquema](img/esquema.png) + +- Creation of packages for scripting languages, a clear example is python, javascript / typescript and ruby. With support with pip, bundle and npm [more information here](doc/creando_paquetes.md/#adi) +- Ease of creation of packages on the model [PKGBUILD of archlinux](https://wiki.archlinux.org/index.php/PKGBUILD) that is, we have support for AUR, although we have certain [limitations to say that we have support for all existing PKGBUILD](doc/creando_paquetes.md/#complicaciones-abc) but in the same way we are working on that +- Dependency resolution with the package managers mentioned above, we will work to make the list more extensive +- Download and / or compile from a url, example: `apmpkg instalar -u https://foo.com/bar` +- Extensions of our tool, *.adi, .abc y .abi.tar.gz* each one has a special function, [more information here](doc/modos_de_instalacion.md) +- Create a prototype for a generate a .adi or .abc file, with the command: `apmpkg crear adi foo` In the case of creating an .abc file, the following must be executed: `apmpkg crear abc foo` +- Build your binaries, With the arrival of version 1.2 you can build binaries without the need to install them, you just have to run: `apmpkg construir foo.adi` or if it is an .abc package: `apmpkg construir foo.abc` +- With the arrival of version 1.3 you can run post installation scripts [more information here](doc/creando_paquetes.md/#instalacion) +- In the version 1.4 pre-install scripts can be run +- Apartir de la version 1.5 se pueden colocar archivos dentro de `/home` + +## Contribute +If you have a good idea or want to contribute to this project you can start with [here](https://github.com/Kedap/apmpkg/issues) and [read this](CONTRIBUTING.md) + +## FAQ / Frequently Asked Questions + +**Is it really universal for ALL available gnu / linux distributions?** + +No, only for those that we have support for dependencies, package managers and their architecture. +in the same way, not all dependencies are called the same in all distributions that are similarly +solves by asking for some alternative dependency name found in your preferred package manager + +**Why is there no binary for X distribution if the X manager is available?** + +Although we try to do that we cannot, we generate the binaries of the most used distributions and apart each distribution has its architectures and packaging ways, in the event that we do not provide said binary it is highly recommended to [compile it](doc/installation_modes.md) + +**¿Existe una documentacion en ingles / Is there an English documentation?** + +Esta en nuestro planes agregar una documentacion en ingles. It will soon be available + +**Why don't they implement X feature?** + +For the same reason, because you do not share your idea, we will be happy to know your idea, you can support [here](https://github.com/Kedap/apmpkg/issues) and/or if you want more information [here](CONTRIBUTING.md) diff --git a/doc/creando_paquetes.md b/doc/creando_paquetes.md index e131e03..5578d76 100644 --- a/doc/creando_paquetes.md +++ b/doc/creando_paquetes.md @@ -1,6 +1,8 @@ # Guia para crear paquetes utilizando ApmPKG En esta guia aprenderas todo lo que se debe de saber al crear paquetes para ApmPKG, de esta manera podemos extender su uso mucho mas y tener paquetes para linux +[English](./creando_paquetes_en.md) + Tabla de contenidos 1. [Contruyendo con un Archivo de Descarga e Instalacion: ADI](#adi) 1. [Datos del paquete](#paquete) @@ -71,8 +73,8 @@ sha256sum = "ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" # SALT #opt_src = true pre_install = "pre_apmpkg.sh" -files = ["main.rb" , "config.conf"] -ruta = ["/usr/bin/foo", "/etc/foo/config.conf"] +files = ["main.rb" , "config.conf", "porfile_user_default.py"] +ruta = ["/usr/bin/foo", "/etc/foo/config.conf", ".local/share/porfile_app.py"] post_install = "post_apmpkg.sh" mensaje = "Para poder ejecutar, prueba con 'foo'!" ``` @@ -180,14 +182,15 @@ Aqui se enfoca la informacion refrente a la ruta de instalacion, este se inicia ``` #opt_src = true pre_install = "pre_install.sh" -files = ["main.rb" , "config.conf"] -ruta = ["/usr/bin/foo", "/etc/foo/config.conf"] +files = ["main.rb" , "config.conf", "porfile_user_default.py"] +ruta = ["/usr/bin/foo", "/etc/foo/config.conf", ".local/share/porfile_app.py"] post_install = "post_apmpkg.sh" mensaje = "Para poder ejecutar, prueba con 'foo'!" ``` La variable **opt_src** es un boleano que admite true o false si es que se desea que todo el directorio obtenido por git o por la descarga se copia a la carpeta /opt, un ejemplo de esto es el paquete metasploit que se instala en la carpeta opt. -**files** y **ruta** ambos son arrays que contienen ruta de archivos, files selecciona los archivos que se van a instalar y ruta la ruta donde estos van a ser instalados, el primer archivo seleccionado se va a instalar con `install -Dm 755` ya que se da por hecho que el index 0 de ambos array es un binario. +**files** y **ruta** ambos son arrays que contienen ruta de archivos, files selecciona los archivos que se van a instalar y ruta la ruta donde estos van a ser instalados, el primer archivo seleccionado se va a instalar con `install -Dm 755` ya que se da por hecho que el index 0 de ambos array es un binario. en el caso de que quiera colocar un archivo dentro de `/home` debe de colocar una ruta relativa (no root) +como en este ejemplo ".local/share/foo.bar" se instalara dentro de `/home` en cualquiera de los usuarios existentes Encontraremos con la variable **post_install** que no es mas un variable string que almacena la ruta del script escrito en bash que se ejecutara una vez instalado el paquete en el caso de dar otra salida que no sea exit code 0, se dara por fallido diff --git a/doc/creando_paquetes_en.md b/doc/creando_paquetes_en.md new file mode 100644 index 0000000..24f23fe --- /dev/null +++ b/doc/creando_paquetes_en.md @@ -0,0 +1,240 @@ +# Guide to creating packages using ApmPKG +In this guide you will learn everything you need to know when creating packages for ApmPKG, in this way we can extend its use much more and have packages for linux + +[Spanish](./creando_paquetes.md) + +Table of Contents +1. [Build a Archivo de Descarga e Instalacion (Download and Installation File): ADI](#adi) + 1. [Package data](#package) + 2. [External dependencies](#dependencies-adi) + 3. [Ruby gems](#gem) + 4. [Pip2 / pip3](#pip) + 5. [Npm](#npm) + 6. [download](#download) + 7. [installation](#installation) +2. [Compile and install from a Archivo de Bash y Compilando (Bash File and Compiling)](#abc) + 1. [Errors with abc](#complications-abc) +3. [Generate a file easily](#create-command) +4. [FAQs / Frequently Asked Questions](#frequent-questions) + +# Adi +Your name from the acronym for (spanish): +**A**rchivo de +**D**escarga e +**I**nstalacion + +**D**ownload and +**I**nstallation +**F**ile +(English) + +This method was created with the purpose of being able to create applications written in python and / or ruby since ApmPKG has support for Pip and Bundle, in this way it seeks to be easier and more practical to create applications with these languages. First; what an ADI file looks like, then here is a prototype of this: +``` +[paquete] + +nombre = "foo" +version = "1.1" +rama = "estable" # git / beta +descrip = "Ejemplo para el prototipo de apmpkg" +pagina = "https://foo.com/" +licensia = "GPL-V3" +dependencias = ["ruby", "metasploit"] +#cmd_depen = ["ruby" , "msfconsole"] +#abi_dependencias = ["metasploit"] +#arch = "x86_64" +conflicto = "/opt/foo/" + +#[dependencias_adi] +#metasploit = "https://foo/bar/alterntiva/metasploit.abi.tar.gz" + +[gem] + +gemfile = true +file = "Gemfile" +#gemfile = false +#gemas = ["colorized", "rails"] + +#[pip] + +#version = 3 / 2 +#requirements = false / true +#packages = ["requests", "pytest-shutil", "objdict"] +#file = "requeriments.txt" + +#[npm] +#package_json = true / false +#ruta_package_json = "package.json" +#modulos = ["angular", "electron"] + +[descarga] + +url = "https://foo.com/bar.tar.gz" +carpeta = "foo-bar" +#git = "https://serviciogit.com/foo/bar" +#local = "/path/de/las/fuentes/foo.tar.gz" +sha256sum = "ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" # SALTAR + +[instalacion] + +#opt_src = true +pre_install = "pre_apmpkg.sh" +files = ["main.rb" , "config.conf", "porfile_user_default.py"] +ruta = ["/usr/bin/foo", "/etc/foo/config.conf", ".local/share/porfile_app.py"] +post_install = "post_apmpkg.sh" +mensaje = "Para poder ejecutar, prueba con 'foo'!" +``` +A lot of information, we go by steps, ADI has the TOML syntax to make it easier to create packages, in this way we are going to see each of the lines: + +## Package +The package start is nothing more and nothing less than the data of the package to which to install, it is written with the start of `[paquete]`, something like that: +``` +nombre = "foo" +version = "1.1" +rama = "estable" # git / beta +descrip = "Ejemplo para el prototipo de apmpkg" +pagina = "https://foo.com/" +licensia = "GPL-V3" +dependencias = ["ruby", "metasploit"] +#cmd_depen = ["ruby" , "msfconsole"] +conflicto = "/opt/foo/" +#abi_dependencias = ["metasploit"] +``` +A little easier, right? From here we see basic things like the name and the version that are strings, nothing very important to discard, but we see something in the branch. +The **branch** variable is a string that is used to differentiate between what the package is, if it is a beta version, if it is from the git or development branch or if it is a stable version. + +Let's go to the following which is **descrip**, and **license**. These are strings where you place a short description of the package and the license to specify what type of package license it is. + +**dependencies** and **cmd-depen**: dependencies is an array where the name of the packages to which they should be installed are placed, and cmd_depen is something very curious, since to verify that the dependencies are installed, run a command; In other words, if the dependency is python after executing the installation command, `python` is executed and if an output of 127 is obtained, it is assumed that the dependency is installed, but nevertheless there are packages that are executed in different ways such as It is the example of `openssh` that is executed with` ssh` or in this case `metasploit` that is executed with` msfconsole` that is why this array was created. However, it is not necessary IF ALL the dependencies are executed with the same name with which it is installed, as is the case of `ruby` + +**conflict**: This string must contain a path, if said path or file exists it cannot be installed, that is, it prevents a package from being installed when it is already installed with another package manager + +**abi_dependencies** It is an array where dependencies are placed that **in the case** of not being found and/or resolved with native package managers, these dependencies will be installed externally by ApmPKG, see more information in [dependencies_adi](#dependencies-adi) + +**arch** It is a string variable that must be placed in the event that said package is compatible only for said architecture, in the event that it is available for all architectures, this variable should not be placed, since if said variable it is not placed it is assumed that the package is built for any architecture + +## Adi dependencies + +This section was integrated with version 1.2.0, the function of this section is to grant the sources of dependencies that have not been resolved with the native package managers, either because they are not in the repository or because they are found broken and/or for some other reason ... + +```toml +metasploit = "https://foo/bar/alterntiva/metasploit.abi.tar.gz" +``` + +We have a simple line, the variables in this section will have the name of the dependency that in the case of not being fulfilled will be installed through this option, in this case the **metasploit** dependency, the value of said variable will make a string containing the path from where to download said package in .abi.tar.gz format so that it can be installed by apmpkg + +## Gem +This section was created to contain information regarding gems that the package depends on, of course ruby gems and that will be installed with `bundle` or` gem` This section begins with `[gem]`, this section is not mandatory, it is only placed If the project depends on gems, if the case is yes, here is an example: +``` +gemfile = true +file = "Gemfile" +#gemfile = false +#gemas = ["colorized", "rails"] +``` +The **gemfile** variable is a boolean (true/false) that it must be placed in a mandatory way, this is to know if the project has a Gemfile to download the gems with this file, in the case that the project It contains a Gemfile, this must be set as true and if not then as false. + +**file** this variable is ONLY placed if the gemfile contains true, since here in this string the path of the Gemfile will be specified, in this case only "Gemfile" is set since it is found in the project folder + +**gems** this is an array where the gems on which it depends are specified, it is recommended that it must be few, few gems how to create a Gemfile but not so many, it is designed for projects that depend on 2 or 3 gems + +## Pip +Like ruby, python also has dependencies, these will be installed with pip by ApmPKG, in the same way this field is not mandatory unless the project requires it, we have support for pip2 and pip3, this is placed with `[pip] `below what it must contain: +``` +version = 3 # 2 +requirements = true # false +#packages = ["requests", "pytest-shutil", "objdict"] +file = "requeriments.txt" +``` +In **version** it must contain an integer and the version number of python / pip with which the dependencies will be installed, in the example we can see that it will be installed with pip3. + +En **requirements** es un boleano donde se debe de colocar true si es que el proyecto instala sus dependencias con el archivo requeriments.txt y false si no + +In **packages** it is an array where the dependencies are specified, this should not be put if the requirements are set to false. + +On the contrary **file** is a string where the path of the file requirements.txt is specified so that from here the dependencies are installed with pip + +## Npm +In this section we can find a space to correctly manage the npm modules, in an adi file it can be seen like this: +``` +#[npm] +#package_json = true / false +#ruta_package_json = "package.json" +#modulos = ["angular", "electron"] +``` + +In the variable **package.json** it is a boolean that indicates if the modules will be installed from a `package_json` + +In the **package_json_path** it is a string of the path where the `package_json` is located within the project + +On the array **modules** in case package_json is false it should contain the modules that should be installed + +## Download +The download section is for this, where you specify the details of the download, it starts `[download] `in one of the examples: +``` +url = "https://foo.com/bar.tar.gz" +#git = "https://serviciogit.com/foo/bar" +#local = "/path/local/de/las/fuentes" +carpeta = "foo-bar" +sha256sum = "ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" # SALTAR +``` +The **url** variable is a string where the package download link is said, it must be compressed in `tar.gz` since it will be extracted with this compression format, but nevertheless in the git versions it has been created the **git** variable that is placed instead of url, when placing git the repository described here will be cloned, or failing that, if you have one of the sources on your computer, you can place its path in the variable **local** + +In **folder** the directory that must be accessed once the tar.gz has been extracted or the git cloned is placed + +In **sha256sums** you must enter the sha256 sums of the file to download, in the case that a git version is used, this must change its value as: `sha256sums =" SKIP "` in this way get verification by sha256 + +## Installation +Here the information regarding the installation path is focused, this starts with `[installation]` example: +``` +#opt_src = true +pre_install = "pre_install.sh" +files = ["main.rb" , "config.conf", "porfile_user_default.py"] +ruta = ["/usr/bin/foo", "/etc/foo/config.conf", ".local/share/porfile_app.py"] +post_install = "post_apmpkg.sh" +mensaje = "Para poder ejecutar, prueba con 'foo'!" +``` +The **opt_src** variable is a boolean that admits true or false if you want the entire directory obtained by git or by the download to be copied to the /opt folder, an example of this is the metasploit package that is installed in the opt folder. + +**files** and **path** are both arrays that contain file paths, files select the files to be installed and path the path where they are to be installed, the first selected file will be installed with ` install -Dm 755` since the index 0 of both arrays is assumed to be binary. in case you want to place a file inside `/home` you must put a relative path (not root) +as in this example ".local/share/foo.bar" will be installed inside `/home` in any of the existing users + +We will find with the **post_install** variable that is no longer a string variable that stores the path of the script written in bash that will be executed once the package is installed in the case of giving another output that is not exit code 0, it will be given by failed + +In the pre_install variable you will find the path where the bash script is, like the post_install script, it will be considered as failed if it returns an output other than 0 + +## Abc +Su nombre es el acronimo de (spanish): +**A**rchivo de +**B**ash y +**C**ompilacion + +(english) +**B**ash +**F**ile and +**C**ompilation + +This type of file is based on and/or cloned from the [PKGBUILD](https://wiki.archlinux.org/index.php/PKGBUILD) of archlinux, it is not necessary to explain what this great archlinux model can do, but without However, we will focus on what ApmPKG cannot do with a PKGBUILD because we still cannot have absolute compatibility, but we are working so that it is not so in the future, so we present the limitations in relation to abc +## Complications abc +We currently do not have support with the following variables +- groups: We currently do not have groups for packages +- depends: As we saw that to create ADI and how dependencies are checked is [executing](# package), with abc files they are checked looking for the name of the dependency in `/bin` and in` /usr/bin` and if not then It is given as a dependency not installed. +- optdepeds: We just don't use this variable like provides, conflicts, backups, options, install, changelog and all non-sha256 sums +In the same way, with the arrival of version 1.0.1, the `cmd_depen` variable was implemented so that the dependency can also be checked if this command is executed, giving 127 as output, it is considered not installed + + +# Create command + +In the update of version 1.1 we have integrated a subcommand for the creation of a prototype of which it is necessary to create, which is the following: +``` +apmpkg crear