Skip to content

Commit

Permalink
Adjust SPEC to UsersAndGroups/#_dynamic_allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
kkaarreell committed Jan 15, 2025
1 parent cb0f879 commit 17fe787
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# build with
# $ rpmbuild -bb -D 'destdir /some/destination/dir' rpm-ima-sign-test.spec

Summary: This is the rpm-ima-sign-test package
Name: rpm-ima-sign-test
Version: 1
Release: 1
Group: System Environment/Base
License: GPL
BuildArch: noarch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Source0: rpm-ima-sign-test.sysusers
%{?sysusers_requires_compat}
%description

This is a rpm-ima-sign-test test package

%pre
%sysusers_create_compat %{SOURCE0}

%build
echo -e '#!/bin/bash\necho' > rpm-ima-sign-test-echo

%install
install -D -m 755 rpm-ima-sign-test-echo %{buildroot}/%{destdir}/rpm-ima-sign-test-echo

%files
%{destdir}/rpm-ima-sign-test-echo

%changelog
* Wed Jan 15 2025 Karel Srot <[email protected]> - 0.1-1
- Update packaging
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Type Name ID GECOS Home directory Shell
u limetester - "limetester user" /home/limetester /sbin/nologin
9 changes: 8 additions & 1 deletion functional/install-rpm-with-ima-signature/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ EOF
TESTDIR=`limeCreateTestDir`
rlRun "chmod a+rx ${TESTDIR}"
# build test rpm
rlRun -s "rpmbuild -bb -D 'destdir ${TESTDIR}' ${TEST_SRC_DIR}/rpm-ima-sign-test.spec"
DIST_SUFFIX=""
if rlIsFedora '>=42'; then
DIST_SUFFIX=.f42
rlRun "mkdir -p ~/rpmbuild/SOURCES"
rlRun "cp ${TEST_SRC_DIR}/rpm-ima-sign-test.sysusers ~/rpmbuild/SOURCES"
fi
rlRun -s "rpmbuild -bb -D 'destdir ${TESTDIR}' ${TEST_SRC_DIR}/rpm-ima-sign-test.spec${DIST_SUFFIX}"
RPM_PATH=$( awk '/Wrote:/ { print $2 }' $rlRun_LOG )
# generage GPG key for RPM signing
# add gpg key to rpm macros
Expand Down Expand Up @@ -141,6 +147,7 @@ _EOF"
rlFileRestore
limeExtendNextExcludelist ${TESTDIR}
#rlRun "rm -f $TESTDIR/keylime-bad-script.sh" # possible but not really necessary
rlRun "rm -f ~/rpmbuild/SOURCES/rpm-ima-sign-test.sysusers"
rlPhaseEnd

rlJournalEnd

0 comments on commit 17fe787

Please sign in to comment.