Skip to content

Commit aebd53a

Browse files
committed
overhaul
1 parent f3cb4d0 commit aebd53a

77 files changed

Lines changed: 370 additions & 767 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/packages.yml

Lines changed: 28 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,24 @@ jobs:
1515
matrix:
1616
arch:
1717
- ""
18-
- "-arm"
18+
# - "-arm"
1919
target:
2020
- debian-bullseye-deb
21-
- debian-bookworm-deb
22-
- debian-trixie-deb
23-
- ubuntu-jammy-deb
24-
- ubuntu-noble-deb
25-
- ubuntu-plucky-deb
26-
- almalinux-8-rpm
21+
# - debian-bookworm-deb
22+
# - debian-trixie-deb
23+
# - ubuntu-jammy-deb
24+
# - ubuntu-noble-deb
25+
# - ubuntu-plucky-deb
26+
# - almalinux-8-rpm
2727
- almalinux-9-rpm
28-
- almalinux-10-rpm
29-
- amazonlinux-2023-rpm
28+
# - almalinux-10-rpm
29+
# - amazonlinux-2023-rpm
3030
steps:
3131
- name: Checkout Code
3232
uses: actions/checkout@v5
33-
with:
34-
submodules: true
35-
36-
- name: Download Varnish
37-
run: |
38-
source pkg.env
39-
curl -LO https://varnish-cache.org/downloads/varnish-${varnish_version}.tgz
4033

4134
- name: Build Varnish packages
4235
run: |
43-
( cd varnish-cache/; tar cvzf ../debian.tar.gz debian --dereference ; )
44-
( cd varnish-cache/; tar cvzf ../redhat.tar.gz redhat --dereference ; )
45-
46-
mkdir -p packages
47-
4836
if [ -z "${{ matrix.arch }}" ]; then
4937
PARAM_ARCH=x86_64
5038
else
@@ -54,15 +42,18 @@ jobs:
5442
PARAM_RELEASE=`echo ${{ matrix.target }} | cut -d- -f 2`
5543
EXT=`echo ${{ matrix.target }} | cut -d- -f 3`
5644
45+
cp pkg.env varnish/
46+
5747
docker run \
5848
--rm \
5949
--security-opt seccomp=unconfined \
60-
-e PDIR=packages/$PARAM_DIST/$PARAM_RELEASE/$PARAM_ARCH \
61-
-v $(pwd):/varnish-cache \
50+
--workdir /workdir/varnish \
51+
-v$(pwd):/workdir \
52+
-e PDIR=/workdir/packages/ \
6253
$PARAM_DIST:$PARAM_RELEASE \
63-
/varnish-cache/build_scripts/make-$EXT-packages.sh
54+
/workdir/build_scripts/make-$EXT-packages.sh
6455
65-
ls packages/*/*/
56+
tree packages
6657
6758
- name: Upload artifacts
6859
uses: actions/upload-artifact@v4
@@ -79,18 +70,18 @@ jobs:
7970
matrix:
8071
arch:
8172
- ""
82-
- "-arm"
73+
# - "-arm"
8374
target:
8475
- debian-bullseye-deb
85-
- debian-bookworm-deb
86-
- debian-trixie-deb
87-
- ubuntu-jammy-deb
88-
- ubuntu-noble-deb
89-
- ubuntu-plucky-deb
90-
- almalinux-8-rpm
76+
# - debian-bookworm-deb
77+
# - debian-trixie-deb
78+
# - ubuntu-jammy-deb
79+
# - ubuntu-noble-deb
80+
# - ubuntu-plucky-deb
81+
# - almalinux-8-rpm
9182
- almalinux-9-rpm
92-
- almalinux-10-rpm
93-
- amazonlinux-2023-rpm
83+
# - almalinux-10-rpm
84+
# - amazonlinux-2023-rpm
9485
package:
9586
- varnish-modules
9687
- vmod-uuid
@@ -136,18 +127,16 @@ jobs:
136127
137128
cp pkg.env $PACKAGE/
138129
139-
PDIR=new_packages/$PARAM_DIST/$PARAM_RELEASE/$PARAM_ARCH
140-
mkdir -p $PDIR
141-
142130
docker run \
143131
--rm \
144-
-e PDIR=/$PDIR \
132+
-e PDIR=/new_packages/ \
145133
--workdir /workdir/$PACKAGE \
146134
-v$(pwd):/workdir \
147135
-v$(pwd)/packages:/deps \
148136
-v$(pwd)/new_packages:/new_packages \
149137
$PARAM_DIST:$PARAM_RELEASE \
150-
/workdir/build_scripts/make-$EXT-packages-vmod.sh
138+
/workdir/build_scripts/make-$EXT-packages.sh
139+
151140
tree new_packages
152141
153142
- name: Upload artifacts

