1 |
# $Header: /magellan-cvs/smage/include/mtools.sminc,v 1.39 2008/04/20 08:28:23 niro Exp $ |
# $Id$ |
2 |
# some special build tools |
# some special build tools |
3 |
|
|
4 |
# automatical inherit mtools.minc |
# automatical inherit mtools.minc |
150 |
{ |
{ |
151 |
local udevrule |
local udevrule |
152 |
local file |
local file |
153 |
|
local udevrulesddir="/usr/lib/udev/rules.d" |
154 |
|
|
155 |
[[ -z "$1" ]] && die "No udev rule given" |
[[ -z "$1" ]] && die "No udev rule given" |
156 |
|
|
170 |
fi |
fi |
171 |
|
|
172 |
# needed directory |
# needed directory |
173 |
install -d ${BINDIR}/lib/udev/rules.d || die |
install -d ${BINDIR}${udevrulesddir} || die |
174 |
|
|
175 |
# install our udev rule |
# install our udev rule |
176 |
install -v -m 0644 -o root -g root ${file} ${BINDIR}/lib/udev/rules.d/${udevrule} || die |
install -v -m 0644 -o root -g root ${file} ${BINDIR}${udevrulesddir}/${udevrule} || die |
177 |
} |
} |
178 |
|
|
179 |
minstalludevhelper() |
minstalludevhelper() |
180 |
{ |
{ |
181 |
local udevhelper |
local udevhelper |
182 |
local file |
local file |
183 |
|
local udevdir="/usr/lib/udev" |
184 |
|
|
185 |
[[ -z "$1" ]] && die "No udev helper given" |
[[ -z "$1" ]] && die "No udev helper given" |
186 |
|
|
200 |
fi |
fi |
201 |
|
|
202 |
# needed directory |
# needed directory |
203 |
install -d ${BINDIR}/lib/udev || die |
install -d ${BINDIR}${udevdir} || die |
204 |
|
|
205 |
# install our udev-helper |
# install our udev-helper |
206 |
install -v -m 0755 -o root -g root ${file} ${BINDIR}/lib/udev/${udevhelper} || die |
install -v -m 0755 -o root -g root ${file} ${BINDIR}${udevdir}/${udevhelper} || die |
207 |
} |
} |
208 |
|
|
209 |
minstallhalinformation() |
minstallhalinformation() |
589 |
local dest |
local dest |
590 |
local verbose="-v" |
local verbose="-v" |
591 |
|
|
592 |
# check for busybox as it doesn'tz support 'ln -v' |
# check for busybox as it doesn't support 'ln -v' |
593 |
[[ $(readlink $(which ln)) = */busybox ]] && verbose="" |
[[ $(readlink $(which ln)) = */busybox ]] && verbose="" |
594 |
|
|
595 |
[[ -z $1 ]] && die "No file given" |
[[ -z $1 ]] && die "No file given" |
616 |
# install our library |
# install our library |
617 |
install -v -m 0755 -o root -g root ${file} ${BINDIR}/${dest} || die |
install -v -m 0755 -o root -g root ${file} ${BINDIR}/${dest} || die |
618 |
|
|
619 |
# create libtool symlinks |
# prefer scanelf |
620 |
# 1. - library.so.1.0.0 -> library.so.1.0 |
if [[ -x $(type -P scanelf) ]] |
|
if [ "${file%.*}" != *.so ] |
|
|
then |
|
|
ln ${verbose} -snf $(basename ${file}) ${BINDIR}/${dest}/$(basename ${file%.*}) |
|
|
fi |
|
|
# 2. - library.so.1.0.0 -> library.so.1 |
|
|
if [ "${file%.*.*}" != *.so ] |
|
621 |
then |
then |
622 |
ln ${verbose} -snf $(basename ${file}) ${BINDIR}/${dest}/$(basename ${file%.*.*}) |
local soname="$(scanelf -SB ${file} | cut -d' ' -f2)" |
623 |
|
ln ${verbose} -snf $(basename ${file}) ${BINDIR}/${dest}/${soname} || die |
624 |
|
else |
625 |
|
echo -e "${COLYELLOW}minstalllib(): Warning: scanelf not found, using fallback symlink method${COLDEFAULT}" |
626 |
|
|
627 |
|
# create libtool symlinks |
628 |
|
# 1. - library.so.1.0.0 -> library.so.1.0 |
629 |
|
if [ "${file%.*}" != *.so ] |
630 |
|
then |
631 |
|
ln ${verbose} -snf $(basename ${file}) ${BINDIR}/${dest}/$(basename ${file%.*}) || die |
632 |
|
fi |
633 |
|
# 2. - library.so.1.0.0 -> library.so.1 |
634 |
|
if [ "${file%.*.*}" != *.so ] |
635 |
|
then |
636 |
|
ln ${verbose} -snf $(basename ${file}) ${BINDIR}/${dest}/$(basename ${file%.*.*}) || die |
637 |
|
fi |
638 |
|
# 3. - library.so.1.0.0.0 -> library.so.1 |
639 |
|
if [ "${file%.*.*.*}" != *.so ] |
640 |
|
then |
641 |
|
ln ${verbose} -snf $(basename ${file}) ${BINDIR}/${dest}/$(basename ${file%.*.*.*}) || die |
642 |
|
fi |
643 |
fi |
fi |
644 |
} |
} |
645 |
|
|
698 |
fi |
fi |
699 |
|
|
700 |
[[ -z ${dest} ]] && die "No dest given." |
[[ -z ${dest} ]] && die "No dest given." |
701 |
[[ -e ${dest} ]] && die "Dest does not exist." |
[[ ! -e ${BINDIR}/${dest} ]] && die "${BINDIR}/${dest} does not exist." |
702 |
|
|
703 |
rm -v ${opts} ${BINDIR}/${dest} || die |
rm -v ${opts} ${BINDIR}/${dest} || die |
704 |
} |
} |
810 |
{ |
{ |
811 |
local unit |
local unit |
812 |
local file |
local file |
813 |
local prefix |
local systemdunitdir="/usr/lib/systemd/system" |
814 |
|
|
815 |
[[ -z "$1" ]] && die "No unit given" |
[[ -z "$1" ]] && die "No unit given" |
816 |
|
|
|
# get the right prefix for newer systemd |
|
|
[[ -x /bin/systemctl ]] && prefix="" |
|
|
[[ -x /usr/bin/systemctl ]] && prefix="/usr" |
|
|
|
|
817 |
# if no fullpath given use file from sourcedir |
# if no fullpath given use file from sourcedir |
818 |
if [[ -z $(dirname $1) ]] || [[ $(dirname $1) = . ]] |
if [[ -z $(dirname $1) ]] || [[ $(dirname $1) = . ]] |
819 |
then |
then |
830 |
fi |
fi |
831 |
|
|
832 |
# needed directory |
# needed directory |
833 |
install -d ${BINDIR}${prefix}/lib/systemd/system || die |
install -d ${BINDIR}${prefix}${systemdunitdir} || die |
834 |
|
|
835 |
# install our initscript |
# install our initscript |
836 |
install -v -m 0644 -o root -g root ${file} ${BINDIR}${prefix}/lib/systemd/system/${unit} || die |
install -v -m 0644 -o root -g root ${file} ${BINDIR}${prefix}${systemdunitdir}/${unit} || die |
837 |
} |
} |
838 |
|
|
839 |
# installs systemd tmp configs to /etc/tmpfiles.d |
# installs systemd tmp configs to /etc/tmpfiles.d |