Skip to content

Commit

Permalink
provision: move random.so into standalone rpm
Browse files Browse the repository at this point in the history
To avoid pulling in build dependencies in minimal testing environment.
  • Loading branch information
pbrezina committed Aug 10, 2023
1 parent ab26cca commit 9486575
Show file tree
Hide file tree
Showing 10 changed files with 256 additions and 181 deletions.
3 changes: 3 additions & 0 deletions .copr/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
srpm:
make -C ./src/rpms srpm
[ -n "$(outdir)" ] && cp ./rpmbuild/SRPMS/* "$(outdir)" || :
35 changes: 35 additions & 0 deletions .github/workflows/rpms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build RPMs
on:
push:
branches:
- master
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
rpms:
runs-on: ubuntu-latest
container:
image: fedora:38
permissions:
contents: read
steps:
- uses: actions/checkout@v3

- name: Install dependencies
shell: bash
working-directory: ./src/rpms
run: |
dnf install -y rpm-build dnf-plugins-core
dnf build-dep -y ./ci-sssd.spec
- name: Build srpm
shell: bash
working-directory: ./src/rpms
run: make srpm

- name: Build rpms
shell: bash
working-directory: ./src/rpms
run: make rpms
10 changes: 2 additions & 8 deletions src/ansible/playbook_image_service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,13 @@
gather_facts: no
roles:
- ipa
- { role: passkey, when: ansible_distribution == "Ubuntu" or ansible_distribution == "Debian" }

- hosts: client.test
gather_facts: no
roles:
- client

- hosts: client.test, master.ipa.test
gather_facts: no
tasks:
- name: Include passkey
include_role:
name: passkey
when: passkey_support
- { role: passkey, when: ansible_distribution == "Ubuntu" or ansible_distribution == "Debian" }

- hosts: nfs.test
gather_facts: no
Expand Down
4 changes: 0 additions & 4 deletions src/ansible/roles/packages/tasks/CentOS8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
name:
- epel-release

- name: Install @sssd/ci-deps repositories
shell: |
dnf copr enable -y @sssd/ci-deps centos-stream-8
- name: Enable IdM module
shell: |
dnf module enable -y idm:DL1
Expand Down
10 changes: 0 additions & 10 deletions src/ansible/roles/packages/tasks/CentOS9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@
set -ex
rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-9
dnf install --setopt=install_weak_deps=False -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
dnf copr enable -y @sssd/ci-deps centos-stream-9
# Required until https://pagure.io/copr/copr/issue/2106 gets fixed
- name: Disable gpgcheck for @sssd/cli-deps
ini_file:
path: '/etc/yum.repos.d/_copr:copr.fedorainfracloud.org:group_sssd:ci-deps.repo'
section: 'copr:copr.fedorainfracloud.org:group_sssd:ci-deps'
option: 'gpgcheck'
value: 'false'
mode: 0644
when: "'base_ground' in group_names"

- name: 'Packages are the same as in Fedora'
Expand Down
7 changes: 5 additions & 2 deletions src/ansible/roles/packages/tasks/Fedora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
name:
- dnf-plugins-core

- name: Install @sssd/ci-deps repositories
shell: |
dnf copr enable -y @sssd/ci-deps
- name: Install systemd and minimal set of packages
dnf:
state: present
Expand Down Expand Up @@ -175,8 +179,7 @@
dnf:
state: present
name:
- gcc
- openssl-devel
- ci-sssd-random
- umockdev
when: passkey_support
when: "'base_client' in group_names or 'client' in group_names or 'base_ipa' in group_names or 'ipa' in group_names"
Expand Down
157 changes: 0 additions & 157 deletions src/ansible/roles/passkey/files/random.c

This file was deleted.

1 change: 1 addition & 0 deletions src/ansible/roles/passkey/files/random.c
17 changes: 17 additions & 0 deletions src/rpms/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
prep:
mkdir -p $(PWD)/rpmbuild/BUILD
mkdir -p $(PWD)/rpmbuild/RPMS
mkdir -p $(PWD)/rpmbuild/SOURCES
mkdir -p $(PWD)/rpmbuild/SPECS
mkdir -p $(PWD)/rpmbuild/SRPMS
cp random.c $(PWD)/rpmbuild/SOURCES
cp ci-sssd.spec $(PWD)/rpmbuild/SPECS

srpm: prep
rpmbuild --define "_topdir $(PWD)/rpmbuild" -bs ci-sssd.spec

rpms: prep
rpmbuild --define "_topdir $(PWD)/rpmbuild" -ba ci-sssd.spec

clean:
rm -fr $(PWD)/rpmbuild
36 changes: 36 additions & 0 deletions src/rpms/ci-sssd.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Name: ci-sssd
Version: 1
Release: 1%{?dist}
Summary: SSSD CI Packages
URL: https://github.com/SSSD/sssd-ci-containers

License: GPLv3+
Source0: random.c

BuildRequires: gcc
BuildRequires: openssl-devel

%description
SSSD CI Packages. For testing purpose only.

%prep

%build
gcc -fPIC -shared -o random.so %{SOURCE0} -lcrypto

%install
mkdir -p %{buildroot}/opt
cp random.so %{buildroot}/opt/random.so

%package random
Summary: random.so for passkey testing.

%description random
random.so for passkey testing.

%files random
/opt/random.so

%changelog
* Thu Jul 20 2023 SSSD Team <[email protected]> - 1.0.0-1
- Test package release.
Loading

0 comments on commit 9486575

Please sign in to comment.