Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37045511
en ru br
Репозитории ALT
5.1: 2.4.27-alt11
4.1: 2.4.27-alt11
4.0: 2.4.27-alt10
3.0: 2.4.27-alt4
www.altlinux.org/Changes

Группа :: Система/Ядро и оборудование
Пакет: modutils

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

%define mitver 3.1
%def_enable mit

Name: modutils
Version: 2.4.27
Release: alt10

Summary: Obsolete version of the kernel module utilities
License: GPL
Group: System/Kernel and hardware
Url: ftp://ftp.kernel.org/pub/linux/utils/kernel/modutils/v2.4
ExclusiveOS: Linux
Packager: Sergey Vlasov <vsu at altlinux.ru>

Source0: %url/modutils-%version.tar.bz2
Source1: modutils.macros
Source2: 00kernel.modutils
Source4: modules.conf

%if_enabled mit
Source5: http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/module-init-tools-%mitver.tar.bz2
%endif

Patch1: modutils-2.4.2-rh-prepost.patch
Patch2: modutils-2.4.27-rh-owl-syms.patch
Patch3: modutils-2.4.27-rh-versions.patch
Patch4: modutils-2.4.27-rh-showconfig.patch

Patch11: modutils-2.4.27-alt-aliases.patch
Patch12: modutils-2.4.27-alt-insmod-GPL.patch
Patch13: modutils-2.4.27-alt-modprobe-bL.patch
Patch14: modutils-2.4.27-alt-depmod-prtdepend-cut_prefix.patch
Patch15: modutils-2.4.27-alt-allowable-licenses.patch
Patch16: modutils-2.4.26-alt-kernelversion.patch
Patch18: modutils-2.4.25-alt-include.patch
Patch19: modutils-2.4.27-alt-insmod-force_load.patch
Patch21: modutils-2.4.25-alt-glob-sort.patch
Patch22: modutils-2.4.27-deb-alt-fixes.patch
Patch23: modutils-2.4.27-alt-warning-stderr.patch
Patch24: modutils-2.4.27-owl-warnings.patch

Patch101: module-init-tools-3.1-alt-release-memory.patch
Patch102: module-init-tools-3.1-alt-depmod-check-aliases.patch
Patch103: module-init-tools-3.1-alt-modinfo-legacy.patch
Patch120: modutils-2.4.27-alt-mit-combined.patch
Patch121: modutils-2.4.27-alt-doc.patch
Patch122: modutils-2.4.27-alt-no-builtin.patch

PreReq: module-init-tools >= 3.3
Requires(post): module-init-tools-compat >= 3.3
Requires(post): chkconfig, coreutils, mktemp, grep
Obsoletes: modules
# due to statically linked utilities
Conflicts: mkinitrd < 1:2.8.0-alt1
# due to %_sysconfdir/modutils.d/pcmcia
Conflicts: pcmcia-cs < 0:3.2.4-alt1

# Automatically added by buildreq on Thu Jan 06 2005

BuildRequires: docbook-utils flex zlib-devel

%description
The modutils packages includes the module management programs.  Examples
of loaded and unloaded modules are device drivers and filesystems,
as well as some other things.

THIS PACKAGE IS OBSOLETE.
It is needed only during conversion of the old configuration syntax to the
new format used by the module-init-tools package.  After performing the
conversion and upgrading old packages with dependencies on modutils
this package can be removed from the system together with the
module-init-tools-compat package.

%prep
%if_enabled mit
%setup -q -a4 -a5
%else
%setup -q -a4
%endif
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1

%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch18 -p1
%patch19 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1

%if_enabled mit
mv module-init-tools-%mitver module-init-tools
pushd module-init-tools
%patch101 -p1
%patch102 -p1
%patch103 -p1
popd
%patch120 -p1
%patch121 -p1
%patch122 -p1
%endif

find -type f -name \*.orig -delete
bzip2 -9k ChangeLog
chmod 755 insmod/kernelversion_*

%build
# gcc4.1 -fstrict-aliasing miscompiles obj/obj_reloc.c (#10768)
%add_optflags -fno-strict-aliasing
autoconf
%if_enabled mit
pushd module-init-tools
%configure --enable-zlib CPPFLAGS="-D_COMBINED_MODUTILS_=1"
%make_build combined
pushd doc
docbook2man modinfo.sgml
popd
popd
%endif

%configure \
--enable-zlib \
--with-dynamic-zlib \
--exec_prefix=/

%make_build dep all

%install
mkdir -p %buildroot/sbin
%makeinstall sbindir=%buildroot/sbin

