Skip to content

Commit d7b78bc

Browse files
committed
Improved UX of executing oscap right after compilation.
* Introduced the oscap_wrapper script that contains the compiled oscap invocation. * Improved comments of the run script, to make it's usage more explicit.
1 parent a9a8319 commit d7b78bc

File tree

3 files changed

+43
-3
lines changed

3 files changed

+43
-3
lines changed

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,13 @@ add_subdirectory("schemas")
494494
add_subdirectory("xsl")
495495
add_subdirectory("cpe")
496496
add_subdirectory("swig")
497-
configure_file("run.in" "run" @ONLY)
497+
configure_file("run.in" ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/run @ONLY)
498+
configure_file("oscap_wrapper.in" ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/oscap_wrapper @ONLY)
499+
file(
500+
COPY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/run" "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/oscap_wrapper"
501+
DESTINATION ${CMAKE_BINARY_DIR}
502+
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
503+
)
498504

499505
if(NOT WIN32)
500506
# pkgconfig file

oscap_wrapper.in

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash -
2+
# openscap 'run' programs locally script
3+
# Copyright (C) 2011-2013 Red Hat Inc.
4+
#
5+
# This library is free software; you can redistribute it and/or
6+
# modify it under the terms of the GNU Lesser General Public
7+
# License as published by the Free Software Foundation; either
8+
# version 2 of the License, or (at your option) any later version.
9+
#
10+
# This library is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
# Lesser General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU Lesser General Public
16+
# License along with this library; if not, write to the Free Software
17+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18+
19+
#----------------------------------------------------------------------
20+
21+
# With this script you can run oscap without needing to
22+
# install the utility first. You just have to do for example:
23+
#
24+
# ./oscap_wrapper [oscap args ...]
25+
#
26+
# This works for any C program or test that uses the openscap
27+
# libraries.
28+
29+
#----------------------------------------------------------------------
30+
31+
# Build directory
32+
b=@CMAKE_BINARY_DIR@
33+
34+
"$b/run" "$b/utils/oscap" "$@"

run.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818

1919
#----------------------------------------------------------------------
2020

21-
# With this script you can run oscap without needing to
21+
# With this script you can run oscap (or valgrind, gdb, ...) without needing to
2222
# install the utility first. You just have to do for example:
2323
#
24-
# ./run ./utils/oscap [args ...]
24+
# ./run program [program args ...]
2525
#
2626
# This works for any C program or test that uses the openscap
2727
# libraries.

0 commit comments

Comments
 (0)