Commit Graph

598 Commits

Author SHA1 Message Date
Allan McRae 1b08e26846 makepkg: fix typo for distcc test
Introduced in commit 9dd42dc0.  Fixes FS#35741.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-06-16 16:33:39 +10:00
Allan McRae fe794ccb25 Restrict pkgname from starting with a dot.
Adding this restriction means we can filter any FILENAME entry from
starting with a "/" or a ".".  Use the term "dot" as it is more
computing relevant compared to "full stop" or "period" which vary
depending on English locale.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-06-04 13:38:48 +10:00
Allan McRae 8335e169a6 makepkg: Use LOGDEST for logpipe
If LOGDEST is set, we may not check that $startdir is writable. Store
the log pipe in LOGDEST instead.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-05-18 23:14:21 +10:00
Dave Reisner 72c6d19d64 makepkg: fixup broken revision and repo references
bzr support "worked", but didn't handle any of the actual features we
wanted with makepkg. This moves the revision specification to the proper
place (extraction, rather than download), and fixes an additional broken
reference to $repo which was never set.

Fixes FS#35281.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-05-18 10:42:30 +10:00
Eric Bélanger 91b9ea922a Add -V/--version option to makepkg's usage function and man page
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-04-30 21:01:38 +10:00
Dave Reisner c5a4b35528 makepkg: avoid redirecting stdout
If stdout is already redirected, redirecting stderr to stdout can lead
to undesirable results.

Fixes FS#34974.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-04-28 23:11:37 +10:00
Allan McRae 695f0e443e makepkg: fix svn repo extraction
Copy SVN repos rather than using "svn export" to keep all anotation
files in the repo for build scripts that use (e.g.) "svin info".

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-04-12 09:42:43 +10:00
Allan McRae 7e0f528274 Do not use checkout directory for SVN config
Using the checkout directory for the SVN config can result in clashes
between config files and files from the SVN checkout.  Instead, use
a ".makepkg" directory within the checkout.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-04-12 09:42:41 +10:00
Maxime Gauduin 2bf2700b74 Add support for all bzr URLs in the PKGBUILD source array
Add support for all bzr URLs, including "lp:" URLs, in the source array.
This, however, requires an internet connection and will fall back to the
current behavior for offline builds. In that case, only the URL reported
by 'bzr config parent_location' run inside the local repo can be used,
and is outputted.

Signed-off-by: Maxime Gauduin <alucryd@gmail.com>
2013-04-11 10:56:50 +10:00
William Giokas b7c994db8b makepkg: don't run remove_deps twice when unneeded
remove_deps already has a check and won't run unless -r is specified, so
if this was meant to remove dependencies of a failure no matter what,
then it's not doing it, and with -r it is run twice on a failure for no
real reason.

Signed-off-by: William Giokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-04-11 10:53:52 +10:00
Daniel Wallace 8d3ee29809 remove continue from download_local
Bug exposed by a6291858cc

popd doesn't run in the for loop in download_sources() if the continue
in download_files is executed. Causing the extract_files to extract
everything into $SRCDEST instead of $srcdir

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-04-01 15:53:12 +10:00
Andrew Gregory 950443a438 makepkg: unset GREP_OPTIONS
grep allows options to be set from the environment with GREP_OPTIONS.
Many of these options will alter grep's output, breaking makepkg.
GREP_OPTIONS=--line-number breaks installed dependency removal, for
instance.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-31 11:08:54 +10:00
Allan McRae a6291858cc Ensure we are always in $SRCDEST before downloading
When VCS sources were updated, we changed into their root directory.
Any following source was then downloaded to an incorrect place causing
a failure in makepkg.  Ensure we are always in the $SRCDEST directory
before starting any download.

Fixes FS#34488.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-30 09:06:12 +10:00
Allan McRae 6e2c15099a Remove duplicate option
The "skippgpcheck" option was specified twice.  Also, fix alphabetical
ordering.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-26 15:55:51 +10:00
Allan McRae 0ba9b262ab Revert "makepkg: Use a recursive git clone."
This reverts commit 8b03b1a877.

It is much better to download the submodules using separate source entries
and adjust the submodule configs to point at these versions in the
prepare() function.

See https://mailman.archlinux.org/pipermail/pacman-dev/2013-March/016771.html
for an example.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-14 11:47:12 +10:00
Olivier Brunel 2259dff7f3 makepkg: Add --verifysource to only download/verify source files
Because --noextract also implies to not download/verify source files, it wasn't
possible to simply do that, without either extracting and/or building.
(Note: --verifysource takes precedence over --noextract)

Signed-off-by: Olivier Brunel <i.am.jack.mail@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-10 09:01:56 +10:00
Neer Sighted 93fa63ee8a makepkg: Make VCS download functions use get_filename
Make all VCS download functions uses get_filename to get the repo name.
In addition, creating a working directory from a Bazaar repository now shows
the short-name of the repository, not the full path on disk.

