/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to initramfs-tools-hook

  • Committer: Teddy Hogeborn
  • Date: 2013-10-28 08:38:47 UTC
  • Revision ID: teddy@recompile.se-20131028083847-cper3srg5o29r2ge
Use architecture libdir.

Instead of always using /usr/lib/mandos, use whatever the architecture
specifies, like /usr/lib/x86_64-linux-gnu/mandos or /usr/lib64/mandos.
Still use /usr/lib/mandos as a fallback.

* Makefile (LIBDIR): New.
 (install-client-nokey, uninstall-client): Use LIBDIR instead of
                                           $(PREFIX)/lib.
* initramfs-tools-hook: Detect correct libdir and copy from there.

Reported-by: Nathanael D. Noblet <nathanael@gnat.ca>
Suggested-by: Nathanael D. Noblet <nathanael@gnat.ca>

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
. /usr/share/initramfs-tools/hook-functions
31
31
 
32
 
for d in /usr /usr/local; do
33
 
    if [ -d "$d"/lib/mandos ]; then
34
 
        prefix="$d"
 
32
for d in /usr/lib \
 
33
    "/usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null`" \
 
34
    "`rpm --eval='%{_libdir}' 2>/dev/null`" /usr/local/lib; do
 
35
    if [ -d "$d"/mandos ]; then
 
36
        libdir="$d"
35
37
        break
36
38
    fi
37
39
done
38
 
if [ -z "$prefix" ]; then
 
40
if [ -z "$libdir" ]; then
39
41
    # Mandos not found
40
42
    exit 1
41
43
fi
77
79
    --mode=u=rwx "${DESTDIR}${PLUGINDIR}"
78
80
 
79
81
# Copy the Mandos plugin runner
80
 
copy_exec "$prefix"/lib/mandos/plugin-runner "${MANDOSDIR}"
 
82
copy_exec "$libdir"/mandos/plugin-runner "${MANDOSDIR}"
81
83
 
82
84
# Copy the plugins
83
85
 
84
86
# Copy the packaged plugins
85
 
for file in "$prefix"/lib/mandos/plugins.d/*; do
 
87
for file in "$libdir"/mandos/plugins.d/*; do
86
88
    base="`basename \"$file\"`"
87
89
    # Is this plugin overridden?
88
90
    if [ -e "/etc/mandos/plugins.d/$base" ]; then