build: hack ethereum-swarm as a "depends" in deb package

This commit is contained in:
Anton Evangelatov 2018-07-19 16:32:18 +02:00
parent 8635fc1fed
commit 9ad8e09ca2
2 changed files with 18 additions and 5 deletions

View file

@ -89,6 +89,8 @@ var (
executablePath("swarm"), executablePath("swarm"),
} }
swarmPackageName = "ethereum-swarm"
// A debian package is created for all executables listed here. // A debian package is created for all executables listed here.
debExecutables = []debExecutable{ debExecutables = []debExecutable{
{ {
@ -125,13 +127,13 @@ var (
debSwarmExecutables = []debExecutable{ debSwarmExecutables = []debExecutable{
{ {
BinaryName: "swarm", BinaryName: "swarm",
PackageName: "ethereum-swarm", PackageName: swarmPackageName,
Description: "Ethereum Swarm daemon and tools", Description: "Ethereum Swarm daemon and tools",
}, },
} }
debSwarm = debPackage{ debSwarm = debPackage{
Name: "ethereum-swarm", Name: swarmPackageName,
VersionFilePath: "swarm/VERSION", VersionFilePath: "swarm/VERSION",
Executables: debSwarmExecutables, Executables: debSwarmExecutables,
} }
@ -653,6 +655,17 @@ func (meta debMetadata) ExeName(exe debExecutable) string {
return exe.Package() return exe.Package()
} }
// EthereumSwarmPackageName returns the name of the swarm package based on
// environment, e.g. "ethereum-swarm-unstable", or "ethereum-swarm".
// This is needed so that we make sure that "ethereum" package,
// depends on and installs "ethereum-swarm"
func (meta debMetadata) EthereumSwarmPackageName() string {
if isUnstableBuild(meta.Env) {
return swarmPackageName + "-unstable"
}
return swarmPackageName
}
// ExeConflicts returns the content of the Conflicts field // ExeConflicts returns the content of the Conflicts field
// for executable packages. // for executable packages.
func (meta debMetadata) ExeConflicts(exe debExecutable) string { func (meta debMetadata) ExeConflicts(exe debExecutable) string {

View file

@ -10,9 +10,9 @@ Vcs-Browser: https://github.com/ethereum/go-ethereum
Package: {{.Name}} Package: {{.Name}}
Architecture: any Architecture: any
Depends: ${misc:Depends}, {{.ExeList}} Depends: ${misc:Depends}, {{.EthereumSwarmPackageName}}, {{.ExeList}}
Description: Meta-package to install geth and other tools Description: Meta-package to install geth, swarm, and other tools
Meta-package to install geth and other tools Meta-package to install geth, swarm and other tools
{{range .Executables}} {{range .Executables}}
Package: {{$.ExeName .}} Package: {{$.ExeName .}}