| 1 | %global with_python3 0
|
|---|
| 2 |
|
|---|
| 3 | Summary: A utility for determining file types
|
|---|
| 4 | Name: file
|
|---|
| 5 | Version: 5.30
|
|---|
| 6 | Release: 2%{?dist}
|
|---|
| 7 | License: BSD
|
|---|
| 8 | Group: Applications/File
|
|---|
| 9 |
|
|---|
| 10 | Vendor: bww bitwise works GmbH
|
|---|
| 11 | %scm_source svn http://svn.netlabs.org/repos/ports/file/trunk 2171
|
|---|
| 12 |
|
|---|
| 13 | # DEF files to create forwarders for the legacy package
|
|---|
| 14 | Source10: magic.def
|
|---|
| 15 |
|
|---|
| 16 | URL: http://www.darwinsys.com/file/
|
|---|
| 17 | Requires: file-libs = %{version}-%{release}
|
|---|
| 18 | BuildRequires: zlib-devel
|
|---|
| 19 | BuildRequires: autoconf automake libtool
|
|---|
| 20 |
|
|---|
| 21 | %description
|
|---|
| 22 | The file command is used to identify a particular file according to the
|
|---|
| 23 | type of data contained by the file. File can identify many different
|
|---|
| 24 | file types, including ELF binaries, system libraries, RPM packages, and
|
|---|
| 25 | different graphics formats.
|
|---|
| 26 |
|
|---|
| 27 | %package libs
|
|---|
| 28 | Summary: Libraries for applications using libmagic
|
|---|
| 29 | Group: Applications/File
|
|---|
| 30 | License: BSD
|
|---|
| 31 |
|
|---|
| 32 | %description libs
|
|---|
| 33 |
|
|---|
| 34 | Libraries for applications using libmagic.
|
|---|
| 35 |
|
|---|
| 36 | %package devel
|
|---|
| 37 | Summary: Libraries and header files for file development
|
|---|
| 38 | Group: Applications/File
|
|---|
| 39 | Requires: %{name} = %{version}-%{release}
|
|---|
| 40 |
|
|---|
| 41 | %description devel
|
|---|
| 42 | The file-devel package contains the header files and libmagic library
|
|---|
| 43 | necessary for developing programs using libmagic.
|
|---|
| 44 |
|
|---|
| 45 | %package -n python-magic
|
|---|
| 46 | Summary: Python 2 bindings for the libmagic API
|
|---|
| 47 | Group: Development/Libraries
|
|---|
| 48 | BuildRequires: python2-devel
|
|---|
| 49 | BuildArch: noarch
|
|---|
| 50 | Requires: %{name} = %{version}-%{release}
|
|---|
| 51 |
|
|---|
| 52 | %description -n python-magic
|
|---|
| 53 | This package contains the Python bindings to allow access to the
|
|---|
| 54 | libmagic API. The libmagic library is also used by the familiar
|
|---|
| 55 | file(1) command.
|
|---|
| 56 |
|
|---|
| 57 | %if %{with_python3}
|
|---|
| 58 | %package -n python3-magic
|
|---|
| 59 | Summary: Python 3 bindings for the libmagic API
|
|---|
| 60 | Group: Development/Libraries
|
|---|
| 61 | BuildRequires: python3-devel
|
|---|
| 62 | BuildArch: noarch
|
|---|
| 63 | Requires: %{name} = %{version}-%{release}
|
|---|
| 64 |
|
|---|
| 65 | %description -n python3-magic
|
|---|
| 66 | This package contains the Python 3 bindings to allow access to the
|
|---|
| 67 | libmagic API. The libmagic library is also used by the familiar
|
|---|
| 68 | file(1) command.
|
|---|
| 69 | %endif
|
|---|
| 70 |
|
|---|
| 71 | %debug_package
|
|---|
| 72 |
|
|---|
| 73 | %prep
|
|---|
| 74 | %scm_setup
|
|---|
| 75 | autoreconf -fvi
|
|---|
| 76 |
|
|---|
| 77 | # Prepare forwarder DLLs.
|
|---|
| 78 | for m in %{SOURCE10}; do
|
|---|
| 79 | cp ${m} .
|
|---|
| 80 | done
|
|---|
| 81 |
|
|---|
| 82 | #iconv -f iso-8859-1 -t utf-8 < doc/libmagic.man > doc/libmagic.man_
|
|---|
| 83 | touch -r doc/libmagic.man doc/libmagic.man_
|
|---|
| 84 | mv doc/libmagic.man_ doc/libmagic.man
|
|---|
| 85 |
|
|---|
| 86 | %if %{with_python3}
|
|---|
| 87 | rm -rf %{py3dir}
|
|---|
| 88 | cp -a python %{py3dir}
|
|---|
| 89 | %endif
|
|---|
| 90 |
|
|---|
| 91 | %build
|
|---|
| 92 | export LDFLAGS="-Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
|
|---|
| 93 | export LIBS="-lcx"
|
|---|
| 94 | export CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
|
|---|
| 95 | export VENDOR="%{vendor}"
|
|---|
| 96 | %configure --enable-fsect-man5 --disable-rpath
|
|---|
| 97 |
|
|---|
| 98 | export BEGINLIBPATH=%{_builddir}/%{name}-%{version}/src/.libs
|
|---|
| 99 | make %{?_smp_mflags}
|
|---|
| 100 |
|
|---|
| 101 | cd python
|
|---|
| 102 | CFLAGS="%{optflags}" %{__python} setup.py build
|
|---|
| 103 | %if %{with_python3}
|
|---|
| 104 | cd %{py3dir}
|
|---|
| 105 | CFLAGS="%{optflags}" %{__python3} setup.py build
|
|---|
| 106 | %endif
|
|---|
| 107 |
|
|---|
| 108 | %install
|
|---|
| 109 | mkdir -p ${RPM_BUILD_ROOT}%{_bindir}
|
|---|
| 110 | mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man1
|
|---|
| 111 | mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man5
|
|---|
| 112 | mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/misc
|
|---|
| 113 | mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/file
|
|---|
| 114 |
|
|---|
| 115 | make DESTDIR=${RPM_BUILD_ROOT} install
|
|---|
| 116 | rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.la
|
|---|
| 117 |
|
|---|
| 118 | cat magic/Magdir/* > ${RPM_BUILD_ROOT}%{_datadir}/misc/magic
|
|---|
| 119 | ln -s misc/magic ${RPM_BUILD_ROOT}%{_datadir}/magic
|
|---|
| 120 | ln -s ../magic ${RPM_BUILD_ROOT}%{_datadir}/file/magic
|
|---|
| 121 |
|
|---|
| 122 | # Generate & install forwarder DLLs.
|
|---|
| 123 | gcc -Zomf -Zdll -nostdlib magic.def -l$RPM_BUILD_ROOT/%{_libdir}/magic1.dll -lend -o $RPM_BUILD_ROOT/%{_libdir}/magic.dll
|
|---|
| 124 |
|
|---|
| 125 | cd python
|
|---|
| 126 | %{__python} setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT}
|
|---|
| 127 | %if %{with_python3}
|
|---|
| 128 | cd %{py3dir}
|
|---|
| 129 | %{__python3} setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT}
|
|---|
| 130 | %endif
|
|---|
| 131 | %{__install} -d ${RPM_BUILD_ROOT}%{_datadir}/%{name}
|
|---|
| 132 |
|
|---|
| 133 | #post libs -p /sbin/ldconfig
|
|---|
| 134 |
|
|---|
| 135 | #postun libs -p /sbin/ldconfig
|
|---|
| 136 |
|
|---|
| 137 | %files
|
|---|
| 138 | %{!?_licensedir:%global license %%doc}
|
|---|
| 139 | %license COPYING
|
|---|
| 140 | %doc ChangeLog README
|
|---|
| 141 | %{_bindir}/*.exe
|
|---|
| 142 | %{_mandir}/man1/*
|
|---|
| 143 |
|
|---|
| 144 | %files libs
|
|---|
| 145 | %{!?_licensedir:%global license %%doc}
|
|---|
| 146 | %license COPYING
|
|---|
| 147 | %doc ChangeLog README
|
|---|
| 148 | %{_libdir}/*.dll
|
|---|
| 149 | %{_datadir}/magic*
|
|---|
| 150 | %{_mandir}/man5/*
|
|---|
| 151 | %{_datadir}/file
|
|---|
| 152 | %{_datadir}/misc/*
|
|---|
| 153 |
|
|---|
| 154 | %files devel
|
|---|
| 155 | %{_libdir}/magic*_dll.a
|
|---|
| 156 | %{_includedir}/magic.h
|
|---|
| 157 | %{_mandir}/man3/*
|
|---|
| 158 |
|
|---|
| 159 |
|
|---|
| 160 | %files -n python-magic
|
|---|
| 161 | %{!?_licensedir:%global license %%doc}
|
|---|
| 162 | %license COPYING
|
|---|
| 163 | %doc python/README python/example.py
|
|---|
| 164 | %{_libdir}/python*/*
|
|---|
| 165 | %{python_sitelib}/magic.py
|
|---|
| 166 | %{python_sitelib}/magic.pyc
|
|---|
| 167 | %{python_sitelib}/magic.pyo
|
|---|
| 168 | %{python_sitelib}/*egg-info
|
|---|
| 169 |
|
|---|
| 170 | %if %{with_python3}
|
|---|
| 171 | %files -n python3-magic
|
|---|
| 172 | %{!?_licensedir:%global license %%doc}
|
|---|
| 173 | %license COPYING
|
|---|
| 174 | %doc python/README python/example.py
|
|---|
| 175 | %{python3_sitelib}/magic.py
|
|---|
| 176 | %{python3_sitelib}/*egg-info
|
|---|
| 177 | %{python3_sitelib}/__pycache__/*
|
|---|
| 178 | %endif
|
|---|
| 179 |
|
|---|
| 180 | %changelog
|
|---|
| 181 | * Wed Apr 05 2017 Silvan Scherrer <silvan.scherrer@aroa.ch> 5.30-2
|
|---|
| 182 | - fix a regex issue (this will be rolled back, when libc issue 375 or libcx
|
|---|
| 183 | issue 35 is done)
|
|---|
| 184 | - added buildlevel information
|
|---|
| 185 |
|
|---|
| 186 | * Mon Mar 06 2017 Silvan Scherrer <silvan.scherrer@aroa.ch> 5.30-1
|
|---|
| 187 | - updated to vendor version 5.30
|
|---|
| 188 | - use scm_ macros
|
|---|
| 189 | - add forwarder
|
|---|
| 190 |
|
|---|
| 191 | * Mon Feb 02 2015 yd <yd@os2power.com> 5.04-7
|
|---|
| 192 | - r266, rebuilt with gcc 4.9.2 and python 2.7.
|
|---|