lzma.spec 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. ##
  2. ## lzma.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package version
  25. %define V_opkg 4.x
  26. %define V_lzmautils 4.42.2alpha
  27. %define V_sdk 457
  28. # package information
  29. Name: lzma
  30. Summary: Lempel-Ziv-Markov Algorithm (LZMA) Compression
  31. URL: http://tukaani.org/lzma/
  32. Vendor: Igor Pavlov, Lasse Collin
  33. Packager: OpenPKG Foundation e.V.
  34. Distribution: OpenPKG Community
  35. Class: EVAL
  36. Group: Compression
  37. License: LGPL
  38. Version: %{V_opkg}
  39. Release: 20071210
  40. # list of sources
  41. Source0: http://tukaani.org/lzma/lzma-%{V_lzmautils}.tar.gz
  42. Source1: http://switch.dl.sourceforge.net/sevenzip/7z%{V_sdk}.tar.bz2
  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. %build
  75. # build LZMA from LZMA Utils
  76. ( cd lzma-%{V_lzmautils}
  77. CC="%{l_cc}" \
  78. CXX="%{l_cxx}" \
  79. CFLAGS="%{l_cflags -O}" \
  80. CXXFLAGS="%{l_cxxflags -O}" \
  81. ./configure \
  82. --prefix=%{l_prefix} \
  83. --mandir=%{l_prefix}/man \
  84. --without-libiconv-prefix \
  85. --without-libintl-prefix \
  86. --disable-nls \
  87. --disable-shared
  88. %{l_make} %{l_mflags}
  89. ) || exit $?
  90. # build LZMA from 7-Zip SDK
  91. ( cd CPP/7zip/Compress/LZMA_Alone
  92. %{l_make} %{l_mflags} -f makefile.gcc \
  93. CXX="%{l_cxx} %{l_cxxflags -O} -D_LZMA_SYSTEM_SIZE_T" \
  94. CXX_C="%{l_cc} %{l_cflags -O} -D_LZMA_SYSTEM_SIZE_T"
  95. ) || exit $?
  96. %install
  97. rm -rf $RPM_BUILD_ROOT
  98. # install LZMA from LZMA Utils
  99. ( cd lzma-%{V_lzmautils}
  100. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  101. ) || exit $?
  102. # install LZMA from 7-Zip SDK
  103. %{l_shtool} mkdir -f -p -m 755 \
  104. $RPM_BUILD_ROOT%{l_prefix}/bin
  105. %{l_shtool} install -c -s -m 755 \
  106. CPP/7zip/Compress/LZMA_Alone/lzma \
  107. $RPM_BUILD_ROOT%{l_prefix}/bin/lzma-7z
  108. # determine installation files
  109. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  110. %files -f files
  111. %clean
  112. rm -rf $RPM_BUILD_ROOT