Add profile-specific DOS client setup helpers and authenticated downloads
This commit is contained in:
@@ -16,6 +16,7 @@ with tempfile.TemporaryDirectory(prefix='mars-deb-') as tmp:
|
||||
for name in ('publish-mtcp.sh','publish-winclient.sh'):copy(name,'usr/local/sbin/mars-'+name.removesuffix('.sh'),0o755)
|
||||
for f in (root/'websetup').iterdir():
|
||||
if f.is_file():copy(str(f.relative_to(root)),'usr/local/share/mars-vme/www/'+f.name)
|
||||
for f in (root/'releases/dos').iterdir():copy(str(f.relative_to(root)),'usr/local/share/mars-vme/www/dos/'+f.name)
|
||||
for f in (root/'releases/windows').iterdir():copy(str(f.relative_to(root)),'usr/local/share/mars-vme/driver-packages/'+f.name)
|
||||
# Runtime state/config is created only if absent by postinst, never shipped over existing configuration.
|
||||
conf=stage/'usr/local/etc/mars_nwe/nwserv.conf'
|
||||
@@ -27,7 +28,7 @@ with tempfile.TemporaryDirectory(prefix='mars-deb-') as tmp:
|
||||
control=pathlib.Path(tmp)/'debian';control.mkdir();(control/'control').write_text('Source: mars-vme\nMaintainer: MARS VME <root@localhost>\n\nPackage: mars-vme\nArchitecture: any\nDescription: MARS VME\n')
|
||||
elfs=[p for p in stage.rglob('*') if p.is_file() and p.read_bytes()[:4]==b'\x7fELF']
|
||||
deps=run('dpkg-shlibdeps','-O',*[str(p) for p in elfs],cwd=tmp).strip().split('shlibs:Depends=',1)[1]
|
||||
(deb/'control').write_text(f'Package: mars-vme\nVersion: 0.8.3-1\nArchitecture: {arch}\nMaintainer: MARS VME <root@localhost>\nDepends: {deps}, python3, jq, iproute2, nftables, libpcap0.8t64\nSection: net\nPriority: optional\nDescription: MARS VME server with web administration and Windows driver packages\n Host-native Ubuntu 26.04 build. Windows drivers are experimental.\n')
|
||||
(deb/'control').write_text(f'Package: mars-vme\nVersion: 0.8.4-1\nArchitecture: {arch}\nMaintainer: MARS VME <root@localhost>\nDepends: {deps}, python3, jq, iproute2, nftables, libpcap0.8t64\nSection: net\nPriority: optional\nDescription: MARS VME server with web administration and Windows driver packages\n Host-native Ubuntu 26.04 build. Windows drivers are experimental.\n')
|
||||
(deb/'postinst').write_text('''#!/bin/sh
|
||||
set -e
|
||||
if [ "$1" = configure ]; then
|
||||
@@ -56,6 +57,6 @@ fi
|
||||
(deb/'conffiles').write_text(''.join('/'+str(f.relative_to(stage))+'\n' for f in (stage/'usr/local/etc').rglob('*') if f.is_file()))
|
||||
for name in ('postinst','prerm'):(deb/name).chmod(0o755)
|
||||
for name in ('COPYING','LEGACY-BUILD.md','WINDOWS.md','DRIVER-RELEASE.md','LONG-NAMES.md'):copy(name,'usr/share/doc/mars-vme/'+name)
|
||||
package=out/f'mars-vme_0.8.3-1_{arch}.deb';run('dpkg-deb','--root-owner-group','--build',str(stage),str(package))
|
||||
package=out/f'mars-vme_0.8.4-1_{arch}.deb';run('dpkg-deb','--root-owner-group','--build',str(stage),str(package))
|
||||
(out/'SHA256SUMS').write_text(''.join(hashlib.sha256(f.read_bytes()).hexdigest()+' '+f.name+'\n' for f in sorted(out.glob('*.deb'))))
|
||||
print(package)
|
||||
|
||||
Reference in New Issue
Block a user