source: spec/trunk/SPECS/file.spec@ 1330

Last change on this file since 1330 was 1076, checked in by Silvan Scherrer, 8 years ago

spec: file: Release version 5.30-2.

  • Property svn:eol-style set to native
File size: 4.9 KB
Line 
1%global with_python3 0
2
3Summary: A utility for determining file types
4Name: file
5Version: 5.30
6Release: 2%{?dist}
7License: BSD
8Group: Applications/File
9
10Vendor: 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
14Source10: magic.def
15
16URL: http://www.darwinsys.com/file/
17Requires: file-libs = %{version}-%{release}
18BuildRequires: zlib-devel
19BuildRequires: autoconf automake libtool
20
21%description
22The file command is used to identify a particular file according to the
23type of data contained by the file. File can identify many different
24file types, including ELF binaries, system libraries, RPM packages, and
25different graphics formats.
26
27%package libs
28Summary: Libraries for applications using libmagic
29Group: Applications/File
30License: BSD
31
32%description libs
33
34Libraries for applications using libmagic.
35
36%package devel
37Summary: Libraries and header files for file development
38Group: Applications/File
39Requires: %{name} = %{version}-%{release}
40
41%description devel
42The file-devel package contains the header files and libmagic library
43necessary for developing programs using libmagic.
44
45%package -n python-magic
46Summary: Python 2 bindings for the libmagic API
47Group: Development/Libraries
48BuildRequires: python2-devel
49BuildArch: noarch
50Requires: %{name} = %{version}-%{release}
51
52%description -n python-magic
53This package contains the Python bindings to allow access to the
54libmagic API. The libmagic library is also used by the familiar
55file(1) command.
56
57%if %{with_python3}
58%package -n python3-magic
59Summary: Python 3 bindings for the libmagic API
60Group: Development/Libraries
61BuildRequires: python3-devel
62BuildArch: noarch
63Requires: %{name} = %{version}-%{release}
64
65%description -n python3-magic
66This package contains the Python 3 bindings to allow access to the
67libmagic API. The libmagic library is also used by the familiar
68file(1) command.
69%endif
70
71%debug_package
72
73%prep
74%scm_setup
75autoreconf -fvi
76
77# Prepare forwarder DLLs.
78for m in %{SOURCE10}; do
79 cp ${m} .
80done
81
82#iconv -f iso-8859-1 -t utf-8 < doc/libmagic.man > doc/libmagic.man_
83touch -r doc/libmagic.man doc/libmagic.man_
84mv doc/libmagic.man_ doc/libmagic.man
85
86%if %{with_python3}
87rm -rf %{py3dir}
88cp -a python %{py3dir}
89%endif
90
91%build
92export LDFLAGS="-Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
93export LIBS="-lcx"
94export CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
95export VENDOR="%{vendor}"
96%configure --enable-fsect-man5 --disable-rpath
97
98export BEGINLIBPATH=%{_builddir}/%{name}-%{version}/src/.libs
99make %{?_smp_mflags}
100
101cd python
102CFLAGS="%{optflags}" %{__python} setup.py build
103%if %{with_python3}
104cd %{py3dir}
105CFLAGS="%{optflags}" %{__python3} setup.py build
106%endif
107
108%install
109mkdir -p ${RPM_BUILD_ROOT}%{_bindir}
110mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man1
111mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man5
112mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/misc
113mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/file
114
115make DESTDIR=${RPM_BUILD_ROOT} install
116rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.la
117
118cat magic/Magdir/* > ${RPM_BUILD_ROOT}%{_datadir}/misc/magic
119ln -s misc/magic ${RPM_BUILD_ROOT}%{_datadir}/magic
120ln -s ../magic ${RPM_BUILD_ROOT}%{_datadir}/file/magic
121
122# Generate & install forwarder DLLs.
123gcc -Zomf -Zdll -nostdlib magic.def -l$RPM_BUILD_ROOT/%{_libdir}/magic1.dll -lend -o $RPM_BUILD_ROOT/%{_libdir}/magic.dll
124
125cd python
126%{__python} setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT}
127%if %{with_python3}
128cd %{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.
Note: See TracBrowser for help on using the repository browser.