diff options
author | Anas Nashif <anas.nashif@intel.com> | 2012-11-04 12:13:45 -0800 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2018-04-30 10:07:00 +0900 |
commit | ce247fdc42a556067557481058a97d0f8263a847 (patch) | |
tree | 9d1181787fe8168d226f08474f0cdfa21133381e | |
parent | 3fa6014dff6063ae5134a839292c7cbbb8ba855b (diff) | |
download | libzio-ce247fdc42a556067557481058a97d0f8263a847.tar.gz libzio-ce247fdc42a556067557481058a97d0f8263a847.tar.bz2 libzio-ce247fdc42a556067557481058a97d0f8263a847.zip |
Rebase for libzio 1.06
Change-Id: Ib3fbc1bdcfb2fbc950413a896940fd6105545c45
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
-rw-r--r-- | packaging/baselibs.conf | 2 | ||||
-rw-r--r-- | packaging/libzio.manifest | 5 | ||||
-rw-r--r-- | packaging/libzio.spec | 91 | ||||
-rwxr-xr-x | run_test.sh | 57 |
4 files changed, 155 insertions, 0 deletions
diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf new file mode 100644 index 0000000..b3fafc1 --- /dev/null +++ b/packaging/baselibs.conf @@ -0,0 +1,2 @@ +arch ppc package libzio +arch sparcv9 package libzio diff --git a/packaging/libzio.manifest b/packaging/libzio.manifest new file mode 100644 index 0000000..017d22d --- /dev/null +++ b/packaging/libzio.manifest @@ -0,0 +1,5 @@ +<manifest> + <request> + <domain name="_"/> + </request> +</manifest> diff --git a/packaging/libzio.spec b/packaging/libzio.spec new file mode 100644 index 0000000..7517696 --- /dev/null +++ b/packaging/libzio.spec @@ -0,0 +1,91 @@ + +%if "%{run_tests}" == "1" + %define check %%check +%endif + + +Name: libzio +Version: 1.04 +Release: 0 +License: GPL-2.0+ +Summary: A Library for Accessing Compressed Text Files +Group: System/Libraries +Source: %{name}-%{version}.tar.bz2 +Source2: baselibs.conf +Source1001: libzio.manifest +BuildRequires: bzip2-devel +BuildRequires: xz +BuildRequires: xz-devel +BuildRequires: zlib-devel + +%description +Libzio provides a wrapper function for reading or writing gzip or bzip2 +files with FILE streams. + +%package devel +Summary: Libzio development files +Group: Development/Libraries/C and C++ +Requires: libzio = %{version} + +%description devel +Libzio development files including zio.h, the manual page fzopen(3), +and static library. + +%prep +%setup -q +cp %{SOURCE1001} . + +%build +make %{?_smp_mflags} noweak + +%check +make testt +make tests + +export TEST_LOG="/tmp/%{name}_test" +rm -f $TEST_LOG +chmod 755 ./run_test.sh +for comp in gzip bzip2 lzma xz +do + $comp -c < fzopen.3.in > fzopen.test + ./testt fzopen.test | cmp fzopen.3.in - + if [ $? == 0 ] + then + echo "TEST: PASS: $comp uncompress test" >> $TEST_LOG + else + echo "TEST: FAIL: $comp uncompress test" >> $TEST_LOG + fi + cat fzopen.test | ./tests ${comp:0:1} | cmp fzopen.3.in - + if [ $? == 0 ] + then + echo "TEST: PASS: $comp uncompress test" >> $TEST_LOG + else + echo "TEST: FAIL: $comp uncompress test" >> $TEST_LOG + fi +done +./run_test.sh %{name} %{version} + +%install +make DESTDIR=%{buildroot} install libdir=%{_libdir} mandir=%{_mandir} + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%manifest %{name}.manifest +%defattr(-,root,root) +%license COPYING +%{_libdir}/libzio.so.1 +%{_libdir}/libzio.so.%{version} + +%files devel +%manifest %{name}.manifest +%defattr(-,root,root) +%license COPYING +%{_libdir}/libzio.a +%{_libdir}/libzio.so +%{_mandir}/man3/fzopen.3* +/usr/include/zio.h + +%changelog diff --git a/run_test.sh b/run_test.sh new file mode 100755 index 0000000..4257d1e --- /dev/null +++ b/run_test.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +PACKAGE_NAME=$1 +PACKAGE_VERSION=$2 + +TEST_LOG="/tmp/${PACKAGE_NAME}_test" +export TEST_LOG + +# Color +Color_Off='\e[0m' # Text Reset + +# Regular Colors +Red='\e[0;31m' # Red +Green='\e[0;32m' # Green +Cyan='\e[0;36m' # Cyank + +# Bold +BWhite='\e[1;37m' # White + +result_check() { + test_case=$1 + if [ $? -eq 0 ] + then + echo -e "${Green}PASS${Color_Off}: $test_case" + echo "TEST: PASS: $test_case" >> ${TEST_LOG} + else + echo -e "${Red}FAIL${Color_Off}: $test_case" + echo -e "TEST: FAIL: $test_case" >> ${TEST_LOG} + fi +} + +skip_test() { + test_case=$1 + echo -e "${Cyan}SKIP${Color_Off}: $test_case" + echo "TEST: SKIP: $test_case" >> ${TEST_LOG} +} + +TOTAL_CNT=`grep "TEST:" ${TEST_LOG} | wc -l` +PASS_CNT=`grep "PASS:" ${TEST_LOG} | wc -l` +FAIL_CNT=`grep "FAIL:" ${TEST_LOG} | wc -l` +SKIP_CNT=`grep "SKIP:" ${TEST_LOG} | wc -l` + + +br='==================='; br=$br$br$br$br; + +echo -e "${Green}$br ${Color_Off}" +echo -e "${Green}Testsuite summary for ${PACKAGE_NAME} ${PACKAGE_VERSION}${Color_Off}" +echo -e "${Green}$br ${Color_Off}" +echo -e "#${BWhite} TOTAL: $TOTAL_CNT ${Color_Off}" +echo -e "#${Green} PASS${Color_Off} : $PASS_CNT" +echo -e "#${Red} FAIL${Color_Off} : $FAIL_CNT" +echo -e "#${Cyan} SKIP${Color_Off} : $SKIP_CNT" +echo -e "${Green}$br ${Color_Off}" + +rm -f ${TEST_LOG} +exit 0 + |