aboutsummaryrefslogtreecommitdiffstats
path: root/include/package-ipkg.mk
Commit message (Collapse)AuthorAgeFilesLines
* tools: build bash on macOS and use it for ipkg-buildFelix Fietkau2022-01-271-1/+1
| | | | | | | | | On macOS, system binaries silently drop the environment variables for injecting extra shared libraries (used by fakeroot). This is done for security reasons. Work around this by building bash from source, so that it gets an ad-hoc signature and does not have these restrictions Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: allow package to be built for all variantsEneas U de Queiroz2021-11-151-1/+1
| | | | | | | | | | | | This allows a package to be rebuilt for all different VARIANTs. To do so, set VARIANT=*. The wpa-cli package is not getting built after changes made by 19aae94 [build: avoid rebuilds of unset VARIANT packages], because wpa-cli is only built when compiling a variant that includes supplicant support, and the first selected variant may not build it. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
* build: avoid rebuilds of unset VARIANT packagesEneas U de Queiroz2021-11-011-1/+2
| | | | | | | | | | | If a Makefile defines some packages with VARIANT set, and others without it, the latter will be built once for every different VARIANT set, each build trumping the previous one. Avoid rebuilds by only building unnamed variant packages when the first variant is built. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
* build: prepend ABI suffixes with a dash if package name ends with digitJo-Philipp Wich2021-06-141-1/+1
| | | | | | | | | | Ensure that ABI suffixes are separated with a dash from the package name if the name happens to end with a digit. This implementation detail got lost during the recent refactoring of the ABI_VERSION handling in buildroot. Ref: https://github.com/openwrt/packages/pull/14237#issuecomment-860473585 Fixes: c921650382 ("build: drop ABI version from metadata") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* build: introduce $(MKHASH)Leonardo Mörlein2021-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, it was assumed that mkhash is in the PATH. While this was fine for the normal build workflow, this led to some issues if make TOPDIR="$(pwd)" -C "$pkgdir" compile was called manually. In most of the cases, I just saw warnings like this: make: Entering directory '/home/.../package/gluon-status-page' bash: line 1: mkhash: command not found bash: line 1: mkhash: command not found bash: line 1: mkhash: command not found bash: line 1: mkhash: command not found bash: line 1: mkhash: command not found bash: line 1: mkhash: command not found bash: line 1: mkhash: command not found bash: line 1: mkhash: command not found [...] While these were only warnings and the package still compiled sucessfully, I also observed that some package even fail to build because of this. After applying this commit, the variable $(MKHASH) is introduced. This variable points to $(STAGING_DIR_HOST)/bin/mkhash, which is always the correct path. Signed-off-by: Leonardo Mörlein <me@irrelefant.net>
* include: store ABIVersion in Packages indexPaul Spooren2021-03-081-0/+1
| | | | | | | | | | | | | | | | | | | | With the existence of ABI versions there is no clean way to determine the package name without an attached ABI version. The Packages index is stored on device to know what packages are installed. The ABIVersion was recently removed in c921650382 "build: drop ABI version from metadata", while ABI versions still exists. This becomes a problem if a user tries to export installed packages via `ubus call rpcd-sys packagelist` which would return package names including the ABI version. Trying to find these packages in a later release with changes ABI version is impossible. This commits adds the `ABIVersion` field again. Knowing both the combined (SourceName + ABIVersion) and the `ABIVersion` it is possible to calculate the package `SourceName` without storing it in the on-device package list. Signed-off-by: Paul Spooren <mail@aparcar.org>
* build: fix ABI version for PROVIDES symbolsFelix Fietkau2021-02-181-1/+1
| | | | | | | | GetABISuffix does not work for intra-package ABI version of provided symbols, since ABIV_$(provided) is not set. Fix ABI version by using $(ABIV_$(1)) directly Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: only overwrite ABI version for provided packages when base version ↵Felix Fietkau2021-02-151-5/+5
| | | | | | | | changed Should avoid some spurious rebuilds Signed-off-by: Felix Fietkau <nbd@nbd.name>
* Mostly revert "build: add support for fixing up library soname"Felix Fietkau2021-02-151-5/+0
| | | | | | | | | This reverts commit b12288fa69b171f7c9405518c9bed3581a06f7ce. The patchelf approach is too fragile, and the only users of this have been converted to make patching unnecessary Leave the abi_version_str variable in place in rules.mk Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: drop ABI version from metadataFelix Fietkau2021-02-141-2/+7
| | | | | | | Preparation for supporting dynamic ABI versions that depend on the runtime configuration. Read the suffix from the staging dir pkginfo version files. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: add support for fixing up library sonameFelix Fietkau2021-02-141-0/+5
| | | | | | | | | | This makes it possible to declare a package ABI_VERSION independent from the upstream soname by setting PKG_ABI_VERSION in the package makefile. The library filename is fixed up for files installed to packages and to the staging dir. References to the original from executables within the same package are also fixed up Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: use SPDX license tagsPaul Spooren2021-02-051-5/+2
| | | | | | | | | The license folder is a core part of OpenWrt and all GPL-2.0 licensed. Use SPDX license tags to allow machines to check licenses. Signed-off-by: Paul Spooren <mail@aparcar.org> [rebase, keep some Copyright lines, sharpen commit message] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* base-files: remove execute bit and shebang from functions.shAdrian Schmutzler2021-01-291-2/+2
| | | | | | | | | | | /lib/functions.sh was executable for no obvious reason and its execute property was even checked in package-ipkg.mk just to source it afterwards. Remove the execute bit and shebang as this is clearly a library. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> Reviewed-by: Philip Prindeville <philipp@redfish-solutions.com>
* build: use mkhash for IPK metadata checksumsPaul Spooren2020-11-261-2/+2
| | | | | | | | | | | | | | | | | | | | When setting the option IPK_FILES_CHECKSUMS the build system stores checksums of all package file as metadata. In combination with pkg_check this allows to see if a package is broken, e.g. caused by bad flash. To create those checksums the tool `sha256sum` were used while the rest of OpenWrt uses `mkhash`, a small & fast implementation of sha256. As the build system does not check the existence of `sha256sum` and the stderr output is moved to /dev/null, a situation where the option is enabled but no actual checksum are created may occur. Instead of adding `sha256sum` as a requirement, this replaces it with `mkhash sha256` and adapts the `sed` pipe command to fit spacing. CC: Xu Wang <xwang1498@gmx.com> CC: Michal Hrusecky <Michal@Hrusecky.net> Signed-off-by: Paul Spooren <mail@aparcar.org>
* build: allow file modes per binary packageSebastian Kemper2020-09-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the global variable PKG_FILE_MODES is used for all ipkg creations. This works for Makefiles which output a single package, or variants of a single package. But if a Makefile outputs multiple packages that each contain different files, setting PKG_FILE_MODES causes build failure when any of the files in the variable do not exist in the folder that is currently being packaged. Example: /openwrt/staging_dir/host/bin/fakeroot -l /openwrt/staging_dir/host/lib/libfakeroot.so -f /openwrt/staging_dir/host/bin/faked /openwrt/scripts/ipkg-build -m "/usr/lib/mariadb/plugin/auth_pam_tool_dir:root:376:0750" /openwrt/build_dir/target-mips_24kc_musl/mariadb-10.4.13/ipkg-mips_24kc/mariadb-server-plugin-disks /openwrt/bin/packages/mips_24kc/packages +chown: cannot access '/openwrt/build_dir/target-mips_24kc_musl/mariadb-10.4.13/ipkg-mips_24kc/mariadb-server-plugin-disks//usr/lib/mariadb/plugin/auth_pam_tool_dir': No such file or directory This commit changes the file mode handling a bit. The file mode can now be set either globally via PKG_FILE_MODES (no behavior change) or on a per-package basis via FILE_MODES. This way specific file modes can be used for any particular package. This behavior is already used for other OpenWrt variables, hence it is familiar: PKG_MAINTAINER vs MAINTAINER PKG_SOURCE_SUBDIR vs SUBDIR PKG_LICENSE vs LICENSE ... Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
* build: fix extreme build system slowdown caused by SOURCE_DATE_EPOCH changesFelix Fietkau2020-09-051-2/+2
| | | | | | | | Adding inline shell invocations in per-target variables causes them to be executed over and over again, which causes a significant slowdown. Fix this by evaluating it only once per package directory Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: store SourceDateEpoch in manifestPaul Spooren2020-08-311-0/+1
| | | | | | | | The usage of granular `SOURCE_DATE_EPOCH` for packages is an incrementing integer which could be useful for downstream tooling, therefore add it to the packages manifest. Signed-off-by: Paul Spooren <mail@aparcar.org>
* build: store granular timestamps in packagesPaul Spooren2020-08-311-0/+1
| | | | | | | | | | | | | | With the new `SOURCE` argument of `get_source_date_epoch` it is possible to set package timestamps based on actual package changes rather thane $TOPDIR changes. This commit adds a new variable PKG_SOURCE_DATE_EPOCH which is used by the `ipkg` build script. As a fallback the existing SOURCE_DATE_EPOCH is used or as last resort the current time. The redundant checks for `.git/` and `.svn/` are removed. Signed-off-by: Paul Spooren <mail@aparcar.org>
* build: ipkg-build use fakeroot with PKG_FILE_MODESPaul Spooren2020-08-311-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `ipkg-build` script converts a folder into a `opkg` installable package. Until now it would use root:root for all packages and try to preserve file modes. This has the two drawbacks of packages want to add non-root files or add SUID files, like the `sudo` package does. To give more flexibility regarding file modes and avoid init script hacks, a new variable called `PKG_FILE_MODES`. The variable contains a list of files modes in the format `path:owner:group:mode`. An example for the `sudo` package below: ``` PKG_FILE_MODES:=\ /usr/bin/sudo:root:root:4755 \ /etc/sudoers:root:root:0440 ``` The `ipkg-build` now runs within a fakeroot environment to set any mode and directly store it in the resulting `ipk` package archive. Both options `-o` and `-g` are no longer required due to the introduction of the more flexible `-m` options, which takes the `PKG_FILE_MODES` as input. Lastly the option `-c` is removed as it's unused within the script. Signed-off-by: Paul Spooren <mail@aparcar.org>
* build: reduce number of files passed to ipk-removeEneas U de Queiroz2020-07-111-11/+8
| | | | | | | | | | | | | | | | | | | | Instead of using xargs to pass a huge number of files to script/ipkg-remove, which will usually pick only one, use a more restrictive wildcard so that, currently, at the most 325 files are examined, instead of up to over 2,300. The 325-file package is python, which is picking up python3* ipks. It is about to be removed. Runner-up is ddns-scripts with 7 files. This makes a second run of make package/luci/compile go from real 16.40s; user 17.42s; sys 2.73s to real 10.71s; user 9.51s; sys 1.27s There is a caveat though: if one were to remove the ABI_VERSION of a package that ends in a digit [0-9], then the old package ipk will not be removed from the bin directory by make package/abc2/clean. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
* build: call ipkg-remove using xargs if #args>=512Eneas U de Queiroz2020-07-111-1/+11
| | | | | | | | | | | | | The wildcard call to clean up luci package (luci*) can pick up over 2,300 files when the full tree is built. Running make package/luci/clean or a second run of make package/luci/compile would fail with an 'Argument list too long' error. To avoid that, a maybe_use_xargs function was created that runs the command straight as usual if the number of arguments is < 512, or saves the list in a temporary file and feeds it to xargs otherwise. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
* build: package-ipkg: avoid calling wildcard twiceEneas U de Queiroz2020-07-111-2/+8
| | | | | | | | Instead of calling $(wildcard) to check if the removal list is empty, then calling it again to actually remove the files, define a function so that the arguments are expanded only once when it gets called. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
* buildsystem: add CPE information to ipkg packages and manifest filesFlorian Eckert2020-05-051-0/+1
| | | | | | | | | | | Common Platform Enumeration (CPE) is a structured naming scheme for information technology systems, software, and packages. This information already exists in some makefiles. In order for the information to be processed further, it should also be added to the manifest file and the control file of ipkg packages. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
* base-files: fix build for /sbin/pkg_checkXu Wang2020-01-141-1/+1
| | | | | | | | | | Setting CONFIG_IPK_FILES_CHECKSUMS=y causes sha256 checksum files to be included with the packages to check for corruption. This commit fixes two issues: - /sbin/pkg_check was being removed incorrectly if IPK_FILES_CHECKSUMS=y - checksums were being saved in the wrong file Signed-off-by: Xu Wang <xwang1498@gmx.com>
* build: warn when packages have no associated install sectionJonas Gorski2019-06-251-0/+2
| | | | | | | | | Declaring a package without the appropriate install section is an easy mistake to make, especially when renaming packages. Since this is also easy to detect, warn about it when it happens. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> No-objections-at-all-by: Jo-Philipp Wich <jo@mein.io>
* build: add support to && in DEPENDSEneas U de Queiroz2019-05-311-1/+2
| | | | | | | | | | | | Adds support to && operand in DEPENDS. Also, fixes generation of || dependencies by scripts/package-metadata.pl. The precedence order from higher to lower is && then ||. Use of parentheses to change the order is not supported. As before, they are silently ignored. Use them for readability only. Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com> Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [DMARC removal]
* build: formatting fixes for per-provide ABI_VERSION suffixesJo-Philipp Wich2019-01-241-1/+1
| | | | | | | | | - Filter out potential duplicates with the package name (e.g. when renaming libfoo1 w/ ABI_VERSION:=1 to libfoo) - Use the GetABISuffix macro to properly separate the suffix with a dash in case the basename ends with a number Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* build: extend ABI_VERSION suffixing to providesJo-Philipp Wich2019-01-241-1/+1
| | | | | | | | | When a library package specifies additional provides, e.g. libncurses which provides libncursesw, we should also append the abi version suffix to each provide, since there may be more than one package providing the virtual library. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* build: Optionally provide file checksums in package metadataMichal Hrusecky2019-01-221-0/+9
| | | | | | | This may be useful if you don't entirely trust your flash and want to be able to check for corruptions. Signed-off-by: Michal Hrusecky <Michal@Hrusecky.net>
* build: add ABI_VERSION to binary package namesJo-Philipp Wich2019-01-191-6/+11
| | | | | | | | | | | | | | | | | | | | | | Add the ABI_VERSION source makefile variable to the binary package basename and resolve source dependencies on packages with ABI_VERSION set to such expanded names. If for example a package specifies DEPENDS:=libopenssl while the OpenSSL Makefile specifies ABI_VERSION:=1.0.0, the resulting ipk control data dependency will be "Depends: libopenssl1.0.0" and the libopenssl ipk file will be called "libopenssl1.0.0_<version>_<arch>.ipk". The next time a library such as OpenSSL is updated to an incompatible version, the ABI_VERSION shall be changed accordingly to prevent opkg from simply upgrading to an incompatible library without considering the dependencies of already installed packages. Also introduce another "SourceName" control field which is required by the newly introduced "scritps/ipkg-remove" to determine the proper related .ipk files to delete upon buildroot package clean operations. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* build: fix compile error when a package includes itself in PROVIDESFelix Fietkau2018-07-201-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: allow defining license information per binary packageMichael Heimpold2017-11-251-2/+2
| | | | | | | | | | | At the moment, license information can only be specified on a "per source package" level while other metadata fields (e.g. maintainer) can be given for each binary package. Apply the same logic for license fields as well. This can be used e.g. in cases where a library is distributed under some license while related tools are distributed under a different one. Signed-off-by: Michael Heimpold <mhei@heimpold.de>
* build: ipkg: new field AlternativesYousong Zhou2017-05-021-0/+1
| | | | | | | | | | | It's a list of specs of the following form seprated by commas to describe alternatives provided by this package <prio>:<path>:<altpath> <path> will be a symbolic link to <altpath> of the highest <prio> Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
* build: clean up redundant touching of the package install info fileFelix Fietkau2017-02-261-8/+4
| | | | | | | Instead of using a separate .clean stamp file, remove the install info file on compile, then append the install package list afterwards Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: fix package build after deleting staging dirFelix Fietkau2017-02-091-2/+1
| | | | | | Ensure that the <package>.provides files are always created Signed-off-by: Felix Fietkau <nbd@nbd.name>
* package-ipkg: Do not fail build without base-filesFlorian Fainelli2017-01-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | If the base-files package is not selected, we will fail executing the very first postinst script: make[3]: Leaving directory `/local/users/fainelli/openwrt/trunk' cp -fpR /local/users/fainelli/openwrt/trunk/build_dir/target-arm_xscale_musl-1.1.15_eabi/root-orion /local/users/fainelli/openwrt/trunk/build_dir/target-arm_xscale_musl-1.1.15_eabi/root.orig-orion ./usr/lib/opkg/info/busybox.postinst: line 3: /local/users/fainelli/openwrt/trunk/build_dir/target-arm_xscale_musl-1.1.15_eabi/root-orion/lib/functions.sh: No such file or directory ./usr/lib/opkg/info/busybox.postinst: line 4: default_postinst: command not found postinst script ./usr/lib/opkg/info/busybox.postinst has failed with exit code 127 make[2]: *** [package/install] Error 1 Check for the existence of lib/functions.sh, and if it does not exist, just bail out gracefully. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
* build: fix regression in handling ABI_VERSIONFelix Fietkau2017-01-211-1/+1
| | | | | | | The code was updated without changing $$@ into the proper target filename Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: disable CONFIG_AUTOREMOVE for packages/tools where QUILT is usedFelix Fietkau2017-01-191-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: stage unstripped packages inside PKG_BUILD_DIRFelix Fietkau2017-01-181-9/+13
| | | | | | | | | This makes the build slightly more efficient by avoiding the need to re-stage packages on every full build run. It is also necessary for the upcoming CONFIG_AUTOREMOVE feature Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: write ABI_VERSION file when staging the packageFelix Fietkau2017-01-181-7/+1
| | | | | | | The make target does not rewrite the file if the contents didn't change. This causes make to always consider the target old. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: introduce extra targets that contain only proper dependenciesFelix Fietkau2017-01-181-2/+2
| | | | | | This can be used to check if targets like prepare or compile are up to date Signed-off-by: Felix Fietkau <nbd@nbd.name>
* base-files: add support for overlaying rootfs contentRafał Miłecki2016-12-201-0/+9
| | | | | | | | | This adds support for install-overlay define. When used in package it allows installing files to a special directory that gets copied to the root when installing it. It allows overwriting files provided by other packages. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* build: remove stale .ipk files if package dir changesFelix Fietkau2016-11-081-2/+2
| | | | | | | | | If a package nonshared status is changed, a stale .ipk file might still be present in the old package directory. Remove the .ipk file from all package directories when building a new one (or explicitly running clean) Signed-off-by: Felix Fietkau <nbd@nbd.name>
* include: properly update .install stamp filesJo-Philipp Wich2016-11-021-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now the $(PKG_INSTALL_STAMP) files are only written if a package is selected as <*> but never deleted or emptied if the corresponding package is getting deselected. For ordinary packages this usually is no problem as the package/install recipe performs its own check for enabled packages when assembling the list of install stamp files to consider, but this logic might fail under certain circumstances for packages providing multiple build variants. In case of a multi-variant package, the buildroot first checks if any of the variants is enabled, then resolves all variants of the common source package and finally processes the corresponding .install stamp files of all variants, relying on the assumption that only the selected .install stamp file exists. When an initially selected variant is getting deselected or changed from <*> to <m> and another variant is marked as <*> instead, the .install stamp file of the deselected variant remains unchanged and a second .install stamp file for the newly selected variant is getting created, causing the package/install recipe to pick up two .install stamps with conflicting variants, leading to opkg file clashes. This issue happens for example if package "ip" is set to <m> and package "ip-full" to <*> - the install command will eventually fail with: * check_conflicts_for: The following packages conflict with ip: * check_conflicts_for: ip-full * * opkg_install_cmd: Cannot install package ip. In order to fix the problem, always process the removal requests or the .install stamp files, even for deselected packages but only write the package base name into the stamp file if the corresponding package is marked as builtin. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* include/package-ipkg.mk: use TARGET_PATH_PKG in Package/*/install stepsMatthias Schiffer2016-10-061-0/+2
| | | | | | | Package/*/install was using a different PATH than all other steps like Build/Install, which was confusing and easily led to mistakes. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* package-ipkg: do not include feeds.mk at metadata dump time to speed up scanningFelix Fietkau2016-06-161-1/+3
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* package-ipkg.mk: fix Provides for packages with multiple PROVIDES entriesMatthias Schiffer2016-06-161-1/+1
| | | | Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* include: remove unused FeedPackageDir macro argumentsJo-Philipp Wich2016-04-221-1/+1
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* include: choose package output directory based on repository infoJo-Philipp Wich2016-04-061-1/+1
| | | | | | | | | | | Use the new repository metadata field to choose the output directory of the final package archives. Non-sharable packages will be placed in the per-target package directory while the rest will be placed in a per-repository sub directory within the $OUTPUT_DIR/packages/$CPU_TYPE/ prefix. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* package-ipkg.mk: fix typo (patch from #19540)Felix Fietkau2015-04-231-1/+1
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 45568