Skip to content

Commit aa5729f

Browse files
committed
PMM-12899 clean up server RPM specs
1 parent c80fe45 commit aa5729f

10 files changed

+139
-126
lines changed

build/local/build.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ while test "$#" -gt 0; do
1212
NO_UPDATE=1
1313
;;
1414
--no-client)
15-
NO_CLIENT=1
15+
NO_CLIENT=1; NO_CLIENT_DOCKER=1
1616
;;
1717
--no-client-docker)
1818
NO_CLIENT_DOCKER=1
@@ -99,7 +99,7 @@ fi
9999
# Building client docker image takes 17s
100100
GIT_COMMIT=$(git rev-parse HEAD | head -c 8)
101101
export DOCKER_CLIENT_TAG=local/pmm-client:${GIT_COMMIT}
102-
if [ "$NO_CLIENT_DOCKER" -eq 0 ] || [ "$NO_CLIENT" -eq 0 ]; then
102+
if [ "$NO_CLIENT_DOCKER" -eq 0 ]; then
103103
"$PATH_TO_SCRIPTS/build-client-docker"
104104
fi
105105

@@ -113,7 +113,6 @@ fi
113113
# total time: ??? - subsequent build, using cache from prior builds
114114

115115
export RPM_EPOCH=1
116-
export RPMBUILD_DIST="el9"
117116

118117
if [ "$NO_SERVER_RPM" -eq 0 ]; then
119118
"$PATH_TO_SCRIPTS/build-server-rpm" percona-dashboards grafana-dashboards
@@ -129,7 +128,6 @@ if [ "$NO_SERVER_RPM" -eq 0 ]; then
129128
fi
130129

131130
export DOCKER_TAG=local/pmm-server:${GIT_COMMIT}
132-
export RPMBUILD_DIST=el9
133131
export DOCKERFILE=Dockerfile.el9
134132
${PATH_TO_SCRIPTS}/build-server-docker
135133

build/packages/rpm/server/SPECS/grafana.spec

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
%global debug_package %{nil}
21
%global commit f283b87d773da4ad61ca65660e72c084ac8f8716
32
%global shortcommit %(c=%{commit}; echo ${c:0:7})
4-
%define build_timestamp %(date -u +"%y%m%d%H%M")
5-
%define release 104
3+
%define release 105
64
%define grafana_version 10.4.0
75
%define full_pmm_version 2.0.0
86
%define full_version v%{grafana_version}-%{full_pmm_version}
9-
%define rpm_release %{release}.%{build_timestamp}.%{shortcommit}%{?dist}
7+
%define rpm_release %{release}.%{shortcommit}%{?dist}
108

119
%if ! 0%{?gobuild:1}
12-
%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};
10+
%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom | od -An -tx1 | tr -d ' \\n')" -a -v -x %{?**};
1311
%endif
1412

1513
Name: percona-grafana
@@ -24,8 +22,9 @@ ExclusiveArch: %{ix86} x86_64 %{arm}
2422
BuildRequires: fontconfig
2523

2624
%description
27-
Grafana is an open source, feature rich metrics dashboard and graph editor for
28-
Graphite, InfluxDB & OpenTSDB.
25+
Grafana is an open source observability and data visualization platform.
26+
Visualize metrics, logs, and traces from multiple sources like
27+
Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
2928

3029
%prep
3130
%setup -q -n grafana-%{commit}
@@ -77,7 +76,7 @@ getent passwd pmm >/dev/null || echo "User pmm does not exist. Please create it
7776
exit 0
7877

7978
%changelog
80-
* Wed Mar 20 2024 Alex Demidoff <alexander.demidoff@percona.com> - 10.4.0-2
79+
* Wed Mar 20 2024 Alex Demidoff <alexander.demidoff@percona.com> - 10.4.0-105
8180
- PMM-12899 Use module and build cache
8281

8382
* Tue Mar 12 2024 Matej Kubinec <matej.kubinec@ext.percona.com> - 10.4.0-1

build/packages/rpm/server/SPECS/percona-dashboards.spec

+25-19
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
1-
%global debug_package %{nil}
21
%global __strip /bin/true
32

