Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 6bb7cd2c authored by Laurent Montel's avatar Laurent Montel 😁

Remove unused files

parent 5ba7775b
#!/bin/bash
dobuild=0
doprep=0
dotest=0
doinstall=0
srcdir=$(pwd)
while [ $# -gt 0 ]; do
case "$1" in
--build|-b)
dobuild=1
shift
;;
--prep|-p)
doprep=1
shift
;;
--test|-t)
dotest=1
shift
;;
--install|-i)
doinstall=1
shift
;;
esac
done
if [ ${dobuild} -eq 0 -a ${doprep} -eq 0 -a ${dotest} -eq 0 -a ${doinstall} -eq 0 ]; then
dobuild=1
doprep=1
dotest=1
doinstall=1
fi
version_major=`grep -E "^set\s*\(Libkolab_VERSION_MAJOR [0-9]+\)" CMakeLists.txt | sed -r -e 's/^set\s*\(Libkolab_VERSION_MAJOR ([0-9]+)\)/\1/g'`
version_minor=`grep -E "^set\s*\(Libkolab_VERSION_MINOR [0-9]+\)" CMakeLists.txt | sed -r -e 's/^set\s*\(Libkolab_VERSION_MINOR ([0-9]+)\)/\1/g'`
version_patch=`grep -E "^set\s*\(Libkolab_VERSION_PATCH [0-9]+\)" CMakeLists.txt | sed -r -e 's/^set\s*\(Libkolab_VERSION_PATCH ([0-9]+)\)/\1/g'`
if [ -z "${version_patch}" ]; then
version="${version_major}.${version_minor}"
else
version="${version_major}.${version_minor}.${version_patch}"
fi
# Rebuilds the entire foo in one go. One shot, one kill.
rm -rf build/
mkdir -p build
cd build
if [ ${doprep} -eq 1 ]; then
cmake \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_INSTALL_PREFIX=/usr \
-DLIB_INSTALL_DIR=/usr/lib64 \
-DINCLUDE_INSTALL_DIR=/usr/include \
-DUSE_LIBCALENDARING=ON \
-DPHP_BINDINGS=ON \
-DPHP_INSTALL_DIR=/usr/lib64/php/modules \
-DPYTHON_BINDINGS=ON \
-DCMAKE_BUILD_TYPE=Release \
..
fi
if [ ${dobuild} -eq 1 ]; then
make
fi
if [ ${dotest} -eq 1 ]; then
# Execute some tests?
pushd tests
unset DISPLAY
./benchmarktest
./calendaringtest
./formattest
./freebusytest
./icalendartest
./kcalconversiontest
./upgradetest
popd
fi
if [ ${doinstall} -eq 1 ]; then
make install DESTDIR=${TMPDIR:-/tmp}
fi
cd ..
rm -rf libkolab-${version}.tar.gz
git archive --prefix=libkolab-${version}/ HEAD | gzip -c > libkolab-${version}.tar.gz
rm -rf `rpm --eval='%{_sourcedir}'`/libkolab-${version}.tar.gz
cp libkolab-${version}.tar.gz `rpm --eval='%{_sourcedir}'`
#Generate PHP wrapper
include_directories(../)
include(SWIGUtils)
generatePHPBindings(kolabcalendaring ../calendaring.i)
<?php
//run using "php -d enable_dl=On extension=./kolabcalendaring.so test.php [--verbose]"
include("kolabformat.php");
include("kolabcalendaring.php");
/////// Basic unit test facilities
$errors = 0;
$verbose = preg_match('/\s(--verbose|-v)\b/', join(' ', $_SERVER['argv']));
function assertequal($got, $expect, $name) {
global $verbose, $errors;
if ($got == $expect) {
if ($verbose)
print "OK - $name\n";
return true;
}
else {
$errors++;
print "FAIL - $name\n";
print "-- Expected " . var_export($expect, true) . ", got " . var_export($got, true) . " --\n";
return false;
}
}
function asserttrue($arg, $name) {
return assertequal($arg, true, $name);
}
function assertfalse($arg, $name) {
return assertequal($arg, false, $name);
}
/////// Test EventCal recurrence
$xml = <<<EOF
<icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
<vcalendar>
<properties>
<prodid>
<text>Libkolab-0.4 Libkolabxml-0.9</text>
</prodid>
<version>
<text>2.0</text>
</version>
<x-kolab-version>
<text>3.0dev1</text>
</x-kolab-version>
</properties>
<components>
<vevent>
<properties>
<uid>
<text>DDDEBE616DB7480A003725D1D7C4C2FE-8C02E7EEB49870A2</text>
</uid>
<created><date-time>2012-10-23T11:04:53Z</date-time></created>
<dtstamp><date-time>2012-10-23T13:04:53Z</date-time></dtstamp>
<sequence>
<integer>0</integer>
</sequence>
<class>
<text>PUBLIC</text>
</class>
<dtstart>
<parameters>
<tzid>
<text>/kolab.org/Europe/Paris</text>
</tzid>
</parameters>
<date-time>2012-10-23T14:00:00</date-time>
</dtstart>
<dtend>
<parameters>
<tzid>
<text>/kolab.org/Europe/Paris</text>
</tzid>
</parameters>
<date-time>2012-10-23T15:30:00</date-time>
</dtend>
<rrule>
<recur>
<freq>DAILY</freq>
<count>4</count>
<interval>2</interval>
</recur>
</rrule>
<summary>
<text>Recurring with libkolab</text>
</summary>
</properties>
</vevent>
</components>
</vcalendar>
</icalendar>
EOF;
$rdates = <<<EOF
<icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
<vcalendar>
<properties>
<prodid>
<text>Roundcube-libkolab-0.9 Libkolabxml-1.1</text>
</prodid>
<version>
<text>2.0</text>
</version>
<x-kolab-version>
<text>3.1.0</text>
</x-kolab-version>
</properties>
<components>
<vevent>
<properties>
<uid>
<text>49961C572093EC3FC125799C004A200F-Lotus_Notes_Generated</text>
</uid>
<created>
<date-time>2014-02-28T12:57:42Z</date-time>
</created>
<dtstamp>
<date-time>2014-02-28T12:57:42Z</date-time>
</dtstamp>
<sequence>
<integer>0</integer>
</sequence>
<class>
<text>PUBLIC</text>
</class>
<dtstart>
<parameters>
<tzid>
<text>/kolab.org/Europe/Amsterdam</text>
</tzid>
</parameters>
<date-time>2012-03-30T04:00:00</date-time>
</dtstart>
<dtend>
<parameters>
<tzid>
<text>/kolab.org/Europe/Amsterdam</text>
</tzid>
</parameters>
<date-time>2012-03-30T20:00:00</date-time>
</dtend>
<transp>
<text>TRANSPARENT</text>
</transp>
<rdate>
<date>2012-03-30</date>
<date>2013-03-30</date>
<date>2014-03-30</date>
<date>2015-03-30</date>
<date>2016-03-30</date>
<date>2017-03-30</date>
<date>2018-03-30</date>
<date>2019-03-30</date>
<date>2020-03-30</date>
<date>2021-03-30</date>
</rdate>
<summary>
<text>Geburtstag Jane Doe (30.03.1969)</text>
</summary>
</properties>
</vevent>
</components>
</vcalendar>
</icalendar>
EOF;
$e = kolabformat::readEvent($xml, false);
$ec = new EventCal($e);
$rstart = new cDateTime(2012,8,1, 0,0,0);
# asserttrue($ec->getNextOccurence($rstart) instanceof cDateTime, "EventCal::getNextOccurence() returning cDateTime instance");
$next = new cDateTime($ec->getNextOccurence($rstart));
assertequal(
sprintf("%d-%d-%d %02d:%02d:%02d", $next->year(), $next->month(), $next->day(), $next->hour(), $next->minute(), $next->second()),
"2012-10-23 14:00:00",
"EventCal first recurrence"
);
$next = new cDateTime($ec->getNextOccurence($next));
assertequal(
sprintf("%d-%d-%d %02d:%02d:%02d", $next->year(), $next->month(), $next->day(), $next->hour(), $next->minute(), $next->second()),
"2012-10-25 14:00:00",
"EventCal second recurrence"
);
$end = new cDateTime($ec->getOccurenceEndDate($next));
assertequal(
sprintf("%d-%d-%d %02d:%02d:%02d", $end->year(), $end->month(), $end->day(), $end->hour(), $end->minute(), $end->second()),
"2012-10-25 15:30:00",
"EventCal::getOccurenceEndDate"
);
$last = new cDateTime($ec->getLastOccurrence());
assertequal(
sprintf("%d-%d-%d %02d:%02d:%02d", $last->year(), $last->month(), $last->day(), $last->hour(), $last->minute(), $last->second()),
"2012-10-29 14:00:00",
"EventCal::getLastOccurence"
);
// test event with RDATE list
$e = kolabformat::readEvent($rdates, false);
$ec = new EventCal($e);
$rstart = new cDateTime(2012,3,1, 0,0,0);
$next = new cDateTime($ec->getNextOccurence($rstart));
assertequal(
sprintf("%d-%02d-%02d %02d:%02d:%02d", $next->year(), $next->month(), $next->day(), $next->hour(), $next->minute(), $next->second()),
"2012-03-30 04:00:00",
"RDATE first recurrence"
);
$next = new cDateTime($ec->getNextOccurence($next));
assertequal(
sprintf("%d-%02d-%02d %02d:%02d:%02d", $next->year(), $next->month(), $next->day(), $next->hour(), $next->minute(), $next->second()),
"2013-03-30 04:00:00",
"RDATE next recurrence"
);
$last = new cDateTime($ec->getLastOccurrence());
assertequal(
sprintf("%d-%02d-%d %02d:%02d:%02d", $last->year(), $last->month(), $last->day(), $last->hour(), $last->minute(), $last->second()),
"2021-03-30 04:00:00",
"RDATE last occurence"
);
// terminate with error status
exit($errors);
include_directories(../)
include(SWIGUtils)
generatePythonBindings(calendaring ../calendaring.i)
\ No newline at end of file
#Generate PHP wrapper
include_directories(../)
include(SWIGUtils)
generatePHPBindings(kolabicalendar ../icalendar.i)
include_directories(../)
include(SWIGUtils)
generatePythonBindings(icalendar ../icalendar.i)
#Generate PHP wrapper
include_directories(../)
include(SWIGUtils)
generatePHPBindings(kolabobject ../kolabobject.i)
<?php
//run using:
// php -d enable_dl=On -dextension=/usr/local/lib/php/modules/kolabshared.so -dextension=/usr/local/lib/php/modules/kolabformat.so -dextension=/usr/local/lib/php/modules/kolabobject.so test.php
include("kolabformat.php");
include("kolabobject.php");
/////// Test Event
$e = new Event();
$e->setCreated(new cDateTime(2012,3,14, 9,5,30, true));
$e->setStart(new cDateTime(2012,7,31));
$e->setUid("uid");
$e->setPriority(1);
$xo = new XMLObject;
print $xo->writeEvent($e, kolabobject::KolabV2, "test.php");
print $xo->writeEvent($e, kolabobject::KolabV3, "test.php");
////// Test Contact
$c = new Contact();
$nc = new NameComponents;
$sn = new vectors;
$sn->push("Contact");
$nc->setSurnames($sn);
$gn = new vectors;
$gn->push("Sample");
$nc->setGiven($gn);
$c->setNameComponents($nc);
$c->setName("Sample Contact");
$em = new vectors;
$em->push("sample.v2@localhost");
$c->setEmailAddresses($em);
$xo = new XMLObject;
print $xo->writeContact($c, kolabobject::KolabV2, "test.php");
print "UID = " . $xo->getSerializedUID() . "\n\n";
print $xo->writeContact($c, kolabobject::KolabV3, "test.php");
print "UID = " . $xo->getSerializedUID() . "\n\n";
$dlxml = <<<EOL
<?xml version="1.0"?>
<distribution-list version="1.0">
<uid>ebb1774429a2e03afafb31f233e23b42</uid>
<body></body>
<categories></categories>
<creation-date>2010-11-25T18:02:32Z</creation-date>
<last-modification-date>2011-07-23T09:06:38Z</last-modification-date>
<sensitivity>public</sensitivity>
<product-id>Horde::Kolab</product-id>
<display-name>Another lista</display-name>
<member>
<display-name>Another User</display-name>
<smtp-address>other@debian-vm.local</smtp-address>
<uid>a2cfdc52365ef429042413bf7717dc85</uid>
</member>
<member>
<display-name>Sample A. User Jr.</display-name>
<smtp-address>sample@debian-vm.local</smtp-address>
<uid>f538c7e9ad5a63e4452b7db3bc291231</uid>
</member>
</distribution-list>
EOL;
$xo = new XMLObject;
$dl = new DistList($xo->readDistList($dlxml, kolabobject::KolabV2));
echo $dl->uid() . "\n\n";
$ml = $dl->members();
for ($i=0; $i < $ml->size(); $i++) {
$m = $ml->get($i);
echo "Member [" . $m->type() . "]: " . $m->uid() . "; " . $m->email() . "\n";
}
$dl2 = new DistList();
$ml = new vectorcontactref;
$m1 = new ContactReference(ContactReference::UidReference, 'some-uid-value');
$ml->push($m1);
$m2 = new ContactReference(ContactReference::EmailReference, 'sample@localhost');
$ml->push($m2);
$dl2->setMembers($ml);
echo $xo->writeDistList($dl2, kolabobject::KolabV2);
echo $xo->writeDistList($dl2, kolabobject::KolabV3);
?>
include_directories(../)
include(SWIGUtils)
generatePythonBindings(kolabobject ../kolabobject.i)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment