- Fix parsing when keywords are immediately followed by newlines.
- Strip any leading/trailing commas and whitespace from the values
(which are comma-separated lists).
- If a keyword is present but has no value, do not return the empty
string.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Support archive files that don't include a top-level directory by making
one up. Also quit using %setup for archives since it causes interesting
side effects in %build that aren't really applicable for archives.
Also make the subpackage depend on the parent package. This should close
the loop between top-level Requires on perl() virtuals and Provides on
perl() virtuals in the subpackage.
Because implicit requires of '/usr/bin/perl' exist for many packages,
perl-bin will be installed as a build dependency, but not the perl
package's modules; the modules currently live in the base package, and
-bin does not require that package.
The easiest solution for now is to ship the modules in -data, since -bin
requires -data. So, add a files pattern to ship all content matching
/usr/lib/perl5 in -data.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Autospec currently doesn't handle /etc/, /opt/, /usr/etc/, /usr/local/
or /usr/src/ content paths so explicity warn and then fail when
content in these paths are detected.
This handles looking at logs failing when asking for LIBUV (e.g: cmake:
-- Could NOT find LIBUV (missing: LIBUV_LIBRARIES LIBUV_INCLUDE_DIR)
)
Signed-off-by: Simental Magana, Marcos <marcos.simental.magana@intel.com>
A change for multi-version support, specifically to ensure that all
versions are scanned for licenses, broke the procedure that detects
whether to re-execute autoconf when patches affect input files. This
shifts the license scanning change into a more specific location to
leave the original autoconf scanning intact.
When scanning available patches, if any are cve-related, we set the
security_sensitive parameter in options.conf. Since we now scan for
patches in potentially several series files, use a flag to track whether
to update the parameter and only write it once, after scanning all the
patches.
Instead of creating a long, complex name for license files, just name
them by their SHA1 hash and store them in a package-level directory
(/usr/share/package-licenses/<package>/
This will eliminate redundant license files within an individual
package.
This change also tweaks the license file search to ensure that we pick
up files from all source versions.
If we build multiple versions, we'll potentially enter %install while in
a different dir than the license file(s) we already found. Use the
absolute path instead. This resolves the case where we fail to install a
license file because it came from a different version of the source than
the one we built last.
Also, when trimming the build dir off the front of the path to the
license file, be careful to always trim off only leading slashes, not
just blindly the first character, as we don't force subdir to *not* have
a trailing slash itself. This prevents a case where we fail to copy the
license because we ate the first character of its relative path.
If we try to use a source file (zip or jar) that doesn't have a
first-level common prefix directory in it, we have to make one up and
create a build subdirectory. We need to remember what that directory is.
In subsequent autospec rounds, however, we need to remember whether we
made up that prefix, so we can do it again (%setup -c). This change
adds another list to keep track of all of the build directories,
separate from the list of *detected* prefixes.
For version-specific patch series files, e.g. series.1.7, make sure to
'git add' them if the version exists in this build, or 'git rm' if it no
longer does.
For builds supporting multi-version (maven, ant, gradle), move
build_append and build_prepend into the version loops, so the contents
will be added per version, inside each version's respective build
directory.
For gradle, this also means moving build_append inside the optional
subdir.
For gradle packages, instead of installing everything in
/usr/share/java/<package>, only install the lib subdirectory. If more
contents are actually needed, rely in install_append to handle those.
Just like for regular patches, if we find a CVE patch in
version-specific series files, enable security_sensitive.
This adds some inefficiency in that we'll potentially rewrite
options.conf multiple times unnecessarily.
Process all the series.<ver> files, adding Patch: fields for their
patches (duplicates ok, will not be merged).
Captures any prefixes we've generated for build dirs.
Enters each build dir and adds the appropriate %patch directives.
Patches from the top-level series file will be applied to the default
version. Patches from a version-specific series file matching that
version will be applied afterward.
Still need to notice and flag any CVE patches.
Make sure we only parse the file once -- have to cache the parsed
result.
We'll keep that result by itself, but other tasks (e.g.
tarball.process()) will result in adding to the global versions list, so
we need to make sure we don't overwrite it. Instead, we'll merge the
parsed list into the global versions list.
Detect and report extraneous fields in versions file
Remove extra check for header lines in zip file info after we've already
removed the header
Only consider directory names when looking for common prefix, which
would affect us if we had a zip file with only a single file.
This introduces a lot of similar, but not quite duplicate, code.
Definitely a candidate for future refactoring.
Passes the flags to %setup to:
1) *not* re-unpack the default (SOURCE0) archive
2) create the directory if the archive doesn't have a top-level prefix
3) unpack the indexed source
4) Use the provided directory name (either the detected prefix, or if
none, the basename of the archive file
This should handle extra versions in the order they're defined in the
versions file.
Don't incur the multi-version support if there's only a single version
listed in the versions file -- otherwise we could end up adding a
version when we meant to simply upgrade a package.
versions file previously only contained a newline-separated list of
version numbers. Now each version can optionally be followed by an
arbitrary amount of whitespace, followed by a URL for the source archive
for that version. The file will be written back out in the same order,
but whitespace between the version field and URL field, if any, will be
a single tab character.
When a source package/zip/tarball doesn't have a top-level directory,
make one up based on the package name and version, and use the -c
argument to %setup to make rpmbuild create the dir and extract into it.
This comes into play in two places -- the initial scan by autospec in a
tmpdir for license files and build patterns, and later by rpmbuild.
Starting point to handle building multiple versions of a package in a
single package. Reads new 'sources' file to map version numbers to
source URLs, to *supplement* $URL in Makefile.
Significant rewrite, trying to make it more robust and dependable.
More reliably parses the output from unzip -l.
Looks for the longest common directory prefix of all files in the zip.
If it doesn't find that, picks the zip file's basename as the prefix,
and extends the extract_cmd to create and unpack into that subdir.
Adding a if/else statement to avoid duplicity when reading version or
goupId tags (i.e. 3.2.03.2.0) from pom files.
Signed-off-by: Athenas Jimenez <athenas.jimenez.gonzalez@intel.com>
This field's purpose is to classify a package according to a "domain",
useful for tooling that wraps autospec to operate on any/all packages
that belong to the domain.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Adding the resolution for "parent" or "pom" artifacts when a
corresponding jar doesn't exists.
Signed-off-by: Athenas Jimenez <athenas.jimenez.gonzalez@intel.com>
make_prepend is implemented a bit differently and is actually just
handled as part of write_make_line. Probably should be updated at some
point but for now just remove the function calls to a non-existent
function.
A few options available to configure the flags and optimization are missing from
the documentation (README.rst). This patch adds them.
Also fix a typo in the code
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Turns out there's a difference between build_append and install_prepend:
since they run from different shell scripts, environment variables set
at the beginning of %build will not be set in the snippets added by
install_prepend. Notably, that includes CFLAGS and SOURCE_DATE_EPOCH.
Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
This adds the capacity for autospec to autopackage nginx dynamic modules
out of tree using the out-of-tree headers and build files that nginx-mainline
has. This will make it easy to package a large ecosystem of nginx modules
automatically.
Change the matching for "Could not find ..." to produce a virtual mvn()
dependency with version, instead of generating a mvn-* package name.
This should be more accurate now, taking advantage of the new virtual
provides.
Resolves mistakenly matching this line:
Could not resolve all files for configuration ':buildSrc:runtimeClasspath'.
to generate virtual dependency:
mvn(all files for configuration ':buildSrc:jar) = runtimeClasspath
It's unclear how dependable "build" and "install" are as gradle goals,
so don't force their use. Packager will need to specify them manually
in make_args and make_install_args.