summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--fastlz.spec117
2 files changed, 121 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..1e65467
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,4 @@
+SRCDIR := $(shell pwd)
+NAME := $(shell basename $(SRCDIR))
+include ../common/Makefile
+
diff --git a/fastlz.spec b/fastlz.spec
new file mode 100644
index 0000000..d6243cc
--- /dev/null
+++ b/fastlz.spec
@@ -0,0 +1,117 @@
+# spec file for fastlz
+#
+# Copyright (c) 2014 Remi Collet
+# License: CC-BY-SA
+# http://creativecommons.org/licenses/by-sa/3.0/
+#
+# Please, preserve the changelog entries
+#
+
+%global date 20070619
+%global svnrev 12
+%global abi 0
+
+Name: fastlz
+Summary: Portable real-time compression library
+Version: 0.1.0
+Release: 0.1.%{date}svnrev%{svnrev}%{?dist}
+License: MIT
+Group: System Environment/Libraries
+URL: http://fastlz.org/
+
+# svn export -r 12 http://fastlz.googlecode.com/svn/trunk/ fastlz-12
+# tar cjf fastlz-12.tar.bz2 fastlz-12
+Source0: %{name}-%{svnrev}.tar.bz2
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+
+%description
+FastLZ is a lossless data compression library designed for real-time
+compression and decompression. It favors speed over compression ratio.
+Decompression requires no memory. Decompression algorithm is very simple,
+and thus extremely fast.
+
+
+%package devel
+Summary: Header files and development libraries for %{name}
+Group: Development/Libraries
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description devel
+This package contains the header files and development libraries
+for %{name}.
+
+
+%prep
+%setup -q -n %{name}-%{svnrev}
+
+
+%build
+gcc %optflags -fPIC -c fastlz.c -o fastlz.o
+gcc %optflags -fPIC -shared \
+ -Wl,-soname -Wl,lib%{name}.so.%{abi} \
+ -o lib%{name}.so.%{abi} fastlz.o
+ln -s lib%{name}.so.%{abi} lib%{name}.so
+
+gcc %optflags -fPIC 6pack.c -L. -l%{name} -o 6pack
+gcc %optflags -fPIC 6unpack.c -L. -l%{name} -o 6unpack
+
+
+%install
+rm -rf %{buildroot}
+
+install -D -m 0755 lib%{name}.so.%{abi} %{buildroot}%{_libdir}/lib%{name}.so.%{abi}
+ln -s lib%{name}.so.%{abi} %{buildroot}%{_libdir}/lib%{name}.so
+install -D -pm 0644 %{name}.h %{buildroot}%{_includedir}/%{name}.h
+install -D -m 0755 6pack %{buildroot}%{_bindir}/6pack
+install -D -m 0755 6unpack %{buildroot}%{_bindir}/6unpack
+
+
+%check
+export LD_LIBRARY_PATH=$PWD
+cp %{name}.c tmpin
+./6pack -v
+./6unpack -v
+
+: Compress
+./6pack -1 tmpin tmpout1
+./6pack -2 tmpin tmpout2
+
+: Uncompress 1
+rm tmpin
+./6unpack tmpout1
+diff %{name}.c tmpin
+
+: Uncompress 2
+rm tmpin
+./6unpack tmpout2
+diff %{name}.c tmpin
+
+
+%clean
+rm -rf %{buildroot}
+
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+
+%files
+%defattr (-,root,root,-)
+%{!?_licensedir:%global license %%doc}
+%license LICENSE
+%{_libdir}/lib%{name}.so.%{abi}
+%{_bindir}/6pack
+%{_bindir}/6unpack
+
+%files devel
+%defattr (-,root,root,-)
+%{_libdir}/lib%{name}.so
+%{_includedir}/%{name}.h
+
+
+%changelog
+* Fri Sep 5 2014 Remi Collet <remi@fedoraproject.org> - 0.1-0.1.20070619svnrev12
+- Initial RPM \ No newline at end of file