-
Notifications
You must be signed in to change notification settings - Fork 352
/
rpmdevel.at
74 lines (61 loc) · 1.71 KB
/
rpmdevel.at
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
AT_BANNER([Rpm development])
AT_SETUP([rpm API user])
AT_KEYWORDS([devel])
cat << EOF > CMakeLists.txt
cmake_minimum_required(VERSION 3.18)
project(trpm VERSION 1.0 DESCRIPTION "test rpm API" LANGUAGES C)
find_package(rpm REQUIRED)
add_executable(trpm trpm.c)
target_link_libraries(trpm PRIVATE rpm::librpm)
EOF
cat << EOF > trpm.c
#include <stdio.h>
#include <rpm/rpmlib.h>
int main(int argc, char *argv[])
{
int rc = rpmReadConfigFiles(NULL, NULL);
printf("%s: %d\n", RPMVERSION, rc);
rpmFreeRpmrc();
return rc;
}
EOF
cmake . && make
RPMTEST_CHECK([[
LD_PRELOAD=${ASANLIB} ./trpm
]],
[0],
[AT_PACKAGE_VERSION: 0]
)
RPMTEST_CLEANUP
AT_SETUP([rpm plugin development])
AT_KEYWORDS([devel])
RPMDB_INIT
runroot rpmbuild --quiet -bb \
/data/SPECS/simple.spec \
/data/SPECS/fakeshell.spec
runroot rpm -U /build/RPMS/noarch/fakeshell-1.0-1.noarch.rpm
cmake /data/debugplugin && make && make install DESTDIR=${RPMTEST}
RPMTEST_CHECK([
runroot rpm -U /build/RPMS/noarch/simple-1.0-1.noarch.rpm
],
[0],
[],
[debug_init
debug_tsm_pre
debug_psm_pre: simple-1.0-1.noarch
debug_fsm_file_pre: /opt/bin 40755 80000001
debug_fsm_file_prepare: 1 /opt/bin /opt/bin 40755 80000001
debug_fsm_file_post: /opt/bin 40755 80000001: 0
debug_fsm_file_pre: /opt/bin/simple /opt/bin/simple; 100755 1
debug_fsm_file_prepare: /opt/bin/simple 1 /opt/bin/simple; /opt/bin/simple 100755 1
debug_fsm_file_post: /opt/bin/simple /opt/bin/simple 100755 1: 0
debug_scriptlet_pre: %post(simple-1.0-1.noarch) 3
debug_scriptlet_fork_post: /bin/sh 3
debug_scriptlet_post: %post(simple-1.0-1.noarch) 3: 0
debug_psm_post: simple-1.0-1.noarch:0
debug_psm_pre: simple-1.0-1.noarch
debug_psm_post: simple-1.0-1.noarch:0
debug_tsm_post: 0
debug_cleanup
])
RPMTEST_CLEANUP