4-
%global repo grafana-dashboards
5-
%global provider github.com/percona/%{repo}
6-
%global import_path %{provider}
7-
%global commit ad4af6808bcd361284e8eb8cd1f36b1e98e32bce
8-
%global shortcommit %(c=%{commit}; echo ${c:0:7})
9-
%define build_timestamp %(date -u +"%y%m%d%H%M")
10-
%define release 21
11-
%define rpm_release %{release}.%{build_timestamp}.%{shortcommit}%{?dist}
12-
13-
Name: percona-dashboards
14-
Version: %{version}
15-
Release: %{rpm_release}
16-
Summary: Grafana dashboards for monitoring
17-
18-
License: AGPLv3
19-
URL: https://%{provider}
20-
Source0: https://%{provider}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
3+
%global repo grafana-dashboards
4+
%global provider github.com/percona/%{repo}
5+
%global import_path %{provider}
6+
%global commit ad4af6808bcd361284e8eb8cd1f36b1e98e32bce
7+
%global shortcommit %(c=%{commit}; echo ${c:0:7})
8+
%define release 22
9+
%define rpm_release %{release}.%{shortcommit}%{?dist}
10+
11+
%if ! 0%{?gobuild:1}
12+
# https://github.com/rpm-software-management/rpm/issues/367
13+
# https://fedoraproject.org/wiki/PackagingDrafts/Go#Build_ID
14+
%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom | od -An -tx1 | tr -d ' \\n')" -a -v -x %{?**};
15+
%endif
16+
17+
Name: percona-dashboards
18+
Version: %{version}
19+
Release: %{rpm_release}
20+
Summary: Grafana dashboards for monitoring
21+
22+
License: AGPLv3
23+
URL: https://%{provider}
24+
Source0: https://%{provider}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
2125

2226
BuildRequires: nodejs
2327
Requires: percona-grafana
24-
Provides: percona-grafana-dashboards = %{version}-%{release}
2528

2629
%description
2730
This is a set of Grafana dashboards for database and system monitoring
@@ -57,6 +60,9 @@ echo %{version} > %{buildroot}%{_datadir}/%{name}/VERSION
5760

5861

5962
%changelog
63+
* Wed Mar 20 2024 Alex Demidoff <alexander.demidoff@percona.com> - 3.0.0-22
64+
- PMM-12899 Use module and build cache
65+
6066
* Wed Nov 29 2023 Alex Demidoff <alexander.demidoff@percona.com> - 3.0.0-21
6167
- PMM-12693 Run Grafana as non-root user
6268

build/packages/rpm/server/SPECS/percona-qan-api2.spec

+20-21
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
# Go build id is not supported for now.
2-
# https://github.com/rpm-software-management/rpm/issues/367
3-
# https://bugzilla.redhat.com/show_bug.cgi?id=1295951
4-
%undefine _missing_build_ids_terminate_build
5-
61
%global repo pmm
72
%global provider github.com/percona/%{repo}
83
%global import_path %{provider}
94
# The commit hash gets sed'ed by build-server-rpm script to set a correct version
105
# see: https://github.com/percona/pmm/blob/main/build/scripts/build-server-rpm#L58
116
%global commit 0000000000000000000000000000000000000000
127
%global shortcommit %(c=%{commit}; echo ${c:0:7})
13-
%define build_timestamp %(date -u +"%y%m%d%H%M")
14-
%define release 17
15-
%define rpm_release %{release}.%{build_timestamp}.%{shortcommit}%{?dist}
8+
%define release 18
9+
%define rpm_release %{release}.%{shortcommit}%{?dist}
1610

1711
# the line below is sed'ed by build/bin/build-server-rpm to set a correct version
1812
%define full_pmm_version 2.0.0
1913

20-
Name: percona-qan-api2
14+
%if ! 0%{?gobuild:1}
15+
# https://github.com/rpm-software-management/rpm/issues/367
16+
# https://fedoraproject.org/wiki/PackagingDrafts/Go#Build_ID
17+
%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom | od -An -tx1 | tr -d ' \\n')" -a -v -x %{?**};
18+
%endif
19+
20+
Name: pmm-qan
2121
Version: %{version}
2222
Release: %{rpm_release}
23-
Summary: Query Analytics API v2 for PMM
23+
Summary: Query Analytics API for PMM
2424

