lzma.spec 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. ##
  2. ## lzma.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package version
  24. %define V_opkg 4.x
  25. %define V_lzmautils 4.999.3alpha
  26. %define V_sdk 459
  27. # package information
  28. Name: lzma
  29. Summary: Lempel-Ziv-Markov Algorithm (LZMA) Compression
  30. URL: http://tukaani.org/lzma/
  31. Vendor: Igor Pavlov, Lasse Collin
  32. Packager: OpenPKG Foundation e.V.
  33. Distribution: OpenPKG Community
  34. Class: EVAL
  35. Group: Compression
  36. License: LGPL
  37. Version: %{V_opkg}
  38. Release: 20080813
  39. # list of sources
  40. Source0: http://tukaani.org/lzma/lzma-%{V_lzmautils}.tar.gz
  41. Source1: http://switch.dl.sourceforge.net/sevenzip/7z%{V_sdk}.tar.bz2
  42. Patch0: lzma.patch
  43. # build information
  44. Prefix: %{l_prefix}
  45. BuildRoot: %{l_buildroot}
  46. BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc, gcc::with_cxx = yes
  47. PreReq: OpenPKG, openpkg >= 20060823
  48. AutoReq: no
  49. AutoReqProv: no
  50. %description
  51. Simple command line implementation of LZMA compression algorithm.
  52. This tool uses raw LZMA format as opposed to 7z container format,
  53. which uses LZMA as the default compression algorithm, but has
  54. many additional features and a header incompatible to that of raw
  55. LZMA streams. If you need to create highly-compatible archives,
  56. you probably want to use p7zip(1). lzma(1) is taken from the LZMA
  57. SDK. Compression ratio is about 25-30% better than bzip2(1) and
  58. decompression speed is about two times faster. The downside is
  59. higher CPU and RAM requirements for compression.
  60. %track
  61. prog lzma:lzmautils = {
  62. version = %{V_lzmautils}
  63. url = http://tukaani.org/lzma/download
  64. regex = lzma-(__VER__)\.tar\.gz
  65. }
  66. prog lzma:sdk = {
  67. version = %{V_sdk}
  68. url = http://prdownloads.sourceforge.net/sevenzip/
  69. regex = 7z(__VER__)\.tar\.bz2
  70. }
  71. %prep
  72. %setup -q -c
  73. %setup -q -c -T -D -a 1
  74. %patch -p0 -d lzma-%{V_lzmautils}
  75. %build
  76. # build LZMA from LZMA Utils
  77. ( cd lzma-%{V_lzmautils}
  78. CC="%{l_cc}" \
  79. CFLAGS="%{l_cflags -O}" \
  80. ./configure \
  81. --prefix=%{l_prefix} \
  82. --mandir=%{l_prefix}/man \
  83. --without-libiconv-prefix \
  84. --without-libintl-prefix \
  85. --disable-nls \
  86. --disable-shared
  87. %{l_make} %{l_mflags}
  88. ) || exit $?
  89. # build LZMA from 7-Zip SDK
  90. ( cd CPP/7zip/Compress/LZMA_Alone
  91. %{l_make} %{l_mflags} -f makefile.gcc \
  92. CXX="%{l_cxx} %{l_cxxflags -O} -D_LZMA_SYSTEM_SIZE_T" \
  93. CXX_C="%{l_cc} %{l_cflags -O} -D_LZMA_SYSTEM_SIZE_T"
  94. ) || exit $?
  95. %install
  96. rm -rf $RPM_BUILD_ROOT
  97. # install LZMA from LZMA Utils
  98. ( cd lzma-%{V_lzmautils}
  99. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  100. ) || exit $?
  101. # install LZMA from 7-Zip SDK
  102. %{l_shtool} mkdir -f -p -m 755 \
  103. $RPM_BUILD_ROOT%{l_prefix}/bin
  104. %{l_shtool} install -c -s -m 755 \
  105. CPP/7zip/Compress/LZMA_Alone/lzma \
  106. $RPM_BUILD_ROOT%{l_prefix}/bin/lzma-7z
  107. # determine installation files
  108. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  109. %files -f files
  110. %clean
  111. rm -rf $RPM_BUILD_ROOT