build_scripts/make-deb-packages-vmod.sh

Lines changed: 0 additions & 48 deletions
This file was deleted.

build_scripts/make-deb-packages.sh

Lines changed: 58 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,77 @@
22

33
set -eux
44

5+
source /etc/os-release
6+
source ./pkg.env
7+
58
export DEBIAN_FRONTEND=noninteractive
69
export DEBCONF_NONINTERACTIVE_SEEN=true
7-
apt-get update
8-
apt-get install -y dpkg-dev debhelper devscripts equivs pkg-config apt-utils fakeroot
9-
10-
# Ubuntu 20.04 aarch64 fails when using fakeroot-sysv with:
11-
# semop(1): encountered an error: Function not implemented
12-
update-alternatives --set fakeroot /usr/bin/fakeroot-tcp
1310

14-
cd /varnish-cache
15-
ls -la
11+
PKG_NAME=$(basename $(pwd))
12+
DEB_ORIG=${VARS[${PKG_NAME}_version]}.orig.tar.gz
13+
if [ "`uname -m`" = "x86_64" ]; then
14+
ARCH="amd64"
15+
else
16+
ARCH="arm64"
17+
fi
18+
PDIR="$PDIR/$ID/${VERSION_ID%.*}/${ARCH}"
1619

17-
echo "Untar debian..."
18-
tar xavf debian.tar.gz
20+
apt-get update
21+
apt-get install -y \
22+
apt-utils \
23+
debhelper \
24+
devscripts \
25+
dpkg-dev \
26+
equivs \
27+
fakeroot \
28+
pkg-config \
29+
python*-docutils \
30+
$(test -d /deps && find /deps/ -name '*.deb')
31+
# Create build folder and copy debian folder there
32+
mkdir -p ./pkgbuild
33+
cd pkgbuild
1934

20-
echo "Untar orig..."
21-
tar xavf varnish-*.tgz --strip 1
35+
# Save the tarball source file one level up
36+
curl -L "${VARS[${PKG_NAME}_source]}" -o ../$DEB_ORIG
37+
tar xvfz ../$DEB_ORIG --strip 1
2238

23-
echo "Update changelog version..."
24-
if [ -e .is_weekly ]; then
25-
WEEKLY='-weekly'
39+
# Update changelog version
40+
if [ "$PKG_NAME" == "varnish" ]; then
41+
if [ -e .is_weekly ]; then
42+
WEEKLY='-weekly'
43+
else
44+
WEEKLY=
45+
fi
46+
VERSION=$(./configure --version | awk 'NR == 1 {print $NF}')$WEEKLY-${package_release}
47+
./configure --version
2648
else
27-
WEEKLY=
49+
VERSION="$(dpkg -l varnish | awk '$2 == "varnish" {print $3}')"
50+
dpkg -l varnish
2851
fi
29-
source /etc/os-release
30-
source ./pkg.env
31-
VERSION=$(./configure --version | awk 'NR == 1 {print $NF}')$WEEKLY-${package_release}~$VERSION_CODENAME
32-
sed -i -e "s|@VERSION@|$VERSION|" "debian/changelog"
3352

34-
echo "Install Build-Depends packages..."
53+
# remove potential debian/ package included in the tarball
54+
rm -rf debian
55+
cat << EOF > ../debian/changelog
56+
${PKG_NAME} (${VERSION}) unstable; urgency=low
57+
58+
* Changelog not maintained, please see
59+
https://github.com/varnish/all-packager/releases/tag/v${VERSION%~*}
60+
61+
-- Varnish Software <opensource@varnish-software.com>
62+
EOF
63+
ls -halt ../debian
64+
cp -Lrf ../debian .
65+
66+
cat debian/changelog
67+
# Install Build-Depends packages
3568
yes | mk-build-deps --install debian/control || true
3669

37-
echo "Build the packages..."
70+
# Build the packages
3871
dpkg-buildpackage -us -uc -j16
3972

40-
echo "Prepare the packages for storage..."
41-
mkdir -p $PDIR
42-
mv ../*.deb $PDIR
43-
44-
if [ "`uname -m`" = "x86_64" ]; then
45-
ARCH="amd64"
46-
else
47-
ARCH="arm64"
48-
fi
73+
# Prepare the packages for storage
74+
mkdir -p "$PDIR"
75+
mv ../*.deb "$PDIR"
4976

5077
DSC_FILE=$(ls ../*.dsc)
5178
DSC_FILE_WO_EXT=$(basename ${DSC_FILE%.*})

build_scripts/make-rpm-packages-vmod.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)