Skip to content

Commit 88e6154

Browse files
committed
Improve RPM plugin
- Add doc with dependency requirements - Build as a static executable - Add support for zstd and replace OpenSSL by libgcrypt Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent 5088f70 commit 88e6154

7 files changed

Lines changed: 48 additions & 31 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
11
A ScanCode Toolkit plugin to provide pre-built binary libraries and utilities
22
and their locations. This is for the RPM command which is built from sources
33
with the support for many rpmdb formats.
4+
5+
6+
This is built on Debian/Ubuntu with these dependencies::
7+
8+
$ sudo apt-get install -y \
9+
libsqlite3-dev \
10+
libgcrypt20-dev \
11+
libbz2-dev \
12+
liblzma-dev \
13+
libpopt-dev \
14+
libzstd1-dev
15+
16+
These are the runtime dependencies::
17+
18+
$ sudo apt-get install -y \
19+
libsqlite3-0 \
20+
libgcrypt20 \
21+
libbz2-1.0 \
22+
liblzma5 \
23+
libpopt0 \
24+
libzstd1

builtins/rpm_inspector_rpm/build.sh

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,22 @@ cd $base_name/
2121
echo Configure RPM
2222
./autogen.sh \
2323
--enable-static \
24+
--enable-shared=no \
2425
--disable-openmp \
2526
--enable-bdb=no \
2627
--enable-bdb-ro=yes \
2728
--enable-ndb \
2829
--enable-sqlite=yes \
30+
--enable-zstd=yes \
2931
--disable-plugins \
3032
--without-lua \
31-
--with-crypto=openssl
33+
--with-crypto=libgcrypt \
34+
--disable-rpath
3235

3336
echo Build RPM
3437
make
35-
cp .libs/rpm ../../src/rpm_inspector_rpm/bin/
36-
cp .libs/rpmdb ../../src/rpm_inspector_rpm/bin/
37-
cp lib/.libs/librpm.so.$so_version ../../src/rpm_inspector_rpm/bin/librpm.so.9
38-
cp rpmio/.libs/librpmio.so.$so_version ../../src/rpm_inspector_rpm/bin/librpmio.so.9
39-
strip \
40-
../../src/rpm_inspector_rpm/bin/librpmio.so.9 \
41-
../../src/rpm_inspector_rpm/bin/librpm.so.9 \
42-
../../src/rpm_inspector_rpm/bin/rpm \
43-
../../src/rpm_inspector_rpm/bin/rpmdb
38+
strip rpm
39+
cp rpm ../../src/rpm_inspector_rpm/bin/
4440
cd ..
4541
echo Done building RPM
4642

builtins/rpm_inspector_rpm/setup.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616

1717

1818
desc = (
19-
'A ScanCode path provider plugin to provide a prebuilt native rpm '
20-
'binary built with many rpmdb formats support. rpm binaries are is built '
21-
'from sources that are bundled in the repo and sdist.'
19+
"A ScanCode path provider plugin to provide a prebuilt native rpm "
20+
"binary built with many rpm backend database formats supported. The rpm "
21+
"binary is built from sources that are bundled in the repo and sdist."
2222
)
2323

2424

2525
def run_rpm_build():
26-
exitcode, output = subprocess.getstatusoutput(['./build.sh'])
26+
exitcode, output = subprocess.getstatusoutput(["./build.sh"])
2727
print(output)
2828
if exitcode:
2929
raise LibError("Unable to build rpm")
@@ -44,35 +44,35 @@ def run(self):
4444

4545

4646
setup(
47-
name='rpm-inspector-rpm',
48-
version='4.16.1.3.210330.1',
49-
license=' apache-2.0 AND (gpl-2.0 AND lgpl-2.0)',
47+
name="rpm-inspector-rpm",
48+
version="4.16.1.3.210404",
49+
license=" apache-2.0 AND (gpl-2.0 AND lgpl-2.0)",
5050
description=desc,
5151
long_description=desc,
52-
author='nexB',
53-
author_email='info@aboutcode.org',
54-
url='https://github.com/nexB/scancode-plugins',
55-
packages=find_packages('src'),
56-
package_dir={'': 'src'},
57-
py_modules=[splitext(basename(path))[0] for path in glob('src/*.py')],
52+
author="nexB",
53+
author_email="info@aboutcode.org",
54+
url="https://github.com/nexB/scancode-plugins",
55+
packages=find_packages("src"),
56+
package_dir={"": "src"},
57+
py_modules=[splitext(basename(path))[0] for path in glob("src/*.py")],
5858
include_package_data=True,
5959
zip_safe=False,
6060
classifiers=[
6161
# complete classifier list: http://pypi.python.org/pypi?%3Aaction=list_classifiers
62-
'Development Status :: 5 - Production/Stable',
63-
'Intended Audience :: Developers',
64-
'Topic :: Utilities',
62+
"Development Status :: 5 - Production/Stable",
63+
"Intended Audience :: Developers",
64+
"Topic :: Utilities",
6565
],
6666
keywords=[
67-
'open source', 'packagedcode', 'scancode', 'rpm', 'rpmdb',
67+
"open source", "packagedcode", "scancode", "rpm", "rpmdb",
6868
],
6969
install_requires=[
70-
'plugincode',
70+
"plugincode",
7171
],
7272
entry_points={
73-
'scancode_location_provider': [
74-
'rpm_inspector_rpm = rpm_inspector_rpm:RpmPaths',
73+
"scancode_location_provider": [
74+
"rpm_inspector_rpm = rpm_inspector_rpm:RpmPaths",
7575
],
7676
},
77-
cmdclass={'build': BuildRPM, 'develop': DevelopRPM}
77+
cmdclass={"build": BuildRPM, "develop": DevelopRPM}
7878
)
-520 KB
Binary file not shown.
Binary file not shown.
541 KB
Binary file not shown.
-15.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)