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

Last change on this file since 1010 was 519, checked in by Yuri Dario, 11 years ago

spec: file, r266, rebuilt with gcc 4.9.2 and python 2.7.

  • Property svn:eol-style set to native
File size: 4.6 KB
Line 
1#define svn_url F:/rd/ports/file/trunk
2%define svn_url http://svn.netlabs.org/repos/ports/file/trunk
3%define svn_rev 266
4
5%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
6%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
7%define __libtoolize :
8
9Summary: A utility for determining file types
10Name: file
11Version: 5.04
12Release: 7%{?dist}
13License: BSD
14Group: Applications/File
15URL: http://www.darwinsys.com/file/
16
17Source: %{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip
18
19Requires: file-libs = %{version}-%{release}
20Requires: mmap >= 20110103
21
22BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
23BuildRequires: zlib-devel
24
25%description
26The file command is used to identify a particular file according to the
27type of data contained by the file. File can identify many different
28file types, including ELF binaries, system libraries, RPM packages, and
29different graphics formats.
30
31%package libs
32Summary: Libraries for applications using libmagic
33Group: Applications/File
34
35%description libs
36
37Libraries for applications using libmagic.
38
39%package devel
40Summary: Libraries and header files for file development
41Group: Applications/File
42Requires: %{name} = %{version}-%{release}
43
44%description devel
45The file-devel package contains the header files and libmagic library
46necessary for developing programs using libmagic.
47
48%package static
49Summary: Static library for file development
50Group: Applications/File
51Requires: %{name} = %{version}-%{release}
52
53%description static
54The file-static package contains the static version of
55the libmagic library.
56
57%package -n python-magic
58Summary: Python bindings for the libmagic API
59Group: Development/Libraries
60BuildRequires: python-devel
61Requires: %{name} = %{version}-%{release}
62
63%description -n python-magic
64This package contains the Python bindings to allow access to the
65libmagic API. The libmagic library is also used by the familiar
66file(1) command.
67
68%package debug
69Summary: HLL debug data for exception handling support.
70
71%description debug
72HLL debug data for exception handling support.
73
74%prep
75%if %{?svn_rev:%(sh -c 'if test -f "%{_sourcedir}/%{name}-%{version}-r%{svn_rev}.zip" ; then echo 1 ; else echo 0 ; fi')}%{!?svn_rev):0}
76%setup -q
77%else
78%setup -n "%{name}-%{version}" -Tc
79svn export %{?svn_rev:-r %{svn_rev}} %{svn_url} . --force
80rm -f "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip"
81(cd .. && zip -SrX9 "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip" "%{name}-%{version}")
82%endif
83
84#iconv -f iso-8859-1 -t utf-8 < doc/libmagic.man > doc/libmagic.man_
85touch -r doc/libmagic.man doc/libmagic.man_
86mv doc/libmagic.man_ doc/libmagic.man
87
88%build
89export CONFIG_SITE="/@unixroot/usr/share/config.legacy"
90export LDFLAGS="-Zbin-files -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
91export LIBS="-lurpo -lmmap"
92export CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
93%configure \
94 --enable-fsect-man5 --disable-rpath \
95 --disable-shared --disable-static
96
97make %{?_smp_mflags}
98
99cd python
100CFLAGS="%{optflags}" %{__python} setup.py build
101
102%install
103rm -rf $RPM_BUILD_ROOT
104mkdir -p ${RPM_BUILD_ROOT}%{_bindir}
105mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man1
106mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man5
107mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/misc
108mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/file
109
110make DESTDIR=${RPM_BUILD_ROOT} install
111rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.la
112
113cat magic/Magdir/* > ${RPM_BUILD_ROOT}%{_datadir}/misc/magic
114ln -s misc/magic ${RPM_BUILD_ROOT}%{_datadir}/magic
115#ln -s file/magic.mime ${RPM_BUILD_ROOT}%{_datadir}/magic.mime
116ln -s ../magic ${RPM_BUILD_ROOT}%{_datadir}/file/magic
117
118cp src/magic.dll ${RPM_BUILD_ROOT}%{_libdir}
119cp src/.libs/magic_s.a ${RPM_BUILD_ROOT}%{_libdir}
120
121cd python
122%{__python} setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT}
123%{__install} -d ${RPM_BUILD_ROOT}%{_datadir}/%{name}
124
125%clean
126rm -rf $RPM_BUILD_ROOT
127
128%files
129%defattr(-,root,root,-)
130%doc COPYING ChangeLog README
131%{_bindir}/*
132%{_mandir}/man1/*
133
134%files libs
135%defattr(-,root,root,-)
136%{_libdir}/*.dll
137%{_datadir}/magic*
138%{_mandir}/man5/*
139%{_datadir}/file
140%{_datadir}/misc/*
141
142%files devel
143%defattr(-,root,root,-)
144%{_libdir}/*.dll
145%{_libdir}/magic.a
146%{_includedir}/magic.h
147%{_mandir}/man3/*
148
149%files static
150%defattr(-,root,root,-)
151%{_libdir}/*_s.a
152
153%files -n python-magic
154%defattr(-, root, root, -)
155%doc python/README COPYING python/example.py
156%{_libdir}/python*/*
157
158%files debug
159%defattr(-,root,root)
160%{_libdir}/*.dbg
161
162%changelog
163* Mon Feb 02 2015 yd <yd@os2power.com> 5.04-7
164- r266, rebuilt with gcc 4.9.2 and python 2.7.
Note: See TracBrowser for help on using the repository browser.