Skip to content

Commit d6f0f3e

Browse files
committed
build: for-pkg profile
This profile and associated make target are intended for use in generated deb and rpm packages. Having a profile separate from the release profile avoids the build artifacts needed for deb and rpm packages from colliding with the regular release build due to the for-pkg profile being built with --no-default-features.
1 parent 5c3a6bb commit d6f0f3e

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

Cargo.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ default = ["import-compressed", "import-url"]
5454
import-compressed = ["dep:bzip2", "dep:flate2", "dep:tar"]
5555
import-url = ["dep:curl"]
5656

57+
[profile.for-pkg]
58+
inherits = "release"
59+
lto = true
60+
strip = "none"
61+
5762
[package.metadata.deb]
5863
maintainer = "Peter Grayson <[email protected]>"
5964
section = "vcs"
@@ -62,7 +67,7 @@ depends = "git"
6267
recommends = "git-email"
6368
extended-description = ""
6469
assets = [
65-
["target/release/stg", "usr/bin/", "755"],
70+
["target/for-pkg/stg", "usr/bin/", "755"],
6671
["README.md", "usr/share/doc/stgit/", "644"],
6772
["COPYING", "usr/share/doc/stgit/copyright", "644"],
6873
["Documentation/*.1", "usr/share/man/man1/", "644"],
@@ -75,7 +80,7 @@ assets = [
7580

7681
[package.metadata.generate-rpm]
7782
assets = [
78-
{ source = "target/release/stg", dest = "/usr/bin/", mode = "755" },
83+
{ source = "target/for-pkg/stg", dest = "/usr/bin/", mode = "755" },
7984
{ source = "README.md", dest = "/usr/share/doc/stgit/", mode = "644" },
8085
{ source = "COPYING", dest = "/usr/share/licenses/stgit/", mode = "644" },
8186
{ source = "Documentation/*.1", dest = "/usr/share/man/man1/", mode = "644", doc = true },

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ TEST_PATCHES ?= ..
2121
build:
2222
$(CARGO) build --profile=$(STG_PROFILE)
2323

24-
build-no-features:
25-
$(CARGO) build --profile=$(STG_PROFILE) --no-default-features
24+
build-for-pkg:
25+
$(CARGO) build --profile=for-pkg --no-default-features
2626

2727
all: build doc completion contrib
2828

@@ -35,7 +35,7 @@ contrib:
3535
doc: build
3636
$(MAKE) -C Documentation all
3737

38-
.PHONY: all build build-no-features completion contrib doc
38+
.PHONY: all build build-for-pkg completion contrib doc
3939

4040

4141
install: install-bin
@@ -60,10 +60,10 @@ install-contrib:
6060
.PHONY: install install-all install-bin install-completion install-contrib install-man install-html
6161

6262

63-
deb: completion doc build-no-features
63+
deb: completion doc build-for-pkg
6464
$(CARGO_OFFLINE) deb
6565

66-
rpm: completion doc build-no-features
66+
rpm: completion doc build-for-pkg
6767
$(CARGO_OFFLINE) generate-rpm
6868

6969
.PHONY: deb rpm

0 commit comments

Comments
 (0)