On Wednesday 03 of March 2004 20:53, Wojciech 'Sas' Cieciwa wrote:
> On Wed, 3 Mar 2004, Mariusz Kryński wrote:
> > W liście z śro, 03-03-2004, godz. 13:14, Paweł Sikora pisze:
> > > czy wszystkie moduly maja byc odzielone od kernela?
> > > (np. imq, esfq, classify, itd.)
> > > jaka jest oficjalna polityka w tej materii?
> >
> > IMQ nie da się zbudować poza kernelem - modyfikowana jest jakaś
> > struktura w shbuff.h, z esfq nie było by chyba problemu.
> >
> > Budowanie modułów poza kernelem jest o tyle niedobre, że upgrade kernela
> > pociągał będzie koniecznośc przebudowywania tych modułów...
>
> Ale budowanie razem z kernelem powoduyje przebudowywanie niemal non-stop
> Wprawdzie tarz i tak kernel sie przebudowywyuje czest ale docelowo trzebab
> bedzie przyjac np. 2.6.4-0.5 za baze i dostosowywac okolokernelowce do tego
> ...
poprawilem speca od ipp2p tak by byl wilk syty i owca cala:)
buduje sie ladnie na (nie)dystrybucyjnych konfigach
i jesli nie masz jakis zastrzezen, to puszcze commita.
pozniej bedzie go mozna kalkowac do kolejnych modulow iptables.
--
If you think of MS-DOS as mono, and Windows as stereo,
then Linux is Dolby Digital and all the music is free...
--- kernel-net-ipp2p.spec.orig 2004-03-03 14:24:58.000000000 +0100
+++ kernel-net-ipp2p.spec 2004-03-03 20:03:26.752986432 +0100
@@ -1,9 +1,12 @@
# $Revision: 1.1.2.4 $, $Date: 2004/03/03 09:13:25 $
+%bcond_without smp
+%bcond_without dist_kernel
+%bcond_with verbose
+#
%define _orig_name ipp2p
%define _rel 1
-
-%define no_install_post_compress_modiles 1
-
+%define no_install_post_compress_modules 1
+#
Summary: ipp2p
Summary(pl): ipp2p
Name: kernel-net-ipp2p
@@ -25,6 +28,7 @@
%description -l pl
- -- pusty --
+%if %{with smp}
%package -n kernel-smp-net-ipp2p
Summary: ipp2p
Summary(pl): ipp2p
@@ -37,6 +41,7 @@
%description -l pl -n kernel-smp-net-ipp2p
- -- pusty --
+%endif
%package -n iptables-ipp2p
Summary: ipp2p
@@ -57,59 +62,77 @@
#%patch
%build
-rm -rf build-done
-install -d build-done/{UP,SMP}
-## iptables
-echo 'CC = gcc' >Makefile
-echo 'CFLAGS = -O2 -Wall -DNETFILTER_VERSION=\"1.2.9\"' >>Makefile
-echo 'libipt_ipp2p.so: libipt_ipp2p.c ipt_ipp2p.h' >>Makefile
-echo ' $(CC) -I/usr/include/iptables -fPIC $(CFLAGS) -c libipt_ipp2p.c' >>Makefile
-echo ' ld -shared -o libipt_ipp2p.so libipt_ipp2p.o' >>Makefile
+CWD=`pwd`
+rm -rf built
+# iptables
+cat << EOF > Makefile
+CC = %{__cc}
+CFLAGS = %{rpmcflags} -fPIC -DNETFILTER_VERSION=\\"1.2.9\\"
+INCPATH = -I%{_includedir}/iptables
+LD = %{__ld}
+.SUFFIXES: .c .o .so
+.c.o:
+ \$(CC) \$(CFLAGS) \$(INCPATH) -c -o \$@ \$<
+.o.so:
+ \$(LD) -shared -o \$@ \$<
+all: libipt_%{_orig_name}.so
+EOF
make
-## kernel
-ln -sf %{_kernelsrcdir}/config-up .config
-rm -rf include
-install -d include/{linux,config}
-ln -sf %{_kernelsrcdir}/include/linux/autoconf.h include/linux/autoconf.h
-ln -sf %{_kernelsrcdir}/include/asm-%{_arch} include/asm
-touch include/config/MARKER
-echo 'obj-m := ipt_ipp2p.o' >Makefile
-%{__make} -C %{_kernelsrcdir} SUBDIRS=$PWD O=$PWD V=1 modules
-mv ipt_ipp2p.ko build-done/UP/
-
-%{__make} -C %{_kernelsrcdir} SUBDIRS=$PWD O=$PWD V=1 mrproper
-
-ln -sf %{_kernelsrcdir}/config-smp .config
-rm -rf include
-install -d include/{linux,config}
-ln -sf %{_kernelsrcdir}/include/linux/autoconf.h include/linux/autoconf.h
-ln -sf %{_kernelsrcdir}/include/asm-%{_arch} include/asm
-touch include/config/MARKER
-echo 'obj-m := ipt_ipp2p.o' >Makefile
-%{__make} -C %{_kernelsrcdir} SUBDIRS=$PWD O=$PWD V=1 modules
-mv ipt_ipp2p.ko build-done/SMP/
+# kernel module (2.4.x & 2.6.x)
+if [ `uname -r | cut -d. -f1-2` == "2.6" ]; then
+ __ext="ko"
+else
+ __ext="o"
+fi
+for cfgtype in %{?with_smp:smp} %{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}; do
+ cfg=%{_kernelsrcdir}/config-$cfgtype
+ if [ -r "$cfg" ]; then
+ install -d built/$cfgtype
+ %{__make} -C %{_kernelsrcdir} SUBDIRS=$PWD O=$PWD %{?with_verbose:V=1} mrproper
+ ln -sf $cfg .config
+ rm -rf include
+ install -d include/{linux,config}
+ ln -sf %{_kernelsrcdir}/include/asm-%{_arch} include/asm
+ touch include/config/MARKER
+ echo "obj-m := ipt_%{_orig_name}.$__ext" > Makefile
+ %{__make} -C %{_kernelsrcdir} SUBDIRS=$PWD O=$PWD %{?with_verbose:V=1} modules
+ mv ipt_%{_orig_name}.$__ext built/$cfgtype/
+ fi
+done
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/kernel/drivers/net/
-install -d $RPM_BUILD_ROOT/usr/lib/iptables/
+install -d \
+ $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver_str}{,smp}/kernel/drivers/net/ \
+ $RPM_BUILD_ROOT/usr/lib/iptables/
+
+install \
+ built/%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}/* \
+ $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver_str}/kernel/drivers/net/
+%if %{with smp}
+install \
+ built/smp/* \
+ $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver_str}smp/kernel/drivers/net/
+%endif
+install \
+ libipt_%{_orig_name}.so \
+ $RPM_BUILD_ROOT/usr/lib/iptables/
-cp build-done/UP/* $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/kernel/drivers/net/
-cp build-done/SMP/* $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/kernel/drivers/net/
-cp libipt_ipp2p.so $RPM_BUILD_ROOT/usr/lib/iptables/
%post
-%depmod %{_kernel_ver}
+%depmod %{_kernel_ver_str}
%postun
-%depmod %{_kernel_ver}
+%depmod %{_kernel_ver_str}
+%if %{with smp}
%post -n kernel-smp-net-ipp2p
-%depmod %{_kernel_ver}
+%depmod %{_kernel_ver_str}
%postun -n kernel-smp-net-ipp2p
-%depmod %{_kernel_ver}
+%depmod %{_kernel_ver_str}
+%endif
%post -n iptables-ipp2p
%postun -n iptables-ipp2p
@@ -119,11 +142,13 @@
%files
%defattr(644,root,root,755)
-/lib/modules/%{_kernel_ver}/kernel/drivers/net/*
+/lib/modules/%{_kernel_ver_str}/kernel/drivers/net/*
+%if %{with smp}
%files -n kernel-smp-net-ipp2p
%defattr(644,root,root,755)
-/lib/modules/%{_kernel_ver}smp/kernel/drivers/net/*
+/lib/modules/%{_kernel_ver_str}smp/kernel/drivers/net/*
+%endif
%files -n iptables-ipp2p
%defattr(644,root,root,755)
# $Revision: 1.1.2.4 $, $Date: 2004/03/03 09:13:25 $
%bcond_without smp
%bcond_without dist_kernel
%bcond_with verbose
#
%define _orig_name ipp2p
%define _rel 1
%define no_install_post_compress_modules 1
#
Summary: ipp2p
Summary(pl): ipp2p
Name: kernel-net-ipp2p
Version: 05b
Release: [EMAIL PROTECTED]
License: GPL
Group: Base/Kernel
Source0:
http://rnvs.informatik.uni-leipzig.de/%{_orig_name}/downloads/%{_orig_name}.%{version}.tar.gz
# Source0-md5: 5cf214c6132d88ac5f0c859e6b8ae792
BuildRequires: kernel-module-build
BuildRequires: iptables-devel
Requires(post,postun): /sbin/depmod
URL: http://rnvs.informatik.uni-leipzig.de/ipp2p/
Buildroot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
- -- empty --
%description -l pl
- -- pusty --
%if %{with smp}
%package -n kernel-smp-net-ipp2p
Summary: ipp2p
Summary(pl): ipp2p
Release: [EMAIL PROTECTED]
Group: Base/Kernel
Requires(post,postun): /sbin/depmod
%description -n kernel-smp-net-ipp2p
- -- empty --
%description -l pl -n kernel-smp-net-ipp2p
- -- pusty --
%endif
%package -n iptables-ipp2p
Summary: ipp2p
Summary(pl): ipp2p
Release: %{_rel}
Group: Base/Kernel
Requires: iptables
%description -n iptables-ipp2p
- -- empty --
%description -l pl -n iptables-ipp2p
- -- pusty --
%prep
%setup -q -n %{_orig_name}
#%patch
%build
CWD=`pwd`
rm -rf built
# iptables
cat << EOF > Makefile
CC = %{__cc}
CFLAGS = %{rpmcflags} -fPIC -DNETFILTER_VERSION=\\"1.2.9\\"
INCPATH = -I%{_includedir}/iptables
LD = %{__ld}
.SUFFIXES: .c .o .so
.c.o:
\$(CC) \$(CFLAGS) \$(INCPATH) -c -o \$@ \$<
.o.so:
\$(LD) -shared -o \$@ \$<
all: libipt_%{_orig_name}.so
EOF
make
# kernel module (2.4.x & 2.6.x)
if [ `uname -r | cut -d. -f1-2` == "2.6" ]; then
__ext="ko"
else
__ext="o"
fi
for cfgtype in %{?with_smp:smp} %{?with_dist_kernel:up}%{!?with_dist_kernel:nondist};
do
cfg=%{_kernelsrcdir}/config-$cfgtype
if [ -r "$cfg" ]; then
install -d built/$cfgtype
%{__make} -C %{_kernelsrcdir} SUBDIRS=$PWD O=$PWD %{?with_verbose:V=1} mrproper
ln -sf $cfg .config
rm -rf include
install -d include/{linux,config}
ln -sf %{_kernelsrcdir}/include/asm-%{_arch} include/asm
touch include/config/MARKER
echo "obj-m := ipt_%{_orig_name}.$__ext" > Makefile
%{__make} -C %{_kernelsrcdir} SUBDIRS=$PWD O=$PWD %{?with_verbose:V=1} modules
mv ipt_%{_orig_name}.$__ext built/$cfgtype/
fi
done
%install
rm -rf $RPM_BUILD_ROOT
install -d \
$RPM_BUILD_ROOT/lib/modules/%{_kernel_ver_str}{,smp}/kernel/drivers/net/ \
$RPM_BUILD_ROOT/usr/lib/iptables/
install \
built/%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}/* \
$RPM_BUILD_ROOT/lib/modules/%{_kernel_ver_str}/kernel/drivers/net/
%if %{with smp}
install \
built/smp/* \
$RPM_BUILD_ROOT/lib/modules/%{_kernel_ver_str}smp/kernel/drivers/net/
%endif
install \
libipt_%{_orig_name}.so \
$RPM_BUILD_ROOT/usr/lib/iptables/
%post
%depmod %{_kernel_ver_str}
%postun
%depmod %{_kernel_ver_str}
%if %{with smp}
%post -n kernel-smp-net-ipp2p
%depmod %{_kernel_ver_str}
%postun -n kernel-smp-net-ipp2p
%depmod %{_kernel_ver_str}
%endif
%post -n iptables-ipp2p
%postun -n iptables-ipp2p
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
/lib/modules/%{_kernel_ver_str}/kernel/drivers/net/*
%if %{with smp}
%files -n kernel-smp-net-ipp2p
%defattr(644,root,root,755)
/lib/modules/%{_kernel_ver_str}smp/kernel/drivers/net/*
%endif
%files -n iptables-ipp2p
%defattr(644,root,root,755)
/usr/lib/iptables/*
%define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
%changelog
* %{date} PLD Team <[EMAIL PROTECTED]>
All persons listed below can be reached at <cvs_login>@pld.org.pl
$Log: kernel-net-ipp2p.spec,v $
Revision 1.1.2.4 2004/03/03 09:13:25 cieciwa
- fixed %%build, %%install, %%files,
- %%description and %%summary not updated.
Revision 1.1.2.3 2004/03/03 08:32:26 cieciwa
- updated
Revision 1.1.2.2 2004/03/03 08:22:54 cieciwa
- updated
Revision 1.1.2.1 2004/03/03 08:17:31 cieciwa
- working on
Revision 1.1 2004/03/03 07:37:21 cieciwa
- initial
__________________________________________________________
nie pytaj co inni zrobili dla pld, pomysl ile sam zrobiles