2525
License: AGPLv3
2626
URL: https://%{provider}
@@ -32,40 +32,39 @@ See PMM docs for more information - https://docs.percona.com/percona-monitoring-
3232

3333

3434
%prep
35-
%setup -T -c -n %{repo}-%{version}
36-
%setup -q -c -a 0 -n %{repo}-%{version}
37-
mkdir -p src/github.com/percona
38-
mv %{repo}-%{commit} src/%{provider}
35+
%setup -q -n %{repo}-%{commit}
3936

4037

4138
%build
4239
export PMM_RELEASE_VERSION=%{full_pmm_version}
4340
export PMM_RELEASE_FULLCOMMIT=%{commit}
4441
export PMM_RELEASE_BRANCH=""
4542

46-
cd src/%{provider}/qan-api2
47-
make release
43+
make -C qan-api2 release
4844

4945

5046
%install
5147

5248
install -d -p %{buildroot}%{_sbindir}
53-
install -p -m 0755 src/%{provider}/bin/qan-api2 %{buildroot}%{_sbindir}/%{name}
49+
install -p -m 0755 ./bin/qan-api2 %{buildroot}%{_sbindir}/%{name}
5450

5551

5652
%files
5753
%attr(0755, root, root) %{_sbindir}/%{name}
58-
%license src/%{provider}/qan-api2/LICENSE
59-
%doc src/%{provider}/qan-api2/README.md
54+
%license qan-api2/LICENSE
55+
%doc qan-api2/README.md
6056

6157
%changelog
62-
* Mon Nov 7 2022 Alexander Tymchuk <alexander.tymchuk@percona.com> - 2.0.0-17
58+
* Wed Apr 1 2024 Alex Demidoff <alexander.demidoff@percona.com> - 3.0.0-18
59+
- PMM-12899 Use module and build cache
60+
61+
* Mon Nov 7 2022 Alexander Tymchuk <alexander.tymchuk@percona.com> - 2.0.0-17
6362
- PMM-10117 migrate QAN API to monorepo
6463

6564
* Mon May 16 2022 Nikita Beletskii <nikita.beletskii@percona.com> - 2.0.0-16
6665
- PMM-10027 remove useless packages
6766

68-
* Thu Jul 2 2020 Mykyta Solomko <mykyta.solomko@percona.com> - 2.0.0-15
67+
* Thu Jul 2 2020 Mykyta Solomko <mykyta.solomko@percona.com> - 2.0.0-15
6968
- PMM-5645 built using Golang 1.14
7069

7170
* Tue Mar 19 2019 Vadim Yalovets <vadim.yalovets@percona.com> - 2.0.0-4

build/packages/rpm/server/SPECS/pmm-dump.spec

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
%undefine _missing_build_ids_terminate_build
2-
31
%global repo pmm-dump
42
%global provider github.com/percona/%{repo}
53
%global commit 0d49b27729506dc62950f9fa59147d63df194db2
64
%global shortcommit %(c=%{commit}; echo ${c:0:7})
7-
%define build_timestamp %(date -u +"%y%m%d%H%M")
8-
%define release 1
9-
%define rpm_release %{release}.%{build_timestamp}.%{shortcommit}%{?dist}
5+
%define release 2
6+
%define rpm_release %{release}.%{shortcommit}%{?dist}
7+
8+
%if ! 0%{?gobuild:1}
9+
# https://github.com/rpm-software-management/rpm/issues/367
10+
# https://fedoraproject.org/wiki/PackagingDrafts/Go#Build_ID
11+
%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom | od -An -tx1 | tr -d ' \\n')" -a -v -x %{?**};
12+
%endif
1013

1114
Name: pmm-dump
1215
Version: 0.7.0
@@ -37,6 +40,9 @@ install -p -m 0755 pmm-dump %{buildroot}%{_sbindir}/pmm-dump
3740

3841

