Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3601 from robaerd/cpack-rpm-packaging
Browse files Browse the repository at this point in the history
CPack RPM packaging
  • Loading branch information
mpranj authored Jan 12, 2021
2 parents d3868d5 + c5e708a commit 1d9c00e
Show file tree
Hide file tree
Showing 13 changed files with 995 additions and 486 deletions.
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ endif (CMAKE_VERSION VERSION_LESS 3.9)
set (CMAKE_MACOSX_RPATH 1)
set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")

set (
CMAKE_INSTALL_DEFAULT_COMPONENT_NAME
"elektra-misc"
CACHE STRING "Default component name" FORCE)
set (CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "elektra-misc")

# additional modules for loading libraries
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/scripts/cmake/Modules/")
Expand Down
115 changes: 77 additions & 38 deletions doc/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,32 @@ Kai-Uwe Behrmann kindly provides packages [for download](http://software.opensus

### Ubuntu-Bionic

To use the Ubuntu-Bionic packages, the following steps need to be made:
---

To use the Ubuntu Bionic repository of the latest builds from master following steps need to be made:

1. Run `sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D919CE8B27A64C16656FCA9FF1532673651F9C6C` to obtain the key.

2. Add `deb https://ubuntu-bionic-repo.libelektra.org/ bionic main` into `/etc/apt/sources.list`

3. `sudo apt-get update`
Which can also be done using:

### Debian
```sh
apt-get install software-properties-common apt-transport-https
echo "deb https://ubuntu-bionic-repo.libelektra.org/ bionic main" | sudo tee /etc/apt/sources.list.d/elektra.list
```

To use the debian repository of the latest builds from master put following lines in
`/etc/apt/sources.list`:
Or alternatively, you can use (if you do not mind many dependencies just to add one line to a config file):

```sh
sudo apt-get install software-properties-common apt-transport-https
sudo add-apt-repository "deb https://ubuntu-bionic-repo.libelektra.org/ bionic main"
```

### Debian-Buster

For Stretch:
To use the Debian Buster repository of the latest builds from master put following lines in
`/etc/apt/sources.list`:

```
deb [trusted=yes] https://debian-buster-repo.libelektra.org/ buster main
Expand All @@ -47,7 +59,7 @@ deb-src [trusted=yes] https://debian-buster-repo.libelektra.org/ buster main
Which can also be done using:

```sh
sudo apt-get install apt-transport-https
sudo apt-get install software-properties-common apt-transport-https
echo "deb [trusted=yes] https://debian-buster-repo.libelektra.org/ buster main" | sudo tee /etc/apt/sources.list.d/elektra.list
```

Expand All @@ -58,13 +70,16 @@ sudo apt-get install software-properties-common apt-transport-https
sudo add-apt-repository "deb [trusted=yes] https://debian-buster-repo.libelektra.org/ buster main"
```

For Jessie (not updated anymore, contains 0.8.24 packages which were created shortly before 0.8.25 release)
If you want to rebuild Elektra from Debian unstable or
our repositories, add a `deb-src` entry to `/etc/apt/sources.list`
and then run:

```
deb [trusted=yes] https://debian-stable.libelektra.org/elektra-stable/ jessie main
deb-src [trusted=yes] https://debian-stable.libelektra.org/elektra-stable/ jessie main
```sh
apt-get source -b elektra
```

### Install

To get all packaged plugins, bindings and tools install:

```sh
Expand All @@ -77,22 +92,12 @@ For a small installation with command-line tools available use:
apt-get install elektra-bin
```

If you want to rebuild Elektra from Debian unstable or
our repositories, add a `deb-src` entry to `/etc/apt/sources.list`
and then run:
To build Debian/Ubuntu Packages from the source you might want to use:

```sh
apt-get source -b elektra
```

To build Debian Packages from the source you might want to use:

```sh
dpkg-buildpackage -us -uc -sa
make package # See CPack below
```

(You need to be in the Debian branch, see [GIT](GIT.md))

## macOS

You can install Elektra using [Homebrew](http://brew.sh) via the shell command:
Expand All @@ -111,7 +116,55 @@ Please refer to the section OS Independent below.

First follow the steps in [COMPILE](COMPILE.md).

After you completed building Elektra on your own, there are multiple options how to install it. For example, with make or cPack tools.
After you completed building Elektra on your own, there are multiple options how to install it. For example, with make or CPack tools.
We recommend to use the packages from our build server or that you generate your own packages with CPack.

### CPack

The current supported systems are: Debian, Ubuntu and Fedora.

Then use:

```sh
make package
```

which will create packages for distributions where a Generator is implemented.

You can find the generated packages in the `package` directory of the build directory.

> NOTE: If all plugins/bindings/tools a package includes are excluded, the package will be not generated.
#### Debian/Ubuntu

On Debian based distributions you will need to set LD_LIBRARY_PATH before generating the package.
Simply `cd` into the build directory and run following command:

```sh
LD_LIBRARY_PATH=$(pwd)/lib:${LD_LIBRARY_PATH} make package
```

To install the packages run this in the `package` directory:

```sh
apt-get install ./*
```

If any dependency problems appear, run following command to install the missing dependencies:

```sh
apt-get -f install
```

#### Fedora

To install RPM packages we recommend using `yum localinstall` since installing with `rpm` doesn't resolve missing dependencies.

Run following command in the `package` directory:

```sh
yum localinstall *
```

### make

Expand All @@ -134,20 +187,6 @@ or in the build directory (will not honor `DESTDIR`!):
xargs rm < install_manifest.txt
```

### CPack

First follow the steps in [COMPILE](COMPILE.md).

Then use:

```sh
cpack
```

which should create a package for distributions where a Generator is
implemented. See [this cmake file](/scripts/cmake/ElektraPackaging.cmake) for available Generators
and send a merge request for your system.

## Troubleshooting

### Error Loading Libraries
Expand Down
7 changes: 4 additions & 3 deletions doc/news/_preparation_next_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ You can also read the news [on our website](https://www.libelektra.org/news/0.9.
## Highlights

- Important Changes to Keynames
- Debian Packaging with CPack
- Debian and Fedora Packaging with CPack
- <<HIGHLIGHT3>>

<a id="br-1"></a>
Expand Down Expand Up @@ -122,9 +122,10 @@ kdb upgrade pr3555 values

> _Note:_ The original `system:/elektra/mountpoints` data will be moved to `system:/elektra/mountpoints-backup`
### Debian Packaging with CPack
### Debian and Fedora Packaging with CPack

- We are now using CPack to generate modular Debian and Ubuntu packages. This simplifies the packaging process and solves problems where a PR that introduces changes to installed files, fails. We can now also set distribution specific dependencies with CPack, which is needed for some packages. _(Robert Sowula)_
- We are now using CPack to generate modular Debian and Ubuntu packages. This simplifies the packaging process and solves problems where a PR that introduces changes to installed files, fails. We can now also set distribution specifc dependencies with CPack, which is needed for some packages. _(Robert Sowula)_
- We now also generate RPM packages for Fedora. _(Robert Sowula)_

### <<HIGHLIGHT3>>

Expand Down
Loading

0 comments on commit 1d9c00e

Please sign in to comment.