kubernetes-client / c

Official C client library for Kubernetes
Apache License 2.0
141 stars 45 forks source link

[Package] Use cpack to build deb package #94

Closed ityuhui closed 2 years ago

ityuhui commented 2 years ago

Use cmake/cpack to build debian package. Thanks @ahmedalnuaimi @ahmedyarub for this suggestion !

After these files are merged, we can use the command: cpack -G DEB to generate a debian package.

Mark this PR as WIP because I will commit the files kubernetes/CMakeLists.txt and kubernetes/Packing.cmake to openapi-generator project.

ityuhui commented 2 years ago

/cc @brendandburns

ityuhui commented 2 years ago

cc @ahmedalnuaimi @ahmedyarub

Could you please help review this PR too ? Thank you.

ityuhui commented 2 years ago
root@k8s-node1:~/c/kubernetes/build# dpkg-deb -c ./libkubernetes_0.0.1_amd64.deb
drwxr-xr-x root/root         0 2021-11-18 16:49 ./usr/
drwxr-xr-x root/root         0 2021-11-18 16:49 ./usr/local/
drwxr-xr-x root/root         0 2021-11-18 16:49 ./usr/local/include/
drwxr-xr-x root/root         0 2021-11-18 16:49 ./usr/local/include/kubernetes/
drwxr-xr-x root/root         0 2021-11-18 16:49 ./usr/local/include/kubernetes/api/
-rw-r--r-- root/root       351 2021-11-05 13:57 ./usr/local/include/kubernetes/api/AdmissionregistrationAPI.h
-rw-r--r-- root/root      5156 2021-11-05 13:57 ./usr/local/include/kubernetes/api/AdmissionregistrationV1API.h
...
drwxr-xr-x root/root         0 2021-11-18 16:49 ./usr/local/include/kubernetes/watch/
-rw-r--r-- root/root       334 2021-07-26 16:51 ./usr/local/include/kubernetes/watch/watch_util.h
drwxr-xr-x root/root         0 2021-11-18 16:49 ./usr/local/include/kubernetes/websocket/
-rw-r--r-- root/root       345 2021-09-14 20:35 ./usr/local/include/kubernetes/websocket/kube_exec.h
-rw-r--r-- root/root      1017 2021-09-13 14:46 ./usr/local/include/kubernetes/websocket/wsclient.h
drwxr-xr-x root/root         0 2021-11-18 16:49 ./usr/local/lib/
drwxr-xr-x root/root         0 2021-11-18 16:49 ./usr/local/lib/cmake/
drwxr-xr-x root/root         0 2021-11-18 16:49 ./usr/local/lib/cmake/kubernetes/
-rw-r--r-- root/root       156 2021-11-10 16:07 ./usr/local/lib/cmake/kubernetes/kubernetesConfig.cmake
-rw-r--r-- root/root      1269 2021-11-10 16:07 ./usr/local/lib/cmake/kubernetes/kubernetesConfigVersion.cmake
-rw-r--r-- root/root       998 2021-11-18 16:49 ./usr/local/lib/cmake/kubernetes/kubernetesTargets-noconfig.cmake
-rw-r--r-- root/root      3287 2021-11-10 16:07 ./usr/local/lib/cmake/kubernetes/kubernetesTargets.cmake
-rw-r--r-- root/root   3010216 2021-11-10 16:08 ./usr/local/lib/libkubernetes.so
ityuhui commented 2 years ago
root@k8s-node1:~/c/kubernetes/build# dpkg-deb -I ./libkubernetes_0.0.1_amd64.deb  
 new Debian package, version 2.0.
 size 867058 bytes: control archive=17539 bytes.
     240 bytes,     9 lines      control              
   57433 bytes,   610 lines      md5sums              
 Package: libkubernetes
 Version: 0.0.1
 Section: devel
 Priority: optional
 Architecture: amd64
 Installed-Size: 3876
 Maintainer: https://github.com/kubernetes-client/c
 Description: The Kubernetes client library for the C programming language.
ityuhui commented 2 years ago
root@k8s-node1:~/c/kubernetes/build# dpkg-deb -I ./libkubernetes_0.0.1_amd64.deb 
 new Debian package, version 2.0.
 size 867100 bytes: control archive=17596 bytes.
     309 bytes,    10 lines      control              
   57433 bytes,   610 lines      md5sums              
 Package: libkubernetes
 Version: 0.0.1
 Section: devel
 Priority: optional
 Architecture: amd64
 Depends: libc6 (>= 2.17), libcurl4 (>= 7.56.1), libssl1.1 (>= 1.1.0)
 Installed-Size: 3876
 Maintainer: https://github.com/kubernetes-client/c
 Description: The Kubernetes client library for the C programming language.
brendandburns commented 2 years ago

/lgtm /approve

This is great!

brendandburns commented 2 years ago

/hold

holding for the generator PR to merge.

ityuhui commented 2 years ago

The files kubernetes/CMakeLists.txt and kubernetes/Packing.cmake have been committed to openapi-generator by https://github.com/OpenAPITools/openapi-generator/pull/10935

The regenerated files (kubernetes/CMakeLists.txt and kubernetes/Packing.cmake) are same with the files in this PR exactly. So there is no need to modify any file of this PR.

Hi @brendandburns This PR is ready to merge now.

brendandburns commented 2 years ago

/lgtm /approve

Thanks!

k8s-ci-robot commented 2 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brendandburns, ityuhui

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-client/c/blob/master/OWNERS)~~ [brendandburns,ityuhui] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
ityuhui commented 2 years ago

Removed the label do-not-merge/hold to trigger the merging because @brendandburns has approved the latest code.