3942
%changelog
43+
* Mon Apr 1 2024 Alex Demidoff <alexander.demidoff@percona.com> - 0.7.0-2
44+
- PMM-12899 Use module and build cache
45+
4046
* Tue Nov 23 2023 Artem Gavrilov <artem.gavrilov@percona.com> - 0.7.0-ga
4147
- PMM-12460 Update pmm-dump to v0.7.0-ga version
4248

build/packages/rpm/server/SPECS/pmm-managed.spec

+23-22
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
1-
%undefine _missing_build_ids_terminate_build
21
%global _dwz_low_mem_die_limit 0
32

43
%global repo pmm
54
%global provider github.com/percona/%{repo}
65
%global commit 8f3d007617941033867aea6a134c48b39142427f
76
%global shortcommit %(c=%{commit}; echo ${c:0:7})
8-
%define build_timestamp %(date -u +"%y%m%d%H%M")
9-
%define release 20
10-
%define rpm_release %{release}.%{build_timestamp}.%{shortcommit}%{?dist}
7+
%define release 21
8+
%define rpm_release %{release}.%{shortcommit}%{?dist}
119

1210
# the line below is sed'ed by build/bin/build-server-rpm to set a correct version
1311
%define full_pmm_version 2.0.0
1412

15-
Name: pmm-managed
16-
Version: %{version}
17-
Release: %{rpm_release}
18-
Summary: Percona Monitoring and Management management daemon
13+
%if ! 0%{?gobuild:1}
14+
# https://github.com/rpm-software-management/rpm/issues/367
15+
# https://fedoraproject.org/wiki/PackagingDrafts/Go#Build_ID
16+
%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom | od -An -tx1 | tr -d ' \\n')" -a -v -x %{?**};
17+
%endif
1918

20-
License: AGPLv3
21-
URL: https://%{provider}
22-
Source0: https://%{provider}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
19+
Name: pmm-managed
20+
Version: %{version}
21+
Release: %{rpm_release}
22+
Summary: Percona Monitoring and Management management daemon
23+
24+
License: AGPLv3
25+
URL: https://%{provider}
26+
Source0: https://%{provider}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
2327

2428
%description
2529
pmm-managed manages configuration of PMM server components (VictoriaMetrics,
@@ -28,19 +32,14 @@ See PMM docs for more information.
2832

2933

3034
%prep
31-
%setup -q -n pmm-%{commit}
32-
mkdir -p src/github.com/percona
33-
ln -s $(pwd) src/%{provider}
34-
35+
%setup -q -n %{repo}-%{commit}
3536

3637
%build
37-
3838
export PMM_RELEASE_VERSION=%{full_pmm_version}
3939
export PMM_RELEASE_FULLCOMMIT=%{commit}
4040
export PMM_RELEASE_BRANCH=""
4141

42-
cd src/github.com/percona/pmm/managed
43-
make release
42+
make -C managed release
4443

4544

4645
%install
@@ -51,20 +50,22 @@ install -p -m 0755 bin/pmm-managed %{buildroot}%{_sbindir}/pmm-managed
5150
install -p -m 0755 bin/pmm-managed-init %{buildroot}%{_sbindir}/pmm-managed-init
5251
install -p -m 0755 bin/pmm-managed-starlark %{buildroot}%{_sbindir}/pmm-managed-starlark
5352

54-
cd src/github.com/percona/pmm
55-
cp -pa ./api/swagger %{buildroot}%{_datadir}/%{name}
53+
cp -pa api/swagger %{buildroot}%{_datadir}/%{name}
5654

5755

5856
%files
59-
%license src/%{provider}/LICENSE
60-
%doc src/%{provider}/README.md
57+
%license managed/LICENSE
58+
%doc managed/README.md
6159
%{_sbindir}/pmm-managed
6260
%{_sbindir}/pmm-managed-init
6361
%{_sbindir}/pmm-managed-starlark
6462
%{_datadir}/%{name}
6563

6664

6765
%changelog
66+
* Mon Apr 1 2024 Alex Demidoff <alexander.demidoff@percona.com> - 3.0.0-21
67+
- PMM-12899 Use module and build cache
68+
6869
* Thu Jul 28 2022 Alex Tymchuk <alexander.tymchuk@percona.com> - 2.30.0-1
6970
- PMM-10036 migrate to monorepo
7071

0 commit comments

Comments
 (0)