Skip to content

Commit a9f29d0

Browse files
committed
Merge branch 'master' of github.com:IGNF/validator
2 parents e5e626f + 7cc26fa commit a9f29d0

18 files changed

Lines changed: 438 additions & 529 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# CHANGELOG
22

3+
## 4.5.x
4+
5+
* v4.5.3 - Improve deb/rpm build scripts (fallback without fpm/rpmbuild)
6+
* v4.5.2 - Add `typeproc` document tag from DOC_URBA (`TYPEPROC` for SCOT, `NOMPROC` for PLU, PLUi, CC and PSMV)
7+
* v4.5.2 - Bump log4j-core to 2.25.4 [SECURITY]
8+
* v4.5.2 - Bump postgresql to 42.7.11 [SECURITY]
9+
310
## 4.3.x
411

512
* v4.3.0 - Update Documentation; add Foreign Key constraints validation

build-deb.sh

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,47 @@
11
#!/bin/bash
2-
3-
hash fpm 2>/dev/null || { echo >&2 "ERROR : fpm is required to build deb package (see https://fpm.readthedocs.io/en/latest/installing.html)"; exit 1; }
2+
set -euo pipefail
43

54
cd validator-cli/target
65

76
VERSION=$(java -jar validator-cli.jar version)
87
echo "VERSION=$VERSION"
98

109
rm -rf *.deb
11-
fpm -s dir -t deb -n ign-validator -v $VERSION \
12-
--architecture all \
13-
--description "IGNF/validator - validate and load data according to models" \
14-
--url "https://github.com/IGNF/validator#validator" \
15-
--license "Cecill-B" \
16-
--vendor "IGNF" \
17-
--maintainer "MBorne@users.noreply.github.com" \
18-
--prefix /opt/ign-validator validator-cli.jar
10+
11+
if hash fpm 2>/dev/null; then
12+
fpm -s dir -t deb -n ign-validator -v "$VERSION" \
13+
--architecture all \
14+
--description "IGNF/validator - validate and load data according to models" \
15+
--url "https://github.com/IGNF/validator#validator" \
16+
--license "Cecill-B" \
17+
--vendor "IGNF" \
18+
--maintainer "MBorne@users.noreply.github.com" \
19+
--prefix /opt/ign-validator validator-cli.jar
20+
exit 0
21+
fi
22+
23+
if ! hash dpkg-deb 2>/dev/null; then
24+
echo >&2 "ERROR : fpm or dpkg-deb is required to build deb package"
25+
echo >&2 "Install fpm: https://fpm.readthedocs.io/en/latest/installing.html"
26+
exit 1
27+
fi
28+
29+
PKG_ROOT=$(mktemp -d)
30+
trap 'rm -rf "$PKG_ROOT"' EXIT
31+
32+
mkdir -p "$PKG_ROOT/DEBIAN" "$PKG_ROOT/opt/ign-validator"
33+
cp validator-cli.jar "$PKG_ROOT/opt/ign-validator/"
34+
35+
cat > "$PKG_ROOT/DEBIAN/control" <<EOF
36+
Package: ign-validator
37+
Version: $VERSION
38+
Architecture: all
39+
Maintainer: MBorne@users.noreply.github.com
40+
Description: IGNF/validator - validate and load data according to models
41+
Vendor: IGNF
42+
Homepage: https://github.com/IGNF/validator#validator
43+
EOF
44+
45+
DEB_FILE="ign-validator_${VERSION}_all.deb"
46+
fakeroot dpkg-deb --build "$PKG_ROOT" "$DEB_FILE"
47+
echo "Built $DEB_FILE (without fpm, using dpkg-deb)"

build-rpm.sh

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,53 @@
11
#!/bin/bash
2+
set -euo pipefail
23

3-
hash fpm 2>/dev/null || { echo >&2 "ERROR : fpm is required to build rpm package (see https://fpm.readthedocs.io/en/latest/installing.html)"; exit 1; }
4+
setup_rpmbuild() {
5+
if hash rpmbuild 2>/dev/null; then
6+
return 0
7+
fi
8+
9+
local script_dir rpm_pkg_dir rpm_root
10+
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
11+
rpm_pkg_dir="$script_dir/.tools/rpm-pkg"
12+
rpm_root="$rpm_pkg_dir/extracted"
13+
14+
if [[ ! -x "$rpm_root/usr/bin/rpmbuild" ]]; then
15+
mkdir -p "$rpm_pkg_dir"
16+
(
17+
cd "$rpm_pkg_dir"
18+
apt-get download rpm librpm9t64 librpmbuild9t64 librpmio9t64 librpmsign9t64 \
19+
rpm-common rpm2cpio debugedit liblua5.3-0
20+
rm -rf extracted
21+
mkdir extracted
22+
for deb in *.deb; do
23+
dpkg-deb -x "$deb" extracted
24+
done
25+
)
26+
fi
27+
28+
export PATH="$rpm_root/usr/bin:$PATH"
29+
export LD_LIBRARY_PATH="$rpm_root/usr/lib/x86_64-linux-gnu${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
30+
export RPM_CONFIGDIR="$rpm_root/usr/lib/rpm"
31+
}
32+
33+
hash fpm 2>/dev/null || {
34+
echo >&2 "ERROR : fpm is required to build rpm package (see https://fpm.readthedocs.io/en/latest/installing.html)"
35+
exit 1
36+
}
37+
38+
setup_rpmbuild
439

540
cd validator-cli/target
641

742
VERSION=$(java -jar validator-cli.jar version)
843
echo "VERSION=$VERSION"
944

1045
rm -rf *.rpm
11-
fpm -s dir -t rpm -n ign-validator -v $VERSION \
12-
--architecture all \
13-
--description "IGNF/validator - validate and load data according to models" \
14-
--url "https://github.com/IGNF/validator#validator" \
15-
--license "Cecill-B" \
16-
--vendor "IGNF" \
17-
--maintainer "MBorne@users.noreply.github.com" \
18-
--prefix /opt/ign-validator validator-cli.jar
46+
fpm -s dir -t rpm -n ign-validator -v "$VERSION" \
47+
--architecture all \
48+
--description "IGNF/validator - validate and load data according to models" \
49+
--url "https://github.com/IGNF/validator#validator" \
50+
--license "Cecill-B" \
51+
--vendor "IGNF" \
52+
--maintainer "MBorne@users.noreply.github.com" \
53+
--prefix /opt/ign-validator validator-cli.jar

0 commit comments

Comments
 (0)