Skip to content

Commit

Permalink
Integration for Big Sur, Ubuntu 21.04, Fedora 34 build
Browse files Browse the repository at this point in the history
  • Loading branch information
Addvilz committed Jan 12, 2021
1 parent af5af8f commit 25c6c5c
Show file tree
Hide file tree
Showing 8 changed files with 191 additions and 27 deletions.
30 changes: 27 additions & 3 deletions DOWNLOAD.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,20 @@ Binary package repositories for Kafe are generously hosted by [Cloudsmith](https
- [Ubuntu 19.10](#ubuntu-1910)
- [Ubuntu 20.04](#ubuntu-2004)
- [Ubuntu 20.10](#ubuntu-2010)
- [Ubuntu 21.04](#ubuntu-2104)
- [CentOS and RHEL 7](#centos-and-rhel-7)
- [CentOS and RHEL 8](#centos-and-rhel-8)
- [Fedora 31](#fedora-31)
- [Fedora 32](#fedora-32)
- [Fedora 33](#fedora-33)
- [Fedora 34](#fedora-34)
- [macOS](https://github.com/libkafe/homebrew-kafe)

See [releases](https://github.com/libkafe/kafe/releases) for all available downloads and historic versions,
including development headers.

See [Homebrew tap](https://github.com/libkafe/homebrew-kafe) for how to install Kafe on macOS.

*NOTE:* macOS is supported, but there are no binary builds available. See [README](./README.md#building-on-macos)
on how to build macOS binaries from source.

*NOTE:* You should be able to use these binary packages for any derivative distributions too. For example,
Elementary OS 5.1 users can use Ubuntu 18.04 packages, since Elementary OS 5.1 is based on Ubuntu 18.04.

Expand Down Expand Up @@ -135,6 +134,20 @@ apt update && apt -y install kafe-cli
kafe about
```

#### Ubuntu 21.04

```shell script
# Setup Kafe repository signing key
apt-key adv --keyserver keyserver.ubuntu.com --recv AEE35447B5D3E4A69860622702F762CA6730E6A7
# Setup repository
echo 'deb https://dl.cloudsmith.io/public/kafe/libkafe/deb/ubuntu hirsute main' | \
tee /etc/apt/sources.list.d/kafe.list
# Update APT package lists and install kafe-cli
apt update && apt -y install kafe-cli
# Print about
kafe about
```

#### CentOS and RHEL 7

**IMPORTANT:** Kafe requires Lua version 5.3, a dependency not available in EL7 by default. You can either
Expand Down Expand Up @@ -195,3 +208,14 @@ dnf install -y kafe-cli
# Print about
kafe about
```

#### Fedora 34

```shell script
# Setup repository
curl -1sLf 'https://dl.cloudsmith.io/public/kafe/libkafe/cfg/setup/bash.rpm.sh' | distro=fedora codename=34 bash
# Install kafe-cli
dnf install -y kafe-cli
# Print about
kafe about
```
32 changes: 8 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,20 @@ remote systems administration tasks.

See [available package downloads and repositories](DOWNLOAD.md).

Binary builds are available for:
You can easily install and use libkafe on following operating systems:

- **CentOS** and **RHEL** versions [7<sup>1</sup>](./DOWNLOAD.md#centos-and-rhel-7), [8](./DOWNLOAD.md#centos-and-rhel-8)
- **Fedora** versions [31](./DOWNLOAD.md#fedora-31), [32](./DOWNLOAD.md#fedora-32), [33](./DOWNLOAD.md#fedora-33)
- **Ubuntu** versions [18.04](./DOWNLOAD.md#ubuntu-1804), [19.10](./DOWNLOAD.md#ubuntu-1910), [20.04](./DOWNLOAD.md#ubuntu-2004), [20.10](./DOWNLOAD.md#ubuntu-2010)
- **Fedora** versions [31](./DOWNLOAD.md#fedora-31), [32](./DOWNLOAD.md#fedora-32), [33](./DOWNLOAD.md#fedora-33), [34](./DOWNLOAD.md#fedora-34)
- **Ubuntu** versions [18.04](./DOWNLOAD.md#ubuntu-1804), [19.10](./DOWNLOAD.md#ubuntu-1910), [20.04](./DOWNLOAD.md#ubuntu-2004), [20.10](./DOWNLOAD.md#ubuntu-2010), [21.04](./DOWNLOAD.md#ubuntu-2104)
- **Debian** versions [9](./DOWNLOAD.md#debian-9), [10](./DOWNLOAD.md#debian-10), [11](./DOWNLOAD.md#debian-11)

You should be able to use these binary packages for any derivative distributions.
For example, Elementary OS 5.1 users can use Ubuntu 18.04 packages, since Elementary OS 5.1 is based on Ubuntu 18.04.

**macOS is officially supported** - Kafe can be installed compiling from source (see bellow) or using
[Homebrew vendor tap](https://github.com/libkafe/homebrew-kafe).
- **macOS** versions 10.5 (Catalina), 11 (Big Sur) using [Homebrew vendor tap](https://github.com/libkafe/homebrew-kafe).

<sup>1</sup> - EL7 does not ship with Lua 5.3. We currently use
[Cheese](http://www.nosuchhost.net/~cheese/fedora/packages/epel-7/x86_64/cheese-release.html) repository
to obtain Lua 5.3 on EL7.

Installing a binary build is easy - download the binary packages from [releases](https://github.com/libkafe/kafe/releases)
and install using your operating systems package manager. You will need to download both `kafe-cli` and `libkafe`
artifacts. You do not need to install `libkafe-dev` unless you aim to embed libkafe.

You can also build the sources locally using `CMake`. See bellow for instructions to build from source.
You can also install libkafe building from sources locally using `CMake` - provided all dependencies are met,
you should be able to build libkafe on nearly any Linux operating system. See bellow for instructions to build from source.

## Writing Kafe scripts

Expand Down Expand Up @@ -213,20 +205,13 @@ with C++ development headers made available for embedding (libkafe-dev).
## Operating system support

Kafe should work with any UNIX-like operating system, provided all external dependencies are met.
Binary packages are provided for:

- **CentOS** and **RHEL** versions 7, 8
- **Fedora** versions 31, 32, 33
- **Ubuntu** versions 18.04, 19.10, 20.04
- **Debian** versions 9, 10, 11
- **macOS** versions 10.15 Catalina

Windows is not supported and there are no plans to support Windows builds. Windows users
should be able to use Windows Subsystem for Linux to run or build Kafe. Take note that contributions
and issues related to support for Windows will not be accepted.

macOS is officially supported for versions 10.15 Catalina and newer. It is entirely possible Kafe works just
fine on older versions of macOS, but no testing has been done on them. If you are unable to upgrade
macOS is officially supported starting from version 10.15 Catalina. It is entirely possible Kafe works just
fine on older versions of macOS, but no testing has been done. If you are unable to upgrade
to latest macOS version, you should still try to install Kafe from sources. It will most likely work
just fine provided all external dependencies are met.

Expand Down Expand Up @@ -317,7 +302,6 @@ feature complete and no new features will be added to this API level.
Scripting API level 2 will incorporate more features to simplify application deployment and systems operations. Following
is planned for level 2 expansion:

- `.kafeignore` support for archive and directory operations.
- Local and remote file system utility functions, expanded standard operations library.
- Subset of Git features to streamline working with repositories (cloning, pulling, pushing, tagging, reading tags, releases...).
- Simplistic CURL based HTTP client (basic requests, file uploads and downloads).
Expand Down
22 changes: 22 additions & 0 deletions build-dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,17 @@ cp build/ubuntu/2010/kafe-cli*.deb build-artifact/ubuntu-2010/
cp build/ubuntu/2010/libkafe*.deb build-artifact/ubuntu-2010/
for f in build-artifact/ubuntu-2010/*; do mv -v "$f" $(echo "$f" | sed "s/\.deb/\.ubu2010\.deb/"); done

# Ubuntu 21.04
if [[ "$(docker images -q "kafe/ubuntu:2104-build" 2> /dev/null)" == "" ]]; then
docker build -t kafe/ubuntu:2104-build dist/ubuntu/2104
fi

docker run -it --rm -v `pwd`:/kafe kafe/ubuntu:2104-build
mkdir -p build-artifact/ubuntu-2104/
cp build/ubuntu/2104/kafe-cli*.deb build-artifact/ubuntu-2104/
cp build/ubuntu/2104/libkafe*.deb build-artifact/ubuntu-2104/
for f in build-artifact/ubuntu-2104/*; do mv -v "$f" $(echo "$f" | sed "s/\.deb/\.ubu2104\.deb/"); done

# Fedora 31
if [[ "$(docker images -q "kafe/fedora:31-build" 2> /dev/null)" == "" ]]; then
docker build -t kafe/fedora:31-build dist/fedora/31
Expand Down Expand Up @@ -137,3 +148,14 @@ mkdir -p build-artifact/fedora-33/
cp build/fedora/33/kafe-cli-*.rpm build-artifact/fedora-33/
cp build/fedora/33/libkafe-*.rpm build-artifact/fedora-33/
for f in build-artifact/fedora-33/*; do mv -v "$f" $(echo "$f" | sed "s/\.rpm/\.f33\.rpm/"); done

# Fedora 34
if [[ "$(docker images -q "kafe/fedora:34-build" 2> /dev/null)" == "" ]]; then
docker build -t kafe/fedora:34-build dist/fedora/34
fi

docker run -it --rm -v `pwd`:/kafe kafe/fedora:34-build
mkdir -p build-artifact/fedora-34/
cp build/fedora/34/kafe-cli-*.rpm build-artifact/fedora-34/
cp build/fedora/34/libkafe-*.rpm build-artifact/fedora-34/
for f in build-artifact/fedora-34/*; do mv -v "$f" $(echo "$f" | sed "s/\.rpm/\.f34\.rpm/"); done
19 changes: 19 additions & 0 deletions dist/fedora/34/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM fedora:34

RUN yum -y update && \
yum -y install \
make \
rpm-build \
wget \
clang \
cmake \
lua-devel \
libcurl-devel \
libarchive-devel \
libssh-devel \
libgit2-devel

ENV CC /usr/bin/clang-11
ENV CXX /usr/bin/clang++-11

CMD /kafe/dist/fedora/34/build-dist.sh
44 changes: 44 additions & 0 deletions dist/fedora/34/build-dist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env bash
set -e

# Clean existing build workspace
rm -rf /kafe/build/fedora/34 2> /dev/null

# Create build workspace
mkdir -p /kafe/build/fedora/34/

# Warp to build workspace
cd /kafe/build/fedora/34/

# Prepare build
cmake -DCMAKE_BUILD_TYPE=Release -DCPACK_GENERATOR=RPM ../../../

# Compile project
make

# Package project
cpack

# Test install
rpm -i ./kafe-cli*.rpm ./libkafe*.rpm
env kafe about

# Fix permissions
cd /

WHO=/kafe/

stat $WHO > /dev/null || (echo You must mount a file to "$WHO" in order to properly assume user && exit 1)

USERID=$(stat -c %u $WHO)
GROUPID=$(stat -c %g $WHO)

if [ "$USERID" -eq "0" ]; then
USERID=1000
fi

if [ "$GROUPID" -eq "0" ]; then
GROUPID=1000
fi

chown -Rf $USERID:$GROUPID /kafe/build
19 changes: 19 additions & 0 deletions dist/ubuntu/2104/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM ubuntu:21.04

RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
wget \
cmake \
build-essential \
clang-11 \
liblua5.3-dev \
libcurl4-gnutls-dev \
libarchive-dev \
libssh-dev \
libgit2-dev

ENV CC /usr/bin/clang-11
ENV CXX /usr/bin/clang++-11

CMD /kafe/dist/ubuntu/2104/build-dist.sh
44 changes: 44 additions & 0 deletions dist/ubuntu/2104/build-dist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env bash
set -e

# Clean existing build workspace
rm -rf /kafe/build/ubuntu/2104 2> /dev/null

# Create build workspace
mkdir -p /kafe/build/ubuntu/2104/

# Warp to build workspace
cd /kafe/build/ubuntu/2104/

# Prepare build
cmake -DCMAKE_BUILD_TYPE=Release -DCPACK_GENERATOR=DEB ../../../

# Compile project
make

# Package project
cpack

# Test install
apt-get install -y ./kafe-cli*.deb ./libkafe*.deb
env kafe about

# Fix permissions
cd /

WHO=/kafe/

stat $WHO > /dev/null || (echo You must mount a file to "$WHO" in order to properly assume user && exit 1)

USERID=$(stat -c %u $WHO)
GROUPID=$(stat -c %g $WHO)

if [ "$USERID" -eq "0" ]; then
USERID=1000
fi

if [ "$GROUPID" -eq "0" ]; then
GROUPID=1000
fi

chown -Rf $USERID:$GROUPID /kafe/build
8 changes: 8 additions & 0 deletions publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ cloudsmith push deb kafe/libkafe/ubuntu/groovy build-artifact/ubuntu-2010/kafe-c
cloudsmith push deb kafe/libkafe/ubuntu/groovy build-artifact/ubuntu-2010/libkafe_1.1.3_amd64.ubu2010.deb
cloudsmith push deb kafe/libkafe/ubuntu/groovy build-artifact/ubuntu-2010/libkafe-dev_1.1.3_amd64.ubu2010.deb

cloudsmith push deb kafe/libkafe/ubuntu/hirsute build-artifact/ubuntu-2104/kafe-cli_1.1.3_amd64.ubu2104.deb
cloudsmith push deb kafe/libkafe/ubuntu/hirsute build-artifact/ubuntu-2104/libkafe_1.1.3_amd64.ubu2104.deb
cloudsmith push deb kafe/libkafe/ubuntu/hirsute build-artifact/ubuntu-2104/libkafe-dev_1.1.3_amd64.ubu2104.deb

# Fedora
cloudsmith push rpm kafe/libkafe/fedora/31 build-artifact/fedora-31/kafe-cli-1.1.3-1.x86_64.f31.rpm
cloudsmith push rpm kafe/libkafe/fedora/31 build-artifact/fedora-31/libkafe-1.1.3-1.x86_64.f31.rpm
Expand All @@ -51,3 +55,7 @@ cloudsmith push rpm kafe/libkafe/fedora/32 build-artifact/fedora-32/libkafe-deve
cloudsmith push rpm kafe/libkafe/fedora/33 build-artifact/fedora-33/kafe-cli-1.1.3-1.x86_64.f33.rpm
cloudsmith push rpm kafe/libkafe/fedora/33 build-artifact/fedora-33/libkafe-1.1.3-1.x86_64.f33.rpm
cloudsmith push rpm kafe/libkafe/fedora/33 build-artifact/fedora-33/libkafe-devel-1.1.3-1.x86_64.f33.rpm

cloudsmith push rpm kafe/libkafe/fedora/34 build-artifact/fedora-34/kafe-cli-1.1.3-1.x86_64.f34.rpm
cloudsmith push rpm kafe/libkafe/fedora/34 build-artifact/fedora-34/libkafe-1.1.3-1.x86_64.f34.rpm
cloudsmith push rpm kafe/libkafe/fedora/34 build-artifact/fedora-34/libkafe-devel-1.1.3-1.x86_64.f34.rpm

0 comments on commit 25c6c5c

Please sign in to comment.