-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ben Rockwood <[email protected]>
- Loading branch information
Showing
2 changed files
with
17 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,10 @@ echo "--------- Creating Debian Package ${PKG_NAME} ${VERSION} ---------" | |
# Create the package directory: | ||
mkdir ${PKG_NAME} | ||
|
||
### v9 no longer includes a helper script | ||
# Copy in contents: | ||
mkdir -p ${PKG_NAME}/usr/bin | ||
cp mondoo.sh ${PKG_NAME}/usr/bin/mondoo | ||
#mkdir -p ${PKG_NAME}/usr/bin | ||
#cp mondoo.sh ${PKG_NAME}/usr/bin/mondoo | ||
|
||
# Create Package Metadata (Control File): | ||
mkdir ${PKG_NAME}/DEBIAN | ||
|
@@ -27,8 +28,8 @@ Section: utils | |
Priority: optional | ||
Architecture: all | ||
Maintainer: Mondoo <[email protected]> | ||
Description: Mondoo Compatibility Wrapper for cnspec | ||
Depends: cnspec (>= 8.0.0) | ||
Description: Mondoo Metapackage for cnspec | ||
Depends: cnspec (>= 9.0.0) | ||
Installed-Size: 261 B | ||
EOF | ||
|
||
|
@@ -41,10 +42,10 @@ echo "Checking DPKG Contents:" | |
dpkg -c ${PKG_NAME}.deb | ||
echo "Complete!" | ||
|
||
# Create arch varieties for compatibility with Legacy Mondoo CLI | ||
# Create arch varieties for compatibility with Legacy Mondoo CLI | ||
echo "Creating platform variants:" | ||
mkdir packages | ||
for arch in 386 amd64 arm64 armv6 armv7 ppc64le; do | ||
for arch in 386 amd64 arm64 armv6 armv7 ppc64le; do | ||
# ex: mondoo_8.2.0_linux_amd64.deb | ||
echo "Creating Deb for ${arch}..." | ||
cp "${PKG_NAME}.deb" "packages/${PKG_NAME}_${VERSION}_linux_${arch}.deb" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ MONDOO_VERSION=$VERSION | |
OUTDIR=packages | ||
mkdir -p ${OUTDIR} | ||
|
||
echo "--------- Creating RPM Package mondoo ${MONDOO_VERSION} ---------" | ||
echo "--------- Creating RPM Meta-Package mondoo ${MONDOO_VERSION} ---------" | ||
|
||
SCRIPT_LOCATION=$(readlink -f "$0") | ||
REPO_DIR=$(dirname "${SCRIPT_LOCATION}") | ||
|
@@ -18,54 +18,42 @@ cd "$TMPDIR" | |
# Set up files/directories for a rpmbuild environment | ||
mkdir BUILD BUILDROOT RPMS SOURCES SPECS SRPMS | ||
|
||
# Make a "release" tarball | ||
mkdir mondoo-wrapper | ||
cp "${REPO_DIR}/mondoo.sh" mondoo-wrapper/ | ||
tar czf "./SOURCES/mondoo-${MONDOO_VERSION}.tar.gz" ./mondoo-wrapper | ||
SOURCES_PATH=${TMPDIR}/SOURCES/mondoo-${MONDOO_VERSION}.tar.gz | ||
|
||
# The spec file pointing to the location we placed the "release" tarball | ||
cat << EOF > ./SPECS/mondoo.spec | ||
Name: mondoo | ||
Version: ${MONDOO_VERSION} | ||
Release: 1 | ||
Summary: Mondoo checks systems for vulnerabilities, security issues and misconfigurations | ||
License: MPL 2.0 | ||
License: BUSL-1.1 | ||
URL: https://mondoo.com | ||
Vendor: Mondoo, Inc | ||
Source: ${SOURCES_PATH} | ||
BuildArch: noarch | ||
BuildRoot: \${_tmppath}/\${name}-root | ||
Requires: cnspec | ||
%description | ||
Mondoo checks systems for vulnerabilities, security issues and misconfigurations | ||
%prep | ||
%setup -q -n mondoo-wrapper | ||
%build | ||
# it's a shell script | ||
%install | ||
mkdir -p \${RPM_BUILD_ROOT}/%{_bindir} | ||
pwd | ||
ls * | ||
cp mondoo.sh \${RPM_BUILD_ROOT}/%{_bindir}/mondoo | ||
%clean | ||
%post | ||
%files | ||
%defattr(-,root,root) | ||
%{_bindir}/mondoo | ||
%changelog | ||
* Mon Mar 20 2023 Mondoo, Inc <[email protected]> | ||
Initial Mondoo shell wrapper script. | ||
* Mon Mar 20 2023 Mondoo, Inc <[email protected]> 1-1 | ||
- Mondoo shell wrapper script. | ||
EOF | ||
|
||
# Build | ||
echo "Building RPM..." | ||
rpmbuild --define "_topdir $(pwd)" -v -ba ./SPECS/mondoo.spec | ||
rpmbuild --define "_topdir $(pwd)" -v -bb ./SPECS/mondoo.spec | ||
|
||
# Save | ||
echo "Creating NOARCH RPM" | ||
|
@@ -77,6 +65,6 @@ for arch in 386 amd64 arm64 armv6 armv7 ppc64le; do | |
cp "${OUTDIR}/mondoo_${MONDOO_VERSION}_linux_noarch.rpm" "${OUTDIR}/mondoo_${MONDOO_VERSION}_linux_${arch}.rpm" | ||
done | ||
|
||
## To Test: | ||
## To Test: | ||
## curl -sSL https://releases.mondoo.com/rpm/mondoo.repo > /etc/yum.repos.d/mondoo.repo | ||
## yum install ./mondoo_0.0.1_linux_noarch.rpm |