Denis,

Thanks a lot for your help.

In fact I already had a look at your fedora rpm and started to work on it. See 
attachment for what I've done so far.
My aim is that the final spec would create the dkms binary package aside normal 
packages. I don't see any reason to have the open-vm-tools source be part of 2 
source-rpm packages (one for the tools one for the modules).

I'm also not keen to have a kmod package until it is maintained by Mandriva 
team and thus updated at the same time the kernel is updated.

So I'd realy like to go forward with the dkms way (until modules are part of 
the kernel or are provided by Mandriva as part of the main distro).

Note that the attached spec  is a work in progress. While it builds correctly 
all the packages, the dkms one is not correct (missing includes in the build 
tree).

I have 2 solutions at that point:

Either include all open-vm-tools in a dkms shared dir (ugly), or look at the 
vmware-only kernel modules tree and copy missing includes (also ugly as there 
are includes duplicated in all modules directories).

I've also a duplicate definition that occures only if I put all missing 
includes in a shared include directory in the dkms tree. If I try to build the 
package from the original source, this duplicate definition does not occure.... 
I think that some king of include has 2 versions... need to look deeper....

I've tested the git repository, but it is fully equal to all releases (I've 
looked at the commits and they match all releases. (IMHO I see no interrest in 
a git that is exactly the same as the releases. Maybe I'm missing something 
here).

Best regards.


Olivier.

Le lundi 18 mai 2009 12:35:18 Denis Leroy, vous avez écrit :
> On 05/18/2009 09:51 AM, Olivier LAHAYE wrote:
> > Hi,
> >
> > I'd like to install modules as dkms tree in order to avoid recompiling
> > the modules from the full source tree.
> > Is there a clean way to create the<module>-only source-tree from the full
> > sources or should I do it myself by hand (so I can move it to the dkms
> > source dir)?
> > Right now, I've identified modules includes in modules/shared and
> > lib/includes.
> >
> > Thanks a lot for your help.
> >
> > PS: I'm trying (in fact) to create a source rpm for Mandriva 2009.1 that
> > creates 3 packages from the full open-vm-tools source archive.
> > - open-vm-tools
> > - open-vm-tools-devel
> > - dkms-open-vm-tools
>
> Olivier,
>
> You can use the spec files I maintain for Fedora RPMFusion (kmod-based)
>
> http://download1.rpmfusion.org/free/fedora/updates/10/SRPMS/repoview/open-v
>m-tools.html
> http://download1.rpmfusion.org/free/fedora/updates/10/SRPMS/repoview/open-v
>m-tools-kmod.html
>
>
> I also wrote some dkms-based RPM, but no longer maintained:
>
> http://www.poolshark.org/dkms-open-vm-tools/
>
> -denis
>
> ---------------------------------------------------------------------------
>--- Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables
> unlimited royalty-free distribution of the report engine
> for externally facing server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> open-vm-tools-devel mailing list
> open-vm-tools-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/open-vm-tools-devel

-- 
        Olivier LAHAYE
        CEA Saclay
%define builddate 2009.04.23
%define buildver 162451
%define debug_package %{nil}

Name:      open-vm-tools
Version:   %{builddate}.%{buildver}
Release:   %mkrel 1
Summary:   VMware Guest OS Tools
Group:     Applications/System
License:   LGPLv2
URL:       http://open-vm-tools.sourceforge.net/
Source0:   http://downloads.sourceforge.net/%{name}/%{name}-%{builddate}-%{buildver}.tar.gz
Source1:   %{name}-vmtoolsd.init
Source2:   %{name}-sysconfig.mouse
Source3:   vmware-toolbox.desktop
Source4:   %{name}-modprobe.vmnics
Source5:   %{name}-%{builddate}-%{buildver}.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

ExclusiveArch: i386 i586 x86_64

BuildRequires: gtk2-devel
buildRequires: libnotify-devel
BuildRequires: libxtst-devel
BuildRequires: libxscrnsaver-devel
BuildRequires: gtkmm2.4-devel
BuildRequires: gtk+-devel
BuildRequires: libdnet-devel
BuildRequires: procps
BuildRequires: libdnet-devel
BuildRequires: libicu-devel
BuildRequires: desktop-file-utils

#Requires:  open-vm-tools-kmod >= %{version}
#Obsoletes: open-vm-tools-kmod < %{version}
Requires:   dkms-open-vm-tools >= %{version}
Provides:  open-vm-tools-kmod-common = %{version}


%description
Open-vm-tools are the open source implementation of VMware Tools. They
are a set of guest operating system virtualization components that
enhance performance and user experience of VMWare virtual
machines. This package contains the user-space programs and libraries
of open-vm-tools.

%package        devel
Summary:        Development package for %{name}
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}

%description    devel
Open-vm-tools are the open source implementation of VMware Tools. They
are a set of guest operating system virtualization components that
enhance performance and user experience of VMWare virtual
machines. This package contains the header files and symlinks to 
libraries.

%package -n     dkms-%{name}
Summary:        Kernel modules for open-vm-tools
Group:          System/Kernel and hardware
License:        LGPLv2
Requires(post): 	dkms
Requires(preun):        dkms

%description -n dkms-%{name}
Kernel modules for open-vm-tools

%prep
%setup -q -n open-vm-tools-%{builddate}-%{buildver}
# Patch doc generation
patch -p1 < %SOURCE5
# Fix some permissions and formats
chmod -x NEWS README ChangeLog AUTHORS COPYING
sed -i 's/\r//' README


%build
%configure \
        --disable-static \
        --disable-dependency-tracking \
        --without-kernel-modules \
        --without-root-privileges \
        --with-gtkmm

# Disable use of rpath
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool

make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';'

