create core package

This commit is contained in:
aydemir
2015-02-24 11:18:35 +02:00
parent 0e4b743b82
commit 70b25d0f95
1098 changed files with 169545 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/copyleft/gpl.txt
from pisi.actionsapi import shelltools
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import get
def setup():
pisitools.flags.remove("-DNDEBUG")
shelltools.system("./autogen.sh")
autotools.configure("--prefix=/usr \
--disable-static \
--enable-shared")
pisitools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ")
def build():
autotools.make()
def build():
autotools.make("check")
def install():
autotools.rawInstall("DESTDIR=%s" % get.installDIR())
pisitools.dodoc("README", "COPYING", "ChangeLog", "NEWS", "AUTHORS")
+106
View File
@@ -0,0 +1,106 @@
--- a/snappy_unittest.cc
+++ b/snappy_unittest.cc
@@ -57,6 +57,8 @@ DEFINE_bool(liblzf, false,
"(http://www.goof.com/pcg/marc/liblzf.html)");
DEFINE_bool(fastlz, false,
"Run FastLZ compression (http://www.fastlz.org/");
+DEFINE_bool(csnappy, false,
+ "Run csnappy compression (https://github.com/zeevt/csnappy/)");
DEFINE_bool(snappy, true, "Run snappy compression");
@@ -121,11 +123,11 @@ typedef string DataEndingAtUnreadablePage;
#endif
enum CompressorType {
- ZLIB, LZO, LIBLZF, QUICKLZ, FASTLZ, SNAPPY
+ ZLIB, LZO, LIBLZF, QUICKLZ, FASTLZ, CSNAPPY, SNAPPY,
};
const char* names[] = {
- "ZLIB", "LZO", "LIBLZF", "QUICKLZ", "FASTLZ", "SNAPPY"
+ "ZLIB", "LZO", "LIBLZF", "QUICKLZ", "FASTLZ", "CSNAPPY", "SNAPPY",
};
static size_t MinimumRequiredOutputSpace(size_t input_size,
@@ -156,6 +158,12 @@ static size_t MinimumRequiredOutputSpace(size_t input_size,
return max(static_cast<int>(ceil(input_size * 1.05)), 66);
#endif // FASTLZ_VERSION
+#ifdef CSNAPPY_VERSION
+ case CSNAPPY:
+ return static_cast<size_t>(csnappy_max_compressed_length(
+ static_cast<uint32_t>(input_size)));
+#endif // CSNAPPY_VERSION
+
case SNAPPY:
return snappy::MaxCompressedLength(input_size);
@@ -266,6 +274,24 @@ static bool Compress(const char* input, size_t input_size, CompressorType comp,
}
#endif // FASTLZ_VERSION
+#ifdef CSNAPPY_VERSION
+ case CSNAPPY: {
+ uint32_t destlen;
+ char* mem = new char[CSNAPPY_WORKMEM_BYTES];
+ csnappy_compress(input, input_size,
+ string_as_array(compressed),
+ &destlen,
+ mem,
+ CSNAPPY_WORKMEM_BYTES_POWER_OF_TWO);
+ delete[] mem;
+ CHECK_LE(destlen, csnappy_max_compressed_length(input_size));
+ if (!compressed_is_preallocated) {
+ compressed->resize(destlen);
+ }
+ break;
+ }
+#endif // CSNAPPY_VERSION
+
case SNAPPY: {
size_t destlen;
snappy::RawCompress(input, input_size,
@@ -364,9 +390,23 @@ static bool Uncompress(const string& compressed, CompressorType comp,
}
#endif // FASTLZ_VERSION
+#ifdef CSNAPPY_VERSION
+ case CSNAPPY: {
+ int ret = csnappy_decompress(
+ compressed.data(),
+ (uint32_t)compressed.size(),
+ string_as_array(output),
+ (uint32_t)size);
+ CHECK_EQ(ret, CSNAPPY_E_OK);
+ break;
+ }
+#endif // CSNAPPY_VERSION
+
case SNAPPY: {
- snappy::RawUncompress(compressed.data(), compressed.size(),
- string_as_array(output));
+ bool ret = snappy::RawUncompress(compressed.data(),
+ compressed.size(),
+ string_as_array(output));
+ CHECK_EQ(ret, true);
break;
}
@@ -464,7 +504,7 @@ static void Measure(const char* data,
string urate = (uncomp_rate >= 0)
? StringPrintf("%.1f", uncomp_rate)
: string("?");
- printf("%-7s [b %dM] bytes %6d -> %6d %4.1f%% "
+ printf("%-8s [b %dM] bytes %6d -> %6d %4.1f%% "
"comp %5.1f MB/s uncomp %5s MB/s\n",
x.c_str(),
block_size/(1<<20),
@@ -1013,6 +1053,7 @@ static void MeasureFile(const char* fname) {
if (FLAGS_liblzf) Measure(input, len, LIBLZF, repeats, 1024<<10);
if (FLAGS_quicklz) Measure(input, len, QUICKLZ, repeats, 1024<<10);
if (FLAGS_fastlz) Measure(input, len, FASTLZ, repeats, 1024<<10);
+ if (FLAGS_csnappy) Measure(input, len, CSNAPPY, repeats, 1024<<10);
if (FLAGS_snappy) Measure(input, len, SNAPPY, repeats, 4096<<10);
// For block-size based measurements
+56
View File
@@ -0,0 +1,56 @@
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
<Source>
<Name>snappy</Name>
<Homepage>http://code.google.com/p/snappy/</Homepage>
<Packager>
<Name>Alihan Öztürk</Name>
<Email>alihan@pisilinux.org</Email>
</Packager>
<License>BSD</License>
<IsA>library</IsA>
<Summary>A fast compressor/decompressor librar</Summary>
<Description>Snappy is a compression/decompression library. It does not aim for maximum compression, or compatibility with any other compression library; instead, it aims for very high speeds and reasonable compression.</Description>
<BuildDependencies>
<Dependency>lzo-devel</Dependency>
</BuildDependencies>
<Archive sha1sum="2988f1227622d79c1e520d4317e299b61d042852" type="targz">http://snappy.googlecode.com/files/snappy-1.1.1.tar.gz</Archive>
<Patches>
<Patch level="1">snappy-unittest.patch</Patch>
</Patches>
</Source>
<Package>
<Name>snappy</Name>
<Files>
<Path fileType="library">/usr/lib</Path>
<Path fileType="doc">/usr/share/doc</Path>
<Path fileType="data">/usr/share</Path>
</Files>
</Package>
<Package>
<Name>snappy-devel</Name>
<RuntimeDependencies>
<Dependency release="current">snappy</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="header">/usr/include</Path>
</Files>
</Package>
<History>
<Update release="2">
<Date>2014-06-02</Date>
<Version>1.1.1</Version>
<Comment>Rebuild</Comment>
<Name>Serdar Soytetir</Name>
<Email>kaptan@pisilinux.org</Email>
</Update>
<Update release="1">
<Date>2013-12-12</Date>
<Version>1.1.1</Version>
<Comment>First Release</Comment>
<Name>Alihan Öztürk</Name>
<Email>alihan@pisilinux.org</Email>
</Update>
</History>
</PISI>
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" ?>
<PISI>
<Source>
<Name>snappy</Name>
<Summary xml:lang="tr">Linux için sıkıştırma/ayıklama kütüphanesidir.</Summary>
<Description xml:lang="tr">Linux için sıkıştırma/ayıklama kütüphanesidir. Yüksek hızda sıkıştırma yapmak için yazılmış bir kütüphanedir.</Description>
</Source>
<Package>
<Name>snappy-devel</Name>
<Summary xml:lang="tr">snappy için geliştirme dosyaları</Summary>
</Package>
</PISI>