{ "name": "libzip", "version": "1.11.4", "summary": "libzip: read and write zip archives (deflate, bzip2, xz, zstd, AES), for PHP's zip extension", "category": "library", "license": "BSD-3-Clause", "homepage": "https://libzip.org/", "source": { "url": "https://libzip.org/download/libzip-1.11.4.tar.xz", "sha256": "8a247f57d1e3e6f6d11413b12a6f28a9d388de110adc0ec608d893180ed7097b" }, "watch": {"kind": "index", "url": "https://libzip.org/download/", "regex": "libzip-([0-9]+(?:\\.[0-9]+)+[a-z]?[0-9]*)\\.tar\\.xz"}, "deps": [ "zlib", "bzip2", "xz", "zstd", "openssl" ], "env_packages": [], "static": true, "nss": false, "check": "check_static bin/ziptool bin/zipcmp bin/zipmerge && t=$(mktemp -d) && m=bvs-$RANDOM$RANDOM && bin/ziptool -n \"$t/x.zip\" add a.txt \"$m\" set_file_compression 0 deflate 9 > /dev/null && [ \"$(bin/ziptool \"$t/x.zip\" cat 0)\" = \"$m\" ] && bin/zipcmp -q \"$t/x.zip\" \"$t/x.zip\" && CHECK_CPPFLAGS=\"-DZ=\\\"$t/c.zip\\\"\" check_lib libzip zip.h 'int e; const char *s = \"bvs libzip check\"; zip_t *z = zip_open(Z, ZIP_CREATE | ZIP_TRUNCATE, &e); if (!z) return 1; zip_uint16_t ms[] = {ZIP_CM_DEFLATE, ZIP_CM_BZIP2, ZIP_CM_XZ, ZIP_CM_ZSTD}; for (int i = 0; i < 4; i++) { char n[8]; snprintf(n, sizeof n, \"f%d\", i); zip_source_t *src = zip_source_buffer(z, s, strlen(s), 0); zip_int64_t x = zip_file_add(z, n, src, ZIP_FL_OVERWRITE); if (x < 0 || zip_set_file_compression(z, x, ms[i], 9) < 0) return 2; if (i == 0 && zip_file_set_encryption(z, x, ZIP_EM_AES_256, \"pw\") < 0) return 3; } if (zip_close(z) < 0) return 4; z = zip_open(Z, ZIP_RDONLY, &e); if (!z || zip_get_num_entries(z, 0) != 4) return 5; for (int i = 0; i < 4; i++) { char b[64] = {0}; zip_stat_t st; if (zip_stat_index(z, i, 0, &st) < 0 || st.comp_method != ms[i]) return 6; zip_file_t *f = i == 0 ? zip_fopen_index_encrypted(z, i, 0, \"pw\") : zip_fopen_index(z, i, 0); if (!f || zip_fread(f, b, sizeof b) != (zip_int64_t) strlen(s) || strcmp(b, s)) return 7; zip_fclose(f); } if (zip_fopen_index_encrypted(z, 0, 0, \"wrong\")) return 8; zip_close(z)'; r=$?; rm -rf -- \"${t:?}\"; [ $r = 0 ] && echo \"libzip $(bin/zipcmp -V | sed -n 's/^zipcmp (libzip \\([0-9.]*\\))$/\\1/p'): ziptool adds and reads a file, zipcmp; through the C API deflate, bzip2, xz and zstd entries written and read back, AES-256 read with the password and refused with a wrong one\"; exit $r" }