install -pD -m644 %_sourcedir/modutils.macros %buildroot/lib/modutils/macros
install -pD -m644 %_sourcedir/modules.conf %buildroot%_sysconfdir/modules.conf
for f in %_sourcedir/00kernel.modutils; do
n="${f%%.modutils}"
install -pD -m644 "$f" "%buildroot%_sysconfdir/modutils.d/${n##*/}"
done

%if_enabled mit
install -pD -m644 module-init-tools/doc/modinfo.8 \
%buildroot%_man8dir/modinfo.8
%endif

ln -snf modules.conf.5 %buildroot%_man5dir/conf.modules.5

# Obsoleted by man-pages-2.25.

rm -rf %buildroot%_man2dir

# Rename utilities and man pages to *.old for use with module-init-tools.

for f in depmod insmod lsmod modinfo modprobe rmmod; do
mv %buildroot/sbin/$f %buildroot/sbin/$f.old
mv %buildroot%_man8dir/$f.8 %buildroot%_man8dir/$f.old.8
done
for f in kallsyms ksyms lsmod.old modprobe.old rmmod.old; do
ln -sf insmod.old %buildroot/sbin/$f
done

%post
[ $1 -ge 2 ] || exit 0

# Get rid of the old installations on upgrade.

if [ -x %_initdir/kerneld ]; then
/sbin/chkconfig --del kerneld
fi
if [ -e %_sysconfdir/conf.modules -a ! -e %_sysconfdir/modules.conf ]; then
%__mv -f %_sysconfdir/conf.modules %_sysconfdir/modules.conf
fi

/sbin/depmod -a ||:

# Convert modutils configuration to module-init-tools

new_config=%_sysconfdir/modprobe.d/local-autoconverted
[ -f $new_config ] || {
echo "Converting modutils configuration to module-init-tools..."
modules_conf=`mktemp -t modutils.XXXXXXXXXXX`
/sbin/modprobe.old -c >"$modules_conf"
for f in %_sysconfdir/modules.conf %_sysconfdir/modutils.d/*; do
[ "${f%%.rpm*}" = "$f" -a "${f%%\~}" = "$f" ] || continue
[ -r "$f" ] || continue
[ "$f" = %_sysconfdir/modutils.d/00kernel ] && continue ||:
name="${f#%_sysconfdir/modutils.d/}"
if [ "$name" = "$f" ]; then
out="$new_config"
else
out=%_sysconfdir/modprobe.d/"$name"
fi
if [ -f "$out" ]; then
fgrep -qs "# Auto-converted-from: $f" "$out" || {
cat >&2 <<EOF
warning: $out exists and is not autoconverted
warning: creating $out.rpmconv instead
EOF
out="$out.rpmconv"
}
fi
rm -f "$out"
cat >"$out" <<EOF
# This configuration file was automatically converted from the old syntax
# used by the modutils package.
#
# Auto-converted-from: $f
# If you want to edit this file manually, remove the line above to prevent
# the conversion script from overwriting the file if you redo the conversion.

EOF
/sbin/modprobe.old -c -C "$f" --no-builtin |
/sbin/generate-modprobe.conf --stdin \
--full-config="$modules_conf" >>"$out"
done
rm -f "$modules_conf"
echo "... done"
}

# Convert hotplug blacklist to module-init-tools

old_blacklist=%_sysconfdir/hotplug/blacklist
new_blacklist=%_sysconfdir/modprobe.d/blacklist-autoconverted
if [ ! -f $new_blacklist ] && [ -n "$(ls -1 $old_blacklist $old_blacklist.d/* 2>/dev/null)" ]; then
echo "Converting hotplug blacklist ($old_blacklist)..."

cat >$new_blacklist <<EOF
# This configuration was automatically converted from the old syntax used
# by the hotplug package ($old_blacklist).

EOF
for f in $old_blacklist $old_blacklist.d/*; do
[ "${f%%.rpm*}" = "$f" -a "${f%%\~}" = "$f" ] || continue
[ -r "$f" ] || continue
egrep -sh -v '^(#|$|.*[^-0-9A-Za-z_])' "$f"
done |
tr '-' '_' |
egrep -v '^(usb_uhci|usbcore|irusb|audio|usb_midi|dmfe)$' |
sort -u |
while read m; do
/sbin/modprobe --set-version=2.6.0 -c |
egrep -qs "^blacklist[[:space:]]+$m\$" && continue ||:
echo "blacklist $m" >>$new_blacklist
done

echo "... done, created $new_blacklist"
fi

%files
%config(noreplace) %_sysconfdir/modules.conf
%config %_sysconfdir/modutils.d
/lib/modutils
/sbin/*
%_mandir/man?/*
%doc README CREDITS TODO ChangeLog.bz2 example/kallsyms.c include/kallsyms.h

%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin