diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..75b84a9 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,59 @@ +language: generic + +sudo: required + +services: +- docker + +env: + matrix: + - MOCK_CONFIG=fedora-rawhide-x86_64 + +script: + - PKG=$(git log -1 --pretty=%s | sed 's/:.*//') + - if [[ ! -d ${PKG} ]]; then echo "Directory ${PKG} not found"; exit 1; fi + - if [[ ! -f ${PKG}/${PKG}.spec ]]; then echo "No spec file (${PKG}.spec found in directory ${PKG}"; exit 1; fi + - | + { + H="/travis/${PKG}" + echo "#!/bin/bash -xe" + echo "dnf -q -y install fedora-review" + echo "rpmbuild -D'_sourcedir ${H}' -D'_srcrpmdir ${H}' -bs ${H}/${PKG}.spec" + echo "useradd -d ${H} -g mock review" + echo "chown -R review:mock ${H}" + echo "/travis/spinner.sh \"su - -c 'fedora-review -v --mock-config ${MOCK_CONFIG} -n ${PKG}' review\" || { cat ${H}/.cache/fedora-review.log; find ${H}/review-${PKG} -name '*.log' -print -exec cat {} \\;; exit 1; }" + echo "find ${H}/review-${PKG} -name '*.log' -print -exec cat {} \\;" + echo "cat ${H}/review-${PKG}/licensecheck.txt" + echo "cat ${H}/review-${PKG}/review.txt" + } > review.sh + - chmod +x review.sh + - docker run --privileged -v "${PWD}:/travis:rw" -it fedora:latest /travis/review.sh + +after_success: + - git config --global user.name "Automatic Deployment (Travis CI)" + - git config --global user.email "builds@travis-ci.org" + - git fetch origin gh-pages && git checkout -b gh-pages FETCH_HEAD + - cd ${PKG} + - rm -f ${PKG}*.src.rpm + - git checkout ${TRAVIS_COMMIT} -- ./${PKG}.spec + - cp review-${PKG}/review.txt . + - cp review-${PKG}/results/${PKG}*.src.rpm . + - git add ${PKG}.spec ${PKG}*.src.rpm review.txt + - git diff HEAD -- ${PKG}.spec review.txt | cat + - if [[ ${encrypted_404fa93e7e35_key} && ${encrypted_404fa93e7e35_iv} && ${TRAVIS_BRANCH} == master ]]; then + git commit -m "Review output"; + mkdir -p ~/.ssh; + chmod 700 ~/.ssh; + openssl aes-256-cbc -K $encrypted_404fa93e7e35_key -iv $encrypted_404fa93e7e35_iv -in ../deploy.enc -out ~/.ssh/id_rsa -d; + chmod 600 ~/.ssh/id_rsa; + git push git@github.com:${TRAVIS_REPO_SLUG} gh-pages:gh-pages; + echo "###################################################"; + echo "Spec URL http://${TRAVIS_REPO_SLUG%/*}.github.io/${TRAVIS_REPO_SLUG#*/}/${PKG}/${PKG}.spec"; + echo "SRPM URL http://${TRAVIS_REPO_SLUG%/*}.github.io/${TRAVIS_REPO_SLUG#*/}/${PKG}/$(echo ${PKG}*.src.rpm)"; + echo "Review.txt http://${TRAVIS_REPO_SLUG%/*}.github.io/${TRAVIS_REPO_SLUG#*/}/${PKG}/review.txt"; + echo "Build log https://travis-ci.org/${TRAVIS_REPO_SLUG}/builds/${TRAVIS_BUILD_ID}"; + echo "Raw Build log https://s3.amazonaws.com/archive.travis-ci.org/jobs/$((${TRAVIS_BUILD_ID}+1))/log.txt"; + echo "###################################################"; + else + git status; + fi diff --git a/libslz/libslz-1.1.0.tar.gz b/libslz/libslz-1.1.0.tar.gz new file mode 100644 index 0000000..59e7763 Binary files /dev/null and b/libslz/libslz-1.1.0.tar.gz differ diff --git a/libslz/libslz.spec b/libslz/libslz.spec new file mode 100644 index 0000000..2708dae --- /dev/null +++ b/libslz/libslz.spec @@ -0,0 +1,79 @@ +Name: libslz +Version: 1.1.0 +Release: 1%{?dist} +Summary: StateLess Zip + +Group: System Environment/Libraries +License: MIT +# TODO when upstream is ready +# URL: http://libslz.org/ +URL: http://1wt.eu/projects/libslz/ +# The tarball is currently generated manually until source tarballs +# are distributed upstream: +# V=%%version +# git archive --format=tgz --prefix=libtgz-$V/ --output=libslz-$V.tar.gz v$V +Source: http://git.1wt.eu/web?p=%{name}.git;a=snapshot;h=v%{version};sf=tgz#/%{name}-%{version}.tar.gz + +BuildRequires: gcc + +%description +SLZ is a fast and memory-less stream compressor which produces an output that +can be decompressed with zlib or gzip. It does not implement decompression at +all, zlib is perfectly fine for this. + +The purpose is to use SLZ in situations where a zlib-compatible stream is +needed and zlib's resource usage would be too high while the compression ratio +is not critical. The typical use case is in HTTP servers and gateways which +have to compress many streams in parallel with little CPU resources to assign +to this task, and without having to limit the compression ratio due to the +memory usage. In such an environment, the server's memory usage can easily be +divided by 10 and the CPU usage by 3. + + +%package devel + +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + + +%description devel +Development files for SLZ, the zenc and zdec commands that respectively +compress using SLZ and dump the decoding process. + + +%prep +%setup -q -n %{name} + + +%build +%make_build CFLAGS="%{optflags}" LDFLAGS="%__global_ldflags" + + +%install +strip libslz.so.1 +%make_install PREFIX=%{_prefix} LIBDIR=%{_libdir} +chmod +x %{buildroot}%{_libdir}/*.so.* +rm %{buildroot}%{_libdir}/*.a + + +%files +%doc README +%license LICENSE +%{_libdir}/*.so.* + + +%files devel +%{_libdir}/*.so +%{_bindir}/* +%{_includedir}/* + + +%post -p /sbin/ldconfig + + +%postun -p /sbin/ldconfig + + +%changelog +* Sun Sep 25 2016 - Dridi Boukelmoune - 1.1.0-1 +- Initial spec. diff --git a/spinner.sh b/spinner.sh new file mode 100755 index 0000000..cfe018d --- /dev/null +++ b/spinner.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Small spinner script, that returns exit code of CMD and keeps colored output +# Usage: ./spinner CMD + +spinner() { + local PID=$1 + local SPIN="/-\|" + local i=0 + while kill -0 $PID >/dev/null 2>&1; do + printf "\r%s" "${SPIN:$i:1}" + i=$(($i+1)) + [[ $i -eq 4 ]] && i=0 + sleep 0.5; + done +} + +cat /tmp/update 2>/dev/null +$(script -q -e /dev/null -c "${@} 2>&1" >/tmp/output) & +PID=$! +spinner "${PID}" & +wait ${PID} +RC=$? +sleep 30 +printf "\r" +cat /tmp/output +exit $RC