From a6389490e32e6dbe2586d6cf9f9615803f7d4f26 Mon Sep 17 00:00:00 2001 From: Navid Shaikh Date: Tue, 31 Mar 2020 20:54:54 +0530 Subject: [PATCH] Add RPM SPEC file (#313) * Add RPM SPEC file Minimize the file diff between midstream and downstream. * Update RELEASE.md with instructions to update SPEC file and Dockerfile.cliartifacts.rhel * Remove gcc from BuildRequires --- RELEASE.md | 12 ++-- openshift-serverless-clients.spec | 96 +++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+), 4 deletions(-) create mode 100644 openshift-serverless-clients.spec diff --git a/RELEASE.md b/RELEASE.md index e532fee30a..03143951cb 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -98,17 +98,21 @@ $ git push # Once PR against openshift/release repo is merged, the CI is setup for release-branch ``` -### Update Dockerfile in release branch with correct version: +### Update Dockerfiles and RPM SPEC file in release branch with correct version: ```bash -# Update Dockerfile with current release number: +# Update Dockerfiles namely: Dockerfile.rhel and Dockerfile.cliartifacts.rhel with current release number: # - Change value of tag to current release (RUN TAG="v0.14.0" make build) # - Change value of LABEL 'version' to current release (v0.14.0) -$ vi Dockerfile +$ vi Dockerfile.rhel +$ vi Dockerfile.cliartifacts.rhel + +# Update RPM SPEC file, update the version and add changelog entry +$ vi openshift-serverless-clients.spec # Verify the changes and raise a PR against release branch $ git status $ git add . -$ git commit -m "Update Dockerfile for release v0.14.0" +$ git commit -m "Update Dockerfiles and SPEC file for release v0.14.0" ``` Note: After CI is setup for release branch, we'll need to raise at least one PR against target release branch, have CI run and merge of PR, this ensures image gets mirrored at quay as postsubmit job. diff --git a/openshift-serverless-clients.spec b/openshift-serverless-clients.spec new file mode 100644 index 0000000000..38cfc1516c --- /dev/null +++ b/openshift-serverless-clients.spec @@ -0,0 +1,96 @@ +#debuginfo not supported with Go +%global debug_package %{nil} +%global package_name openshift-serverless-clients +%global product_name OpenShift Serverless +%global golang_version 1.13 +%global kn_version 0.13.1 +%global kn_release 1 +%global kn_cli_version v%{kn_version} +%global source_dir knative-client-%{kn_version}-%{kn_release} +%global source_tar %{source_dir}.tar.gz + +Name: %{package_name} +Version: %{kn_version} +Release: %{kn_release}%{?dist} +Summary: %{product_name} client kn CLI binary +License: ASL 2.0 +URL: https://github.com/openshift/knative-client/tree/release-%{kn_cli_version} + +ExclusiveArch: x86_64 + +Source0: %{source_tar} +BuildRequires: golang >= %{golang_version} +Provides: %{package_name} +Obsoletes: %{package_name} < %{kn_version} + +%description +Client kn provides developer experience to work with Knative Serving APIs. + +%prep +%setup -q -n %{source_dir} + +%build +TAG=%{kn_cli_version} make build-cross + +%install +mkdir -p %{buildroot}/%{_bindir} +install -m 0755 kn-linux-amd64 %{buildroot}/%{_bindir}/kn + +install -d %{buildroot}%{_datadir}/%{name}-redistributable/{linux,macos,windows} +install -p -m 755 kn-linux-amd64 %{buildroot}%{_datadir}/%{name}-redistributable/linux/kn-linux-amd64 +install -p -m 755 kn-darwin-amd64 %{buildroot}/%{_datadir}/%{name}-redistributable/macos/kn-darwin-amd64 +install -p -m 755 kn-windows-amd64.exe %{buildroot}/%{_datadir}/%{name}-redistributable/windows/kn-windows-amd64.exe + +%files +%license LICENSE +%{_bindir}/kn + +%package redistributable +Summary: %{product_name} client CLI binaries for Linux, macOS and Windows +BuildRequires: golang >= %{golang_version} +Provides: %{package_name}-redistributable +Obsoletes: %{package_name} < %{kn_version} + +%description redistributable +%{product_name} client kn cross platform binaries for Linux, macOS and Windows. + +%files redistributable +%license LICENSE +%dir %{_datadir}/%{name}-redistributable/linux/ +%dir %{_datadir}/%{name}-redistributable/macos/ +%dir %{_datadir}/%{name}-redistributable/windows/ +%{_datadir}/%{name}-redistributable/linux/kn-linux-amd64 +%{_datadir}/%{name}-redistributable/macos/kn-darwin-amd64 +%{_datadir}/%{name}-redistributable/windows/kn-windows-amd64.exe + +%changelog +* Mon Mar 09 2020 Navid Shaikh v0.13.1-1 +- Bump kn release v0.13.1 + +* Mon Mar 09 2020 Navid Shaikh v0.12.0-1 +- Bump kn release v0.12.0 + +* Wed Jan 22 2020 Navid Shaikh v0.11.0-1 +- Bump kn release v0.11.0 + +* Fri Dec 13 2019 Navid Shaikh v0.10.0-1 +- Bump kn release v0.10.0 + +* Fri Nov 08 2019 Navid Shaikh v0.9.0-1 +- Bump kn release v0.9.0 + +* Wed Aug 28 2019 Navid Shaikh v0.2.3-1 +- First tech preview release +- Uses dist macro to include the target platform in RPM name + +* Mon Aug 26 2019 Navid Shaikh v0.2.2-2 +- Initial tech preview release +- Uses license abbrevation ASL 2.0 for Apache Software License 2.0 +- bump the release to v0.2.2-2 + +* Mon Aug 26 2019 Navid Shaikh v0.2.2-1 +- Initial tech preview release +- bump the version to v0.2.2 + +* Tue Aug 20 2019 Navid Shaikh v0.2.1-1 +- Initial tech preview release