mirror of
https://github.com/pgsty/minio.git
synced 2026-08-09 07:43:29 +03:00
build: install the systemd unit under /usr/lib, drop the template residue
nFPM placed minio.service at /lib/systemd/system. On merged-usr EL/Fedora the
file lands correctly through the symlink, but the RPM database records /lib/...,
so `rpm -qf` disowns it and - more importantly - systemd's
%transfiletriggerin watches /usr/lib/systemd/system, so the path recorded as
/lib/... never fires the automatic `daemon-reload` on install or removal. Move
the unit to the canonical /usr/lib/systemd/system, which both restores that
trigger and makes the package own the path it ships.
The destination is asserted verbatim in several places, all updated in lockstep
so the packaging gate still passes: the six name/payload/sha checks in
test-release.yml (rpm/deb/apk) and expected_payload in sign-release-rpms.sh.
Verified by building a real deb with the new config: the unit is at
./usr/lib/systemd/system/minio.service.
Also drop the `# Built for ${project.name}...` line from minio.service. nFPM
expands variables in content src paths, not file bodies, so that pkger-era
placeholder was being written verbatim into every installed unit.
Not addressed here, deliberately: the package still does not create the
minio-user account the unit references. That matches upstream MinIO's own
packages (both rely on the documented manual useradd) and is not a fork
regression, so it stays a documentation step rather than a scriptlet.
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@ contents:
|
|||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
- src: ${NFPM_UNIT}
|
- src: ${NFPM_UNIT}
|
||||||
dst: /lib/systemd/system/minio.service
|
dst: /usr/lib/systemd/system/minio.service
|
||||||
expand: true
|
expand: true
|
||||||
file_info:
|
file_info:
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ jobs:
|
|||||||
# package as the binary, and losing it would install a server with
|
# package as the binary, and losing it would install a server with
|
||||||
# nothing to start it.
|
# nothing to start it.
|
||||||
rpm -qpl "${rpm_file}" | grep -Fx '/usr/local/bin/minio'
|
rpm -qpl "${rpm_file}" | grep -Fx '/usr/local/bin/minio'
|
||||||
rpm -qpl "${rpm_file}" | grep -Fx '/lib/systemd/system/minio.service'
|
rpm -qpl "${rpm_file}" | grep -Fx '/usr/lib/systemd/system/minio.service'
|
||||||
test "$(rpm -qpl "${rpm_file}" | wc -l)" -eq 2
|
test "$(rpm -qpl "${rpm_file}" | wc -l)" -eq 2
|
||||||
|
|
||||||
deb_file="minio_${PKG_VERSION}_amd64.deb"
|
deb_file="minio_${PKG_VERSION}_amd64.deb"
|
||||||
@@ -152,7 +152,7 @@ jobs:
|
|||||||
test "$(dpkg-deb --field "${deb_file}" Homepage)" = "${expected_url}"
|
test "$(dpkg-deb --field "${deb_file}" Homepage)" = "${expected_url}"
|
||||||
test "$(dpkg-deb --field "${deb_file}" Description)" = "${expected_description}"
|
test "$(dpkg-deb --field "${deb_file}" Description)" = "${expected_description}"
|
||||||
dpkg-deb --contents "${deb_file}" | grep -E 'usr/local/bin/minio$'
|
dpkg-deb --contents "${deb_file}" | grep -E 'usr/local/bin/minio$'
|
||||||
dpkg-deb --contents "${deb_file}" | grep -E 'lib/systemd/system/minio\.service$'
|
dpkg-deb --contents "${deb_file}" | grep -E 'usr/lib/systemd/system/minio\.service$'
|
||||||
|
|
||||||
apk_info="$(tar -xOzf "minio_${PKG_VERSION}_x86_64.apk" .PKGINFO)"
|
apk_info="$(tar -xOzf "minio_${PKG_VERSION}_x86_64.apk" .PKGINFO)"
|
||||||
grep -Fx "pkgver = ${PKG_VERSION}" <<< "${apk_info}"
|
grep -Fx "pkgver = ${PKG_VERSION}" <<< "${apk_info}"
|
||||||
@@ -161,7 +161,7 @@ jobs:
|
|||||||
grep -Fx "license = ${expected_license}" <<< "${apk_info}"
|
grep -Fx "license = ${expected_license}" <<< "${apk_info}"
|
||||||
grep -Fx "pkgdesc = ${expected_description}" <<< "${apk_info}"
|
grep -Fx "pkgdesc = ${expected_description}" <<< "${apk_info}"
|
||||||
tar -tzf "minio_${PKG_VERSION}_x86_64.apk" | grep -Fx 'usr/local/bin/minio'
|
tar -tzf "minio_${PKG_VERSION}_x86_64.apk" | grep -Fx 'usr/local/bin/minio'
|
||||||
tar -tzf "minio_${PKG_VERSION}_x86_64.apk" | grep -Fx 'lib/systemd/system/minio.service'
|
tar -tzf "minio_${PKG_VERSION}_x86_64.apk" | grep -Fx 'usr/lib/systemd/system/minio.service'
|
||||||
|
|
||||||
for arch in amd64 arm64; do
|
for arch in amd64 arm64; do
|
||||||
if [ "${arch}" = amd64 ]; then
|
if [ "${arch}" = amd64 ]; then
|
||||||
@@ -197,11 +197,11 @@ jobs:
|
|||||||
rpm_sha="$(rpm -qp --queryformat '[%{FILENAMES} %{FILEDIGESTS}\n]' \
|
rpm_sha="$(rpm -qp --queryformat '[%{FILENAMES} %{FILEDIGESTS}\n]' \
|
||||||
"minio-${PKG_VERSION}-1.${rpm_arch}.rpm" | awk '$1 == "/usr/local/bin/minio" { print $2 }')"
|
"minio-${PKG_VERSION}-1.${rpm_arch}.rpm" | awk '$1 == "/usr/local/bin/minio" { print $2 }')"
|
||||||
rpm_service_sha="$(rpm -qp --queryformat '[%{FILENAMES} %{FILEDIGESTS}\n]' \
|
rpm_service_sha="$(rpm -qp --queryformat '[%{FILENAMES} %{FILEDIGESTS}\n]' \
|
||||||
"minio-${PKG_VERSION}-1.${rpm_arch}.rpm" | awk '$1 == "/lib/systemd/system/minio.service" { print $2 }')"
|
"minio-${PKG_VERSION}-1.${rpm_arch}.rpm" | awk '$1 == "/usr/lib/systemd/system/minio.service" { print $2 }')"
|
||||||
deb_sha="$(ar p "minio_${PKG_VERSION}_${deb_arch}.deb" data.tar.gz | tar -xzOf - ./usr/local/bin/minio | sha256sum | awk '{print $1}')"
|
deb_sha="$(ar p "minio_${PKG_VERSION}_${deb_arch}.deb" data.tar.gz | tar -xzOf - ./usr/local/bin/minio | sha256sum | awk '{print $1}')"
|
||||||
deb_service_sha="$(ar p "minio_${PKG_VERSION}_${deb_arch}.deb" data.tar.gz | tar -xzOf - ./lib/systemd/system/minio.service | sha256sum | awk '{print $1}')"
|
deb_service_sha="$(ar p "minio_${PKG_VERSION}_${deb_arch}.deb" data.tar.gz | tar -xzOf - ./usr/lib/systemd/system/minio.service | sha256sum | awk '{print $1}')"
|
||||||
apk_sha="$(tar -xzOf "minio_${PKG_VERSION}_${apk_arch}.apk" usr/local/bin/minio | sha256sum | awk '{print $1}')"
|
apk_sha="$(tar -xzOf "minio_${PKG_VERSION}_${apk_arch}.apk" usr/local/bin/minio | sha256sum | awk '{print $1}')"
|
||||||
apk_service_sha="$(tar -xzOf "minio_${PKG_VERSION}_${apk_arch}.apk" lib/systemd/system/minio.service | sha256sum | awk '{print $1}')"
|
apk_service_sha="$(tar -xzOf "minio_${PKG_VERSION}_${apk_arch}.apk" usr/lib/systemd/system/minio.service | sha256sum | awk '{print $1}')"
|
||||||
|
|
||||||
test "${source_sha}" = "${rpm_sha}"
|
test "${source_sha}" = "${rpm_sha}"
|
||||||
test "${source_sha}" = "${deb_sha}"
|
test "${source_sha}" = "${deb_sha}"
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ expected_summary="S3-Interface Libre Object Storage, Community-maintained MinIO
|
|||||||
expected_description="S3-Interface Libre Object Storage, Community-maintained MinIO server fork."
|
expected_description="S3-Interface Libre Object Storage, Community-maintained MinIO server fork."
|
||||||
expected_license="AGPL-3.0-or-later"
|
expected_license="AGPL-3.0-or-later"
|
||||||
expected_group="Applications/File"
|
expected_group="Applications/File"
|
||||||
expected_payload="/lib/systemd/system/minio.service
|
expected_payload="/usr/lib/systemd/system/minio.service
|
||||||
/usr/local/bin/minio"
|
/usr/local/bin/minio"
|
||||||
repository="${GH_REPO:-pgsty/minio}"
|
repository="${GH_REPO:-pgsty/minio}"
|
||||||
container="${DNFUPDATE_CONTAINER:-dnfupdate}"
|
container="${DNFUPDATE_CONTAINER:-dnfupdate}"
|
||||||
|
|||||||
@@ -39,5 +39,3 @@ SendSIGKILL=no
|
|||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
# Built for ${project.name}-${project.version} (${project.name})
|
|
||||||
|
|||||||
Reference in New Issue
Block a user