file.spec 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. ##
  2. ## file.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2005 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2005 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_api_c 4.15
  26. %define V_api_pl 0.82
  27. # package information
  28. Name: file
  29. Summary: Automatic File Content Type Recognition Tool
  30. URL: ftp://ftp.astron.com/pub/file/
  31. Vendor: Christos Zoulas
  32. Packager: OpenPKG
  33. Distribution: OpenPKG
  34. Class: BASE
  35. Group: Filesystem
  36. License: BSD
  37. Version: %{V_api_c}
  38. Release: 20050819
  39. # package options
  40. %option with_perl no
  41. # list of sources
  42. Source0: ftp://ftp.astron.com/pub/file/file-%{V_api_c}.tar.gz
  43. Source1: http://www.cpan.org/modules/by-module/File/File-LibMagic-%{V_api_pl}.tgz
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20040130, gcc, make
  48. PreReq: OpenPKG, openpkg >= 20040130
  49. BuildPreReq: zlib
  50. PreReq: zlib
  51. %if "%{with_perl}" == "yes"
  52. BuildPreReq: perl, perl-openpkg
  53. PreReq: perl
  54. %endif
  55. AutoReq: no
  56. AutoReqProv: no
  57. %description
  58. The popular file(1) command which determines the type of a file by
  59. peeking at magic bytes of its content.
  60. %track
  61. prog file = {
  62. version = %{V_api_c}
  63. url = ftp://ftp.astron.com/pub/file/
  64. regex = file-(__VER__)\.tar\.gz
  65. }
  66. prog file:File-LibMagic = {
  67. version = %{V_api_pl}
  68. url = http://www.cpan.org/modules/by-module/File/
  69. regex = File-LibMagic-(__VER__)\.tgz
  70. }
  71. %prep
  72. %setup -q
  73. %setup -q -D -T -a 1
  74. %build
  75. ACLOCAL=true \
  76. AUTOCONF=true \
  77. AUTOMAKE=true \
  78. AUTOHEADER=true \
  79. CC="%{l_cc}" \
  80. CFLAGS="%{l_cflags -O} %{l_cppflags}" \
  81. CPPFLAGS="%{l_cppflags}" \
  82. LDFLAGS="%{l_ldflags}" \
  83. ./configure \
  84. --prefix=%{l_prefix} \
  85. --disable-shared \
  86. --disable-nls
  87. %{l_make} %{l_mflags}
  88. %if "%{with_perl}" == "yes"
  89. %{l_shtool} subst \
  90. -e 's;-I\.;-I. -I../src;g' \
  91. -e 's;-lmagic;-L../src/.libs -lmagic %{l_ldflags} -lz;' \
  92. File-LibMagic-%{V_api_pl}/Makefile.PL
  93. %{l_prefix}/bin/perl-openpkg prepare
  94. %{l_prefix}/bin/perl-openpkg -d File-LibMagic-%{V_api_pl} configure build
  95. %endif
  96. %install
  97. rm -rf $RPM_BUILD_ROOT
  98. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  99. %if "%{with_perl}" == "yes"
  100. %{l_prefix}/bin/perl-openpkg -d File-LibMagic-%{V_api_pl} install
  101. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  102. %else
  103. >perl-openpkg-files
  104. %endif
  105. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  106. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} `cat perl-openpkg-files`
  107. %files -f files
  108. %clean
  109. rm -rf $RPM_BUILD_ROOT