I'm not sure if the name of the variable that holds the basename of the local
clone should still be `repo`, but I have left the variable name for simplicity.

Signed-off-by: Neer Sighted <neersighted@myopera.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-10 09:01:56 +10:00
William Giokas fcdaa46b65 makepkg: Separate vcs download and extract
Previously makepkg would clone vcs sources in the download function,
regardless of the noextract settings. Now the download_* functions only
download or update the vcs sources, and the new extract_* functions just
create working copies using the specified protocols. The extract_sources
function will call the needed extract function for the protocol
specified. The tarball extraction has also been moved into its own
extract_file function to keep things consistent.

Signed-off-by: William Giokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-10 09:01:56 +10:00
Neer Sighted 8b03b1a877 makepkg: Use a recursive git clone.
Make makepkg use a recursive clone when creating the working directory.
This will initialize submodules

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-07 15:38:48 +10:00
Sébastien Luttringer 6831a5f4b1 makepkg: Avoid find to fork for each rm call
Reported-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-07 15:38:48 +10:00
Sébastien Luttringer a03f5f55cd Add staticlibs option in PKGBUILD
This option helps to removes static library files in packages.

Related to the thread:
https://mailman.archlinux.org/pipermail/arch-dev-public/2013-March/024552.html

Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-07 15:38:48 +10:00
Dave Reisner 0a5b79e133 makepkg: add support for .pkg.tar.lzo
Supported by libarchive as of version 3.1.0 when compiled against lzo2
or in the presence of the lzop binary.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-02-16 11:06:43 +10:00
William Giokas 42b492b2fd makepkg: fix -r and --needed conflict
In makepkg, passing -sr --needed causes there to be a conflict when
pacman goes to remove the dependencies, as the --needed flag is not an
option for pacman -R. This patch makes --needed not get added to the
PACMAN_OPTS array, but it acts like ASDEPS, and is only added to an
install function.

Signed-off-by: William Giokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-02-13 11:50:33 +10:00
Allan McRae 572b1a5de7 makepkg: add lrzip compression support
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-02-13 11:50:32 +10:00
Allan McRae f170a94c13 makepkg: make $pkgdir non-accessible during build()
The idea of having separate build() and package() functions is that
build() is run as a normal uses and package() as (fake)root.  Any
files placed in $pkgdir during build() can have the wrong permissions.

Restrict access to $pkgdir during build() - unless there is no package()
function.

Also, set $pkgdir to something "useful" during build().  For split
packages, this uses "<path>/pkg/$pkgbase" because it is not obvious
which $pkgdir is being referred to.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-02-07 10:48:11 +10:00
Chirantan Ekbote 266b3dd706 makepkg: Integrate check_install into tidy_install
Rearrange tidy_install so we first remove docs, unwanted files,
libtool files, and empty directories.  Then check for missing backup
files and references to $srcdir and $pkgdir.  Finally compress manpages,
strip debug symbols, and compress executables with upx.

Fixes FS33318

Signed-off-by: Chirantan Ekbote <chirantan.ekbote@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-29 13:37:25 +10:00
William Giokas b27886ab59 makepkg: Formatting consistency in write_pkginfo
The difference between the echo and the printf's in write_pkginfo seemed
to be somewhat sporadic. Also, the INFAKEROOT check was doing the same
exact thing as the SPLITPKG check, but formatted much differently and
consuming two extra lines. I think this makes it more readable than it
was previously, if nothing else.

Signed-off-by: William Giokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-17 22:32:54 +10:00
William Giokas fe0586e240 makepkg: Print out full version on pkgver update
When building sources with a pkgver function, makepkg will print out the
original version before pkgver() is run, claiming that that is the
package that will be built. This patch simply re-prints the output
later, after pkgver() has been run so people can see which package they
are actually building.

Signed-off-by: William Giokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03 12:03:10 +10:00
Allan McRae 241d6b884a makepkg: use --apparent-size when du supports it
Amazingly, using "sleep 1" to convince btrfs to report correct file
sizes is only a 90% fix.  Sometimes more sleep is needed.

Instead we use the --apparent-size argument to du to get actual file
sizes. This is used only on Linux as the various BSDs do not support
this argument.

Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03 12:03:10 +10:00
Allan McRae 1dd3405813 Update copyright year for 2013
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03 12:03:09 +10:00
Allan McRae ad3a26c615 makepkg: add mtree file into package
Add an mtree file to the package with all file information. This
can be added to the local pacman database on install allowing full
package verification.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14 13:45:12 +10:00
William Giokas 0c74ffd6b6 Added LOGDEST variable
Places logs in a pre-defined location. The logs are always neatly
labeled with package names and numbers, and this way can be more easily
sent to network shares as they are written or compressed/cleaned en
masse.

