diff --git a/dont-strip.patch b/dont-strip.patch new file mode 100644 index 0000000..de24497 --- /dev/null +++ b/dont-strip.patch @@ -0,0 +1,28 @@ +diff -rub forgejo-src-8.0.3/Makefile forgejo-src-8.0.3-patched/Makefile +--- forgejo-src-8.0.3/Makefile 2024-09-06 14:33:46.000000000 +0200 ++++ forgejo-src-8.0.3-patched/Makefile 2024-10-09 15:01:55.191532699 +0200 +@@ -784,7 +784,7 @@ + + .PHONY: install $(TAGS_PREREQ) + install: $(wildcard *.go) +- CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) install -v -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' ++ CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) install -v -tags '$(TAGS)' -ldflags '$(LDFLAGS)' + + .PHONY: build + build: frontend backend +@@ -816,13 +816,13 @@ + go run $(GOVULNCHECK_PACKAGE) ./... + + $(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ) +- CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@ ++ CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $@ + + forgejo: $(EXECUTABLE) + ln -f $(EXECUTABLE) forgejo + + static-executable: $(GO_SOURCES) $(TAGS_PREREQ) +- CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags 'netgo osusergo $(TAGS)' -ldflags '-s -w -linkmode external -extldflags "-static" $(LDFLAGS)' -o $(EXECUTABLE) ++ CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build $(GOFLAGS) $(EXTRA_GOFLAGS) -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -o $(EXECUTABLE) + + .PHONY: release + release: frontend generate release-linux release-copy release-compress vendor release-sources release-check diff --git a/forgejo.changes b/forgejo.changes index a0e3b56..ef387dd 100644 --- a/forgejo.changes +++ b/forgejo.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Oct 9 13:22:28 UTC 2024 - Richard Rahl + +- add dont-strip.patch for not stripping the main binary (so we can + create debuginfo package) + ------------------------------------------------------------------- Wed Oct 9 05:46:17 UTC 2024 - Tuukka Pasanen diff --git a/forgejo.spec b/forgejo.spec index 2bc5bd0..c1a1adf 100644 --- a/forgejo.spec +++ b/forgejo.spec @@ -51,6 +51,7 @@ Source10: %{name}.apparmor Source11: %{name}.firewalld Source99: get-sources.sh Patch0: custom-app.ini.patch +Patch1: dont-strip.patch BuildRequires: golang-packaging BuildRequires: golang(API) = 1.22 ## node >= 20 @@ -134,10 +135,9 @@ local-npm-registry %{_sourcedir} install --also=dev %build %sysusers_generate_pre %{SOURCE6} %{name} %{name}.conf -export EXTRA_GOFLAGS="-buildmode=pie -mod=vendor" export TAGS="bindata timetzdata sqlite sqlite_unlock_notify" %make_build build -go build ${EXTRA_GOFLAGS} -o contrib/environment-to-ini/environment-to-ini contrib/environment-to-ini/environment-to-ini.go +go build -buildmode=pie -mod=vendor -o contrib/environment-to-ini/environment-to-ini contrib/environment-to-ini/environment-to-ini.go %install install -d %{buildroot}%{_bindir}