# Install vmware-guestd init script
mkdir -p $RPM_BUILD_ROOT/etc/init.d/
install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT/etc/init.d/vmtoolsd

# GPM vmmouse support
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/mouse

# Move mount.vmhgfs to correct location in /sbin
mkdir -p $RPM_BUILD_ROOT/sbin
mv $RPM_BUILD_ROOT%{_sbindir}/mount.* $RPM_BUILD_ROOT/sbin

# Install VMCI sockets header file
mkdir -p $RPM_BUILD_ROOT%{_includedir}
install -m 0644 modules/linux/vsock/linux/vmci_sockets.h $RPM_BUILD_ROOT%{_includedir}

# Move vmware-user desktop into autostart directory
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart
mv $RPM_BUILD_ROOT%{_datadir}/applications/vmware-user.desktop $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart/

# Install desktop file and icon for toolbox
mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
install -m 0644 toolbox/bigIcon.xpm $RPM_BUILD_ROOT%{_datadir}/pixmaps/vmware-toolbox.xpm
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications %{SOURCE3}

# Setup module-init-tools file for vmxnet
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d
install -m 0644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/vmnics

# Create dkms tree and fill it
mkdir -p $RPM_BUILD_ROOT%{_usrsrc}/%{name}-%{version}-%{release}
cp -r modules/linux/* $RPM_BUILD_ROOT%{_usrsrc}/%{name}-%{version}-%{release}/

%clean
rm -rf $RPM_BUILD_ROOT


%post
# Setup guestd on initial install
/sbin/ldconfig
[ $1 -lt 2 ] && /sbin/chkconfig vmware-guestd on ||:
update-desktop-database %{_datadir}/applications > /dev/null 2>&1 || :


%postun
update-desktop-database %{_datadir}/applications > /dev/null 2>&1 || :
/sbin/ldconfig


%preun
# Remove on uninstall
if [ "$1" = 0 ]
then
  /sbin/service vmware-guestd stop > /dev/null 2>&1 || :
  /sbin/chkconfig --del vmware-guestd ||:
fi

%post -n dkms-%{name}
set -x
/usr/sbin/dkms --rpm_safe_upgrade add -m %{name} -v %{version}-%{release}
/usr/sbin/dkms --rpm_safe_upgrade build -m %{name} -v %{version}-%{release}
/usr/sbin/dkms --rpm_safe_upgrade install -m %{name} -v %{version}-%{release}
:

%preun -n dkms-%{name}
set -x
/usr/sbin/dkms --rpm_safe_upgrade remove -m %{name} -v %{version}-%{release} --all
:

%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING ChangeLog NEWS README
%{_bindir}/vm*
%{_sbindir}
%{_datadir}/applications/*.desktop
%{_sysconfdir}/xdg/autostart/*.desktop
%{_datadir}/pixmaps/*.xpm
%{_libdir}/*.so.*
%{_sysconfdir}/init.d/*
%{_sysconfdir}/vmware-tools
%config(noreplace) %{_sysconfdir}/pam.d/*
%config(noreplace) %{_sysconfdir}/sysconfig/mouse
%config(noreplace) %{_sysconfdir}/modprobe.d/*
%attr(4755,root,root) /sbin/mount.vmhgfs
%attr(4755,root,root) %{_bindir}/vmware-user-suid-wrapper
%{_libdir}/open-vm-tools

%files devel
%defattr(-,root,root,-)
%{_includedir}/*.h
%{_libdir}/*.so

%files -n dkms-%{name}
%defattr(-,root,root)
%{_usrsrc}/%{name}-%{version}-%{release}


%changelog
* Fri May 15 2009 Olivier Lahaye <olivier.laha...@free.fr> - 2009.04.23-162451-1mdv2009.1
- Port to Mandriva 2009.1 from fedora
- Update to upstream build 162451
- integrated dkms package build

* Sat Jan 10 2009 Denis Leroy <de...@poolshark.org> - 0.0.0.137496-1
- Update to upstream build 137496

* Thu Dec 18 2008 Denis Leroy <de...@poolshark.org> - 0.0.0.130226-1
- Update to upstream 130226
- Desktop patch upstreamed

* Mon Nov 10 2008 Denis Leroy <de...@poolshark.org> - 0.0.0.123053-9
- Some more cleanups

* Fri Oct 31 2008 Denis Leroy <de...@poolshark.org> - 0.0.0.123053-8
- Added toolbox icon

* Tue Oct 28 2008 Denis Leroy <de...@poolshark.org> - 0.0.0.123053-7
- Only export vmci_sockets.h file

* Mon Oct 27 2008 Orcan Ogetbil <orcan [AT] yahoo [DOT] com> 0.0.0.123053-6
- Bugfix: Doesn't build for x86_64.
- Added a devel package containing the header and .so files.
- The shell scripts in %%{_sysconfdir}/vmware-tools/ are now marked non-%%config.
- Minor SPEC file improvements.

* Mon Oct 27 2008 Denis Leroy <de...@poolshark.org> - 0.0.0.123053-5
- Fixed desktop-file-utils reqs

* Sun Oct 26 2008 Denis Leroy <de...@poolshark.org> - 0.0.0.123053-4
- Move drag'n'drop directory management to init script
- Added icon to toolbox desktop entry
- Some rpmlint cleanups

* Tue Oct 21 2008 Denis Leroy <de...@poolshark.org> - 0.0.0.123053-2
- Changed versioning
- Added patches and extra config files as sources

* Wed Oct 15 2008 Denis Leroy <de...@poolshark.org> - 0-1.2008.10.10
- First draft, based on dkms-based spec
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
open-vm-tools-devel mailing list
open-vm-tools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-vm-tools-devel

Reply via email to