January 2004
See my kolab groupware calendaring pages
I wrote this documentation while trying to setup a working groupware calendaring solution. It is basically a log of this process, including the problems that I came across, and how I solved it, often with help from helpful people from the associated projects. I hope this text can help other people who will have the same problems. Some portions of this text are tailored for the server environment (SLS) of OM, the organisation that I work for.
Showing posts with label Kolab. Show all posts
Showing posts with label Kolab. Show all posts
Saturday, 17 November 2007
Package a Perl module
First check if somebody did already the job, e.g. on artfiles.org RPMS (SRPMS) or just for RPMS: RPMPan or this search site: Linux Software Directory .
You need to install perl-Archive-Tar-1.08-2.noarch.rpm and perl-RPM-Specfile-1.17-1.noarch.rpm.
A description of the module perl-RPM-Specfile can be found on cpan.
Download this perl script, called cpan-to-rpm.pl. It is described as followed: "Grab a module from CPAN and sock it into an RPM using cpanflute2"
Call it this way:
That will create
to see what an rpm provides:
You need to install perl-Archive-Tar-1.08-2.noarch.rpm and perl-RPM-Specfile-1.17-1.noarch.rpm.
A description of the module perl-RPM-Specfile can be found on cpan.
Download this perl script, called cpan-to-rpm.pl. It is described as followed: "Grab a module from CPAN and sock it into an RPM using cpanflute2"
Call it this way:
perl cpan-to-rpm.pl \
authors/id/M/MU/MUIR/modules/Net-Netmask-1.9011.tar.gz
perl cpan-to-rpm.pl \
authors/id/D/DJ/DJKERNEN/Mail-IMAPClient-2.2.9.tar.gz
That will create
/usr/src/redhat/SRPMS/perl-Net-Netmask-1.9011-1.src.rpm
If you install it withrpm -i /usr/src/redhat/SRPMS/perl-Net-Netmask-1.9011-1.src.rpm
you can build the rpm from it withrpmbuild -ba /usr/src/redhat/SPECS/perl-Net-Netmask.specto see what an rpm provides:
rpm -qlp --provides perl-LDAP-0.31-4.noarch.rpm
The file list conversion from OpenPKG
rpmtool:
One idea could be, to download the file from the OpenPKG CVS and save it to /usr/bin/rpmtool; you need to change the first line of that file to #!/bin/bash
Also add at the top of the spec file:
insert after the l_rpmtool line:
Rebuild the package, which will create the kolab-webadmin.files:
Perhaps need to change the paths, e.g. for perl:
in vi:
You need to put it into an archive:
In the fedora spec file,
In the %prep section, insert:
As the parameter for -n, give the name of a directory that is created for the main tar file anyway.
In the %install section, remove the rpmtool lines; instead, you change the %files line:
One idea could be, to download the file from the OpenPKG CVS and save it to /usr/bin/rpmtool; you need to change the first line of that file to #!/bin/bash
Also add at the top of the spec file:
%define l_rpmtool /usr/bin/rpmtoolThe other idea is, to install the OpenPKG source rpm of the package concerned:
/kolab/bin/openpkg rpm -i kolab-webadmin-0.4.0-20050318.src.rpmIn the /kolab/RPM/SRC/kolab-webadmin/kolab-webadmin.spec
insert after the l_rpmtool line:
cp files /usr/src/redhat/SOURCES/kolab-webadmin.filesRebuild the package, which will create the kolab-webadmin.files:
/kolab/libexec/openpkg/rpmbuild -ba /kolab/RPM/SRC/kolab-webadmin/kolab-webadmin.spec
Perhaps need to change the paths, e.g. for perl:
in vi:
:%s/\/kolab\/lib\/perl\/vendor_perl\/5.8.5/\/usr\/lib\/perl5\/vendor_perl\/5.8.3/gYou need to put it into an archive:
cd /usr/src/redhat/SOURCES/
tar cvf kolab-webadmin.files.tar kolab-webadmin.files
In the fedora spec file,
/usr/src/redhat/SPECS/kolab-webadmin.spec, you would add in the sources:Source1: kolab-webadmin.files.tarIn the %prep section, insert:
%setup1 -D -T -b 1 -n kolab-webadmin-%{version}As the parameter for -n, give the name of a directory that is created for the main tar file anyway.
In the %install section, remove the rpmtool lines; instead, you change the %files line:
%files -f ../kolab-webadmin.files
Converting OpenPKG spec file to Fedora
have a look at Building Packages with OpenPKG
See /usr/local/kolabopenpkg/etc/openpkg/rpmmacros to know what the macros (e.g. %l_musr) mean.
To get the spec file, install the OpenPKG source package:
Copy the other files (e.g. .tar.gz archives) to
One special thing is that the required packages in OpenPKG don't only include the package name and required version number, but often also options that were included when configuring and building the package.
For example, cyrus-sasl::with_ldap would require that the cyrus-sasl::with_ldap is advertised in the Provides: tag in the spec file.
A common approach is not to advertise all compiling options, but to know the packages and test them thoroughly.
Remove the line:
To understand some of the macros, in the form %{something}, have a look at /usr/lib/rpm/macros and /usr/local/kolab/etc/openpkg/rpmmacros.
Insert these lines near the top:
It seems, the spaces before the %setup -q are not correct. Remove them!
Lines like
remove also the
See /usr/local/kolabopenpkg/etc/openpkg/rpmmacros to know what the macros (e.g. %l_musr) mean.
To get the spec file, install the OpenPKG source package:
/kolab/bin/openpkg rpm -i kolab-webadmin-0.4.0-20050318.src.rpmCopy the
/kolab/RPM/SRC/kolab-webadmin/kolab-webadmin.spec to /usr/src/redhat/SPECS;Copy the other files (e.g. .tar.gz archives) to
/usr/src/redhat/SOURCESOne special thing is that the required packages in OpenPKG don't only include the package name and required version number, but often also options that were included when configuring and building the package.
For example, cyrus-sasl::with_ldap would require that the cyrus-sasl::with_ldap is advertised in the Provides: tag in the spec file.
A common approach is not to advertise all compiling options, but to know the packages and test them thoroughly.
Remove the line:
Class: JUNKTo understand some of the macros, in the form %{something}, have a look at /usr/lib/rpm/macros and /usr/local/kolab/etc/openpkg/rpmmacros.
Insert these lines near the top:
%define l_prefix /kolabReplace all occurances of "apache" with "httpd" in your spec file.
%define l_make %{__make}
%define l_mflags -m
# m actually is ignored, compatibility
It seems, the spaces before the %setup -q are not correct. Remove them!
Lines like
%{l_shtool} install: just remove all the %{l_shtool}; install should work fine;remove also the
%{l_value -s -a} (though I am not sure what those characters stand for)
Subscribe to:
Posts (Atom)