Skip to content

Commit

Permalink
Add RPM SPEC file (knative#313)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
navidshaikh authored Mar 31, 2020
1 parent 8405e31 commit a638949
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 4 deletions.
12 changes: 8 additions & 4 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
96 changes: 96 additions & 0 deletions openshift-serverless-clients.spec
Original file line number Diff line number Diff line change
@@ -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 <[email protected]> v0.13.1-1
- Bump kn release v0.13.1

* Mon Mar 09 2020 Navid Shaikh <[email protected]> v0.12.0-1
- Bump kn release v0.12.0

* Wed Jan 22 2020 Navid Shaikh <[email protected]> v0.11.0-1
- Bump kn release v0.11.0

* Fri Dec 13 2019 Navid Shaikh <[email protected]> v0.10.0-1
- Bump kn release v0.10.0

* Fri Nov 08 2019 Navid Shaikh <[email protected]> v0.9.0-1
- Bump kn release v0.9.0

* Wed Aug 28 2019 Navid Shaikh <[email protected]> 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 <[email protected]> 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 <[email protected]> v0.2.2-1
- Initial tech preview release
- bump the version to v0.2.2

* Tue Aug 20 2019 Navid Shaikh <[email protected]> v0.2.1-1
- Initial tech preview release

0 comments on commit a638949

Please sign in to comment.