Signed-off-by: William Giokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14 12:35:34 +10:00
Dave Reisner c8417f3386 makepkg: normalize whitespace in $pkgdesc when writing .PKGINFO
Specifically, we shouldn't allow newlines in the pkgdesc field, as
pacman will ignore the continuation and end the description prematurely
as written to the local DB. Normalize ALL whitespace, replacing it with
single whitespace characters.

Fixes strange errors as seen by FS#32852.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-12-14 12:35:34 +10:00
Allan McRae 254329f6fb makepkg: install debug symbol packages if requested
When using "makepkg -i", install the debugging symbol packages too
if present.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae dbbe3e7cb4 makepkg: assign debugging symbol directory to a variable
Simplifies the stripping of files a lot.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae 13667fd4b1 makepkg: allow debug package suffix to be configurable
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae 7e8d9dfda2 makepkg: create package from stripped debug symbols
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae a5e81f5599 makepkg: output the name of the package being created
Although it should be currently quite obvious what package is being
created when "Creating package..." is printed, it will not be in the
future when a debug package is potentially created too.  Also, given
$pkgname is always correctly set when split packaging now, we no
longer need to pass that around.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae bd4ff4a377 makepkg: strip debugging symbols into separate folder
When using the "debug" option in combination with "strip", move the
debugging symbols into a separate directory ($pkgdir-debug/usr/lib/debug)
suitable for creating a package from.

Create hardlinks between debugging symbols of hardlinked files and add
symlinks in the .build_id directory if the binary has a build ID.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae a53fd79632 makepkg: always use pkg/$pkgname as $pkgdir
Unify split and single packages to always use a folder within pkg/
as thier $pkgdir.  This will allow a folder for storing a package with
stripped debug symbols to be added within pkg/ too.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae 6be96e7612 makepkg: move debug symbol stripping to separate function
Move stripping of files to a spearate function that will be expanded
for the handling of creating debug symbol packages.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae 6c22ef2c82 makepkg: add option to include debugging compiler flags
Add a "debug" option that appends the compiler flags specified in the
variables DEBUG_CFLAGS and DEBUG_CXXFLAGS in makepkg.conf to their
counterpart buildflags.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae 7199fb3b1a makepkg: always run tidy_install on repackaging
When using "makepkg -R" without a packge function, we should still
run tidy_install as the user might have added other packaging options
such as (e.g.) '!emptydir' to remove empty directories on repackaging.
Of course we can not revert some options when repackaging without a
package function.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
wgiokas 6b1deedf15 Add --needed option to makepkg
Simply add the option to pass the --needed flag to pacman when using -i
with makepkg. When using makepkg in scripts, particularly for git
packages with the new version functions and not just a date, this can
save disk io and time instead of reinstalling.

This would mostly be useful with the --noconfirm option.

Signed-off-by: wgiokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Jason St. John 3536975bbf Use sentence case in makepkg
Most of makepkg already uses sentence case. This cleans up the last few
stragglers.

Signed-off-by: Jason St. John <jstjohn@purdue.edu>
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae 3531533c2f makepkg: save path to PACMAN and test availability
After we install dependencies, we source /etc/profile so that new
elements get added to the path. As this can override any local setting
of PATH, we store the full path of the PACMAN variable passed to makepkg.

Also, add a check for PACMAN availability if it is needed to deal with any
dependency operations.

Reported-by: Martin Panter <vadmium à gmail·com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Martin Panter 86233476b0 Remove last traces of handling command arguments in $PACMAN
This resolves an inconsistency with how the $PACMAN variable was interpreted.
Previously “makepkg” would extract the first word from the $PACMAN variable
and check that it existed as a command. This appears to have been happening
ever since the variable was implemented in revision 66c6d28 (makepkg: allow
to specify an alternative pacman command). Thus it looks like command
arguments were originally allowed in the variable.

However the run_pacman() function now quotes $PACMAN, so the whole variable
has to be just the command name. This quoting was introduced more recently,
perhaps in revision 622326b (makepkg: fix sudo/su calling of pacman).

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Christian Hesse 0285c678ab makepkg: fix signing built package
Fixes issue introduced in 9dd42dc0

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae 3232c975c6 makepkg: deprecate PKGBUILDs without a package() function
The package() function has been around since pacman-3.3 and has
significant advantages including limited fakeroot usage and correct
repackaging.  The ability to use PKGBUILDs without a package function
will be removed in a future release.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00
Allan McRae 93148d0879 makepkg: print "SKIP" for signature checksums
There are valid reasons for a source files PGP signature to be changed
(expired key, expired signature, additional person signing...). Thus
providing a checksum for signature files can potentially cause a
PKGBUILD to require unnecessary updating.

Avoid this issue by using "SKIP" for the signature checksum.
Fixes FS#31590.

Signed-off-by: Allan McRae <allan@archlinux.org>
2012-11-27 15:16:15 +10:00