SPECS: VMware-server.spec - build kernel part (new module: vmci)
glen
glen at pld-linux.org
Wed Mar 5 00:25:58 CET 2008
Author: glen Date: Tue Mar 4 23:25:58 2008 GMT
Module: SPECS Tag: HEAD
---- Log message:
- build kernel part (new module: vmci)
---- Files affected:
SPECS:
VMware-server.spec (1.33 -> 1.34)
---- Diffs:
================================================================
Index: SPECS/VMware-server.spec
diff -u SPECS/VMware-server.spec:1.33 SPECS/VMware-server.spec:1.34
--- SPECS/VMware-server.spec:1.33 Tue Mar 4 23:13:40 2008
+++ SPECS/VMware-server.spec Wed Mar 5 00:25:53 2008
@@ -22,7 +22,7 @@
# Conditional build:
%bcond_without dist_kernel # without distribution kernel
%bcond_without kernel # don't build kernel modules
-%bcond_without userspace # don't build userspace utilities
+%bcond_with userspace # don't build userspace utilities
%bcond_with internal_libs # internal libs stuff
%bcond_with verbose # verbose build (V=1)
#
@@ -67,10 +67,10 @@
NoSource: 3
NoSource: 4
URL: http://www.vmware.com/
-%{?with_dist_kernel:BuildRequires: kernel-module-build >= 3:2.6.20.2}
+%{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
BuildRequires: libstdc++-devel
BuildRequires: rpm-perlprov
-BuildRequires: rpmbuild(macros) >= 1.379
+BuildRequires: rpmbuild(macros) >= 1.438
BuildRequires: sed >= 4.0
Requires: libgnomecanvasmm
Requires: libsexy
@@ -168,6 +168,25 @@
%description samba -l pl.UTF-8
Narzędzia VMware do SMB.
+%package -n kernel-misc-vmci
+Summary: Kernel module for VMware Server
+Summary(pl.UTF-8): Moduł jądra dla VMware Server
+Release: %{rel}@%{_kernel_ver_str}
+Group: Base/Kernel
+Requires(post,postun): /sbin/depmod
+Requires: dev >= 2.9.0-7
+%if %{with dist_kernel}
+%requires_releq_kernel
+Requires(postun): %releq_kernel
+%endif
+Provides: kernel(vmci) = %{version}-%{rel}
+
+%description -n kernel-misc-vmci
+Kernel modules for VMware Server - vmci.
+
+%description -n kernel-misc-vmci -l pl.UTF-8
+Moduły jądra dla VMware Server - vmci.
+
%package -n kernel-misc-vmmon
Summary: Kernel module for VMware Server
Summary(pl.UTF-8): Moduł jądra dla VMware Server
@@ -208,11 +227,24 @@
%prep
%ifarch %{ix86}
-%setup -q -T -n vmware-server-distrib -b0 -a2
+%setup -q -T -n vmware-server-distrib -b0 %{?with_userspace:-a2}
%endif
%ifarch %{x8664}
-%setup -q -T -n vmware-server-distrib -b1 -a3
+%setup -q -T -n vmware-server-distrib -b1 %{?with_userspace:-a3}
%endif
+
+cd lib/modules
+%{__tar} xf source/vmci.tar
+%{__tar} xf source/vmmon.tar
+%{__tar} xf source/vmnet.tar
+mv vmmon-only/linux/driver.c{,.dist}
+mv vmnet-only/hub.c{,.dist}
+mv vmnet-only/driver.c{,.dist}
+cd -
+rm -rf binary # unusable
+
+
+%if 0
tar zxf vmware-mui-distrib/console-distrib/%{name}-console-%{ver}-%{subver}.tar.gz
cp vmware-any-any-update%{urel}/{vmmon,vmnet}.tar lib/modules/source/
cd lib/modules/source
@@ -225,12 +257,14 @@
%patch1 -p1
%patch2 -p0
tar xf lib/perl/control.tar
+%endif
%build
-sed -i 's:vm_db_answer_LIBDIR:VM_LIBDIR:g;s:vm_db_answer_BINDIR:VM_BINDIR:g' bin/vmware
+%if 0
cd vmware-any-any-update%{urel}
chmod u+w ../lib/bin/vmware-vmx ../lib/bin-debug/vmware-vmx ../bin/vmnet-bridge
+%endif
%if 0
rm -f update
@@ -238,10 +272,11 @@
./update vmx ../lib/bin/vmware-vmx
./update vmxdebug ../lib/bin-debug/vmware-vmx
./update bridge ../bin/vmnet-bridge
-%endif
cd -
+%endif
%if %{with userspace}
+%if 0
cd control-only
perl Makefile.PL
sed -i "s:^INSTALLSITEARCH.*$:INSTALLSITEARCH = %{perl_vendorarch}:" Makefile
@@ -252,52 +287,34 @@
%{__make}
cd ..
%endif
+%endif
%if %{with kernel}
-cd lib/modules/source
-rm -rf built
-mkdir built
+cd lib/modules
-for mod in vmmon vmnet ; do
- for cfg in %{?with_dist_kernel:dist}%{!?with_dist_kernel:nondist}; do
- if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
- exit 1
- fi
- rm -rf $mod-only
- cp -a $mod-only.clean $mod-only
- cd $mod-only
- install -d o/include/linux
- ln -sf %{_kernelsrcdir}/config-$cfg o/.config
- ln -sf %{_kernelsrcdir}/Module.symvers-$cfg o/Module.symvers
- ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h o/include/linux/autoconf.h
- if grep -q "^CONFIG_PREEMPT_RT=y$" o/.config; then
- sed -e '/pollQueueLock/s/SPIN_LOCK_UNLOCKED/SPIN_LOCK_UNLOCKED(pollQueueLock)/' \
- -e '/timerLock/s/SPIN_LOCK_UNLOCKED/SPIN_LOCK_UNLOCKED(timerLock)/' \
- -i ../vmmon-only/linux/driver.c
- sed -e 's/SPIN_LOCK_UNLOCKED/SPIN_LOCK_UNLOCKED(vnetHubLock)/' \
- -i ../vmnet-only/hub.c
- sed -e 's/RW_LOCK_UNLOCKED/RW_LOCK_UNLOCKED(vnetPeerLock)/' \
- -i ../vmnet-only/driver.c
- fi
- %if %{with dist_kernel}
- %{__make} -j1 -C %{_kernelsrcdir} O=$PWD/o prepare scripts
- %else
- install -d o/include/config
- touch o/include/config/MARKER
- ln -sf %{_kernelsrcdir}/scripts o/scripts
- %endif
- %{__make} -C %{_kernelsrcdir} modules \
- VMWARE_VER=VME_V5 \
- SRCROOT=$PWD \
- M=$PWD O=$PWD/o \
- VM_KBUILD=26 \
- %{?with_verbose:V=1} \
- VM_CCVER=%{ccver}
- mv -f $mod.ko ../built/$mod-$cfg.ko
- cd -
- done
-done
-%endif
+%build_kernel_modules -C vmci-only -m vmci SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{ccver}
+
+%build_kernel_modules -C vmmon-only -m vmmon SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{ccver} <<'EOF'
+if grep -q "^CONFIG_PREEMPT_RT=y$" o/.config; then
+ sed -e '/pollQueueLock/s/SPIN_LOCK_UNLOCKED/SPIN_LOCK_UNLOCKED(pollQueueLock)/' \
+ -e '/timerLock/s/SPIN_LOCK_UNLOCKED/SPIN_LOCK_UNLOCKED(timerLock)/' \
+ linux/driver.c.dist > linux/driver.c
+else
+ cat linux/driver.c.dist > linux/driver.c
+fi
+EOF
+
+%build_kernel_modules -C vmnet-only -m vmnet SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{ccver} <<'EOF'
+if grep -q "^CONFIG_PREEMPT_RT=y$" o/.config; then
+ sed -e 's/SPIN_LOCK_UNLOCKED/SPIN_LOCK_UNLOCKED(vnetHubLock)/' \
+ hub.c.dist > hub.c
+ sed -e 's/RW_LOCK_UNLOCKED/RW_LOCK_UNLOCKED(vnetPeerLock)/' \
+ driver.c.dist > driver.c
+else
+ cat hub.c.dist > hub.c
+ cat driver.c.dist > driver.c
+fi
+EOF
%install
rm -rf $RPM_BUILD_ROOT
@@ -332,17 +349,9 @@
%endif
%if %{with kernel}
-install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/misc
-
-#cd vmware-any-any-update%{urel}
-cd lib/modules/source
-
-install built/vmmon-%{?with_dist_kernel:dist}%{!?with_dist_kernel:nondist}.ko \
- $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/vmmon.ko
-install built/vmnet-%{?with_dist_kernel:dist}%{!?with_dist_kernel:nondist}.ko \
- $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/vmnet.ko
-
-cd -
+%install_kernel_modules -m lib/modules/vmci-only/vmci -d misc
+%install_kernel_modules -m lib/modules/vmmon-only/vmmon -d misc
+%install_kernel_modules -m lib/modules/vmnet-only/vmnet -d misc
%endif
%if %{with userspace}
@@ -406,6 +415,12 @@
/sbin/chkconfig --del vmnet
fi
+%post -n kernel-misc-vmci
+%depmod %{_kernel_ver}
+
+%postun -n kernel-misc-vmci
+%depmod %{_kernel_ver}
+
%post -n kernel-misc-vmmon
%depmod %{_kernel_ver}
@@ -527,6 +542,10 @@
%endif
%if %{with kernel}
+%files -n kernel-misc-vmci
+%defattr(644,root,root,755)
+/lib/modules/%{_kernel_ver}/misc/vmci.ko*
+
%files -n kernel-misc-vmmon
%defattr(644,root,root,755)
/lib/modules/%{_kernel_ver}/misc/vmmon.ko*
@@ -542,9 +561,11 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.34 2008-03-04 23:25:53 glen
+- build kernel part (new module: vmci)
+
Revision 1.33 2008-03-04 22:13:40 glen
- unpack
Revision 1.32 2008-03-04 22:06:32 glen
- start 2.0 (build 63231), old one in VMware-1_0 branch
-
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/VMware-server.spec?r1=1.33&r2=1.34&f=u
More information about the pld-cvs-commit
mailing list