File: Dockerfile

package info (click to toggle)
libcotp 3.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 204 kB
  • sloc: ansic: 1,264; sh: 5; makefile: 3
file content (34 lines) | stat: -rw-r--r-- 930 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM archlinux:latest

ARG BRANCH=master

COPY PKGBUILD /tmp/PKGBUILD

RUN pacman -Syu --noconfirm ; \
    pacman -S gcc git clang cmake pkg-config libgcrypt fakeroot sudo --noconfirm ; \
    pacman -S base-devel --noconfirm

RUN useradd -m -G wheel -s /bin/bash test ; \
    cp /tmp/PKGBUILD /home/test/ && chown test:test /home/test/PKGBUILD ; \
    sed -i 's/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) NOPASSWD: ALL/' /etc/sudoers

USER test
RUN cd /home/test && makepkg

USER root
RUN pacman -U /home/test/*zst --noconfirm

USER test
RUN yay -S criterion --noconfirm ; \
    gpg --keyserver pool.sks-keyservers.net --recv-keys 4EC1EA64 ; \
    yay -S libbaseencode --noconfirm

USER root
RUN git clone https://github.com/paolostivanin/libcotp -b $BRANCH ; \
    cd libcotp ; \
    mkdir build && cd $_ ; \
    cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTING=ON ; \
    make -j2 ;\
    ./tests/test_cotp ;\
    make install