summaryrefslogtreecommitdiff
path: root/scripts/makepkg.sh.in
Commit message (Collapse)AuthorAge
* makepkg: create source package inside fakerootAllan McRae2011-06-15
| | | | | | | | | | Create source package files inside the fakeroot environment to ensure reasonable ownership of files within the archive. Fixes FS#24330. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: move option parsing code to separate fileAllan McRae2011-06-15
| | | | | | | | | | | | This move the getopt replacement function parse_options out of makepkg.sh.in and into a separate file. The code is inserted into the relevant place in makepkg using m4. This will allow the reuse of the option parsing code in other scripts (i.e. pacman-key) while avoiding code duplication. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: reword purge messageAllan McRae2011-06-15
| | | | | | | | Clarfiy that it is unwanted files are being removed rather than "other" files (whatever they are...). Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge remote-tracking branch 'florian/sodeps'Dan McGee2011-06-14
|\
| * makepkg: add libdepends supportFlorian Pritz2011-06-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The user adds libaries to the depends array without a version. These must end with .so. Example: depends=(glibc libc.so) find_libdepends() looks for ELF files (not symlinks because these could point outside of pkgdir) in $pkgdir, extracts the library sonames the binary links to and outputs depends seperated by spaces. This list contains all libraries needed by the package. Example: libfoo.so=3-64 write_pkginfo() only keeps .so depends with version information and warns the user about unneded ones. Support-by: Thomas Bächler <thomas@archlinux.org> Support-by: Christoph Schied <Christoph.Schied@uni-ulm.de> Signed-off-by: Florian Pritz <bluewind@server-speed.net>
| * makepkg: add libprovides supportFlorian Pritz2011-05-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The user adds libaries to the provides array without a version. These must end with .so. Example: provides=(readline libreadline.so) find_libprovides() looks for .so files (not symlinks because these could point outside of pkgdir) in $pkgdir, extracts the library soname (ld links the binary to this name) and outputs provides seperated by spaces. This list contains all libraries provided by the package. Example: libfoo.so=3-64 write_pkginfo() only keeps .so provides with version information and warns the user about unneded ones. Support-by: Thomas Bächler <thomas@archlinux.org> Support-by: Christoph Schied <Christoph.Schied@uni-ulm.de> Signed-off-by: Florian Pritz <bluewind@server-speed.net>
* | Merge branch 'maint'Dan McGee2011-06-07
|\ \ | |/ |/| | | | | Conflicts: lib/libalpm/add.c
| * makepkg: fix creation of source package with -pAllan McRae2011-06-07
| | | | | | | | | | | | | | | | | | When creating a source package using an non-local buildscript via the -p option, the inclusion of changelog and install files would fail. Fixes FS#24567. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2011-05-04
|\|
| * makepkg: quote variable that may contain spacesAllan McRae2011-05-02
| | | | | | | | | | | | | | | | Prevents failures when $PKGDEST contains spaces (FS#24002) Patch-by: Sebastien Duthil Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg, pacman-key: unify help message with other scriptsIvan Kanakarakis2011-04-21
| | | | | | | | | | | | | | | | The help message changed to match the one rankmirrors script has. It's clearer as to what the --help switch does. Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Add configure option to specify package signing keyAllan McRae2011-04-20
| | | | | | | | | | | | | | | | | | Add the "GPGKEY" option to makepkg.conf for specifying signing packages with the non-default key from the keyring. Is overridded by makepkg's --key option. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2011-04-15
|\| | | | | | | | | | | | | | | Conflicts: lib/libalpm/alpm.h lib/libalpm/trans.c Signed-off-by: Dan McGee <dan@archlinux.org>
| * makepkg.sh.in: fix a GNU-ism in su invocationRémy Oudompheng2011-04-13
| | | | | | | | | | | | | | | | | | | | | | | | GNU su supports the -c option to specify a command to execute. However, other flavours of su may have a different interpretation of the '-c' flag (e.g. FreeBSD and OpenBSD). The behaviour is correct when '-c' follows an explicit username. Signed-off-by: Rémy Oudompheng <remy@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2011-04-05
|\| | | | | | | | | | | | | Conflicts: lib/libalpm/be_sync.c lib/libalpm/db.c src/pacman/util.c
| * makepkg: fix a GNU-ism in awk usageRémy Oudompheng2011-04-04
| | | | | | | | | | | | | | | | | | | | A non-GNU version of awk may not support the (|...) syntax for an optional group and require '()' to match an empty string. The (...)? syntax is more appropriate for this usage. Signed-off-by: Rémy Oudompheng <remy@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
| * makepkg: improve parsing for sanity checksAllan McRae2011-04-04
| | | | | | | | | | | | | | | | | | Trailing backslahses can lead to additional spaces at the front of extracted entries. See FS#23524. Strip these while parsing the PKGBUILD entries. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
| * makepkg: remove unnecessary tr usageAllan McRae2011-03-30
| | | | | | | | | | | | | | | | The use of "tr" only leads to trouble. Remove unnecessary usage of it from within makepkg. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
| * makepkg: avoid usage of tr to sidestep locale issuesDave Reisner2011-03-30
| | | | | | | | | | | | | | | | | | to quote dan: "turkish will FUCK YOU UP. this is not the first or the last time" Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: command line options for signing packagesDenis A. Altoé Falqueto2011-03-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Three new command line options were added: --sign: forces the generation of a signature for the resulting package, taking precedence over the value in makepkg.conf --nosign: do not sign the resulting package --key <key>: use a different key than the user's default for signing the package. A check is performed to ensure the user has (provided) a valid gpg key for signing. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: allow PKGEXT and SRCEXT to be overridden by env variablesRay Kohler2011-03-27
| | | | | | | | | | | | Signed-off-by: Ray Kohler <ataraxia937@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Rely on the return value of type instead of its outputDave Reisner2011-03-27
| | | | | | | | | | Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2011-03-24
|\|
| * Make log redirection sanerJan Steffens2011-03-24
| | | | | | | | | | | | | | | | | | My main motivation was to remove the "sync", which can stall for minutes on a busy machine (FS#23378). I also cleaned up the redirection. Signed-off-by: Jan Steffens <jan.steffens@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | makepkg: place signature symlink in build dirAllan McRae2011-03-22
| | | | | | | | | | | | | | Be consistent in package and signature placements when using PKGDEST. Signed-off-by: Allan McRae <allan@archlinux.org>
* | makepkg: allow signatures to work with split packagesDan McGee2011-03-22
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | Add GPG signature support to makepkgGeoffroy Carrier2011-03-22
|/ | | | | | | | | This is a rather simple patch to add signing support to makepkg. Add a create_signature() to makepkg, add a 'sign' BUILDENV option in makepkg.conf, and document the changes in the makepkg.conf manpage. Signed-off-by: Geoffroy Carrier <geoffroy.carrier@koon.fr> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: Improve optdepends extractionAllan McRae2011-03-20
| | | | | | | | | | Prevents issues where optdepends descriptions contain a bracket. Also, strip all comments from arrays before joining them. Fixes FS#23307. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix some easy to find double translationsDan McGee2011-02-28
| | | | | | | | A lot of these were places that should have used the same message but didn't, or were very easy to convert to using the same message and letting some of the burden off of the translators. Signed-off-by: Dan McGee <dan@archlinux.org>
* Ensure pkgbase/epoch are defined before doing anythingDan McGee2011-02-11
| | | | | | | | | When generating integrity sums, we could get some weird output before due to epoch being uninitialized: /usr/bin/makepkg: line 234: [[: 2.6.37: syntax error: invalid arithmetic operator (error token is ".6.37") Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: more bash-3.2 compatibilityAllan McRae2011-02-06
| | | | | | | | Adding the "|| true" to the subshell prevents bash-3.2 setting off the error_trap but requires changing the if statement. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: initialize local arrays to emptyAllan McRae2011-02-02
| | | | | | | | Fixes bash-3.2 compatibility. Thanks-to: Dave Reisner <d@falconindy.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: error on invalid optdependsAllan McRae2011-02-02
| | | | | | | Missed in commit a88cb03a. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: make SRCPKGDEST default to $startdirCedric Staniewski2011-02-02
| | | | | | | | | The current behaviour, which is placing source packages in PKGDEST if SRCPKGDEST is not set, is inconsistent with {SRC,PKG}DEST handling and there is no real advantage in doing so. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: Fix the check for references to srcdir/pkgdirNezmer2011-02-02
| | | | | | | | | | | | | | | | | At least in FreeBSD, find always returns 0 if it finds stuff (imagine that). It doesn't care about the exit status of whatever is passed to -exec. This patch makes the checks compatible with this behaviour. Using xargs and not using grep directly because packages with too many files would cause grep to complain about argument list being too long. This should also fix the false positive in packages with no files. Signed-off-by: Nezmer <git@nezmer.info> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: fix indention to follow style guideCedric Staniewski2011-02-01
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: encode epoch in version specifier if > 0Dan McGee2011-01-22
| | | | | | | | | | | This makes things consistent with everywhere else we are incorporating the new optional epoch field. Add a helper function that forms the version string for you and use it in makepkg where I found 'pkgver.*-.*pkgrel'. This exposes a few shortcomings in a previous "Override pkgver" patch (2020e629) in the install package and check if built functions. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove epoch as an independent fieldDan McGee2011-01-21
| | | | | | | | | | | | | | Instead, go the same route we have always taken with version-release in libalpm and treat it all as one piece of information. Makepkg is the only script that knows about epoch as a distinct value; from there on out we will parse out the components as necessary. This makes the code a lot simpler as far as epoch handling goes. The downside here is that we are tossing some compatibility to the wind; packages using force will have to be rebuilt with an incremented epoch to keep their special status. Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: perform all sanity checks before erroring outDan McGee2011-01-14
| | | | | | | | | | | | It is pretty annoying to get one, fix it, and then get another. We should be able to continue on through most of the sanity checks in one go so the user gets all the error messages at once. Also ensure $pkgbase is defined by the time we call this function; previously we printed nothing where a package name should have been due to this oversight. Signed-off-by: Dan McGee <dan@archlinux.org>
* Update copyright years for 2011Allan McRae2011-01-07
| | | | | Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: add option to clear buildflagsAllan McRae2010-12-29
| | | | | | | | | | Add the "buildflags" option, which is useful in its negative form for disabling CFLAGS, CXXFLAGS and LDFLAGS when building a package. This is useful when determining of one of these flags is causing an issue with a package. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: Add check() function for running test suitesAllan McRae2010-12-29
| | | | | | | | | | | | | | A PKGBUILD can have an option check() function for running test suites between the build() and package() stages. This function is run by default but can be disabled globally in with "!check" in BUILDENV in makepkg.conf. This setting can be controlled on an individual package basis using makepkg's --check and --nocheck flags. Addition dependencies needed for running the test suite can be specified in the checkdepends array and are only checked when running the check() function. Original-work-by: Jeff C <jeff@kcaccess.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: escape closing bash array paren for awkDave Reisner2010-12-29
| | | | | | | | | | | The closing parenthesis of bash arrays needs to be escaped in the ending address of awk expressions in order to play nicely with implementations of awk other than gawk. This change provides compatibility with gawk, nawk and mawk. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: allow pkgname usage in split package functionsAllan McRae2010-12-29
| | | | | | | | | | | | Currently, using $pkgname in a split package package_*() function always returns the first value in the pkgname array rather than the name of tha package being packaged. Fix this so $pkgname gives the expected value. Fixes FS#22174 Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: remove last inappropriate PKGBUILD usageAllan McRae2010-12-20
| | | | | | | | We should always use $BUILDSCRIPT instead of PKGBUILD. The only remaining uses of PKGBUILD in makekg are in comments. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: perform sanity checks on variables in package functionsAllan McRae2010-12-12
| | | | | | | Check the over-ridden entries for provides, backup, optdepends and options for illegal entries. Partially fixes FS#16004. Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: remove dead code from handle_depsAndres P2010-12-12
| | | | | | | | | | The error message that has been removed never gets to print because, given the same condition, handle_deps throws the same error and then immediately exits makepkg. Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: do not ignore errors from pacman when checking depsAndres P2010-12-12
| | | | | | | | | | | | As check_deps is run in a subshell, exit had the same meaning as return. Since the intention is to halt makepkg when pacman throws an error other than 127, the enclosing function has to handle error control instead. Fixes FS#19840 Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: use portable escape sequence for terminal escapesCarlos Diaz2010-12-12
| | | | | | | | | | | | The escape string isn't necesarily \033; it's determined by what the particular termcap/info entry for that terminal contains. Bash uses ncurses functions to expand \e to the _correct_ terminal escape. Signed-off-by: Carlos Diaz <839273@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Add epoch verification to makepkgDan McGee2010-10-13
| | | | | | If defined, it must be an integer. Signed-off-by: Dan McGee <dan@archlinux.org>