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

Last change on this file since 360 was 168, checked in by Yuri Dario, 14 years ago

spec: massive rebuild due to new rpm lx parser updates (see changeset:167).

  • Property svn:eol-style set to native
File size: 4.3 KB
Line 
1%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
2%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
3%define __libtoolize :
4
5Summary: A utility for determining file types
6Name: file
7Version: 5.04
8Release: 6%{?dist}
9License: BSD
10Group: Applications/File
11Source0: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz
12URL: http://www.darwinsys.com/file/
13
14Patch0: file-os2.diff
15
16Requires: file-libs = %{version}-%{release}
17Requires: mmap >= 20110103
18
19BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
20BuildRequires: zlib-devel
21
22%description
23The file command is used to identify a particular file according to the
24type of data contained by the file. File can identify many different
25file types, including ELF binaries, system libraries, RPM packages, and
26different graphics formats.
27
28%package libs
29Summary: Libraries for applications using libmagic
30Group: Applications/File
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 static
46Summary: Static library for file development
47Group: Applications/File
48Requires: %{name} = %{version}-%{release}
49
50%description static
51The file-static package contains the static version of
52the libmagic library.
53
54%package -n python-magic
55Summary: Python bindings for the libmagic API
56Group: Development/Libraries
57BuildRequires: python-devel
58Requires: %{name} = %{version}-%{release}
59
60%description -n python-magic
61This package contains the Python bindings to allow access to the
62libmagic API. The libmagic library is also used by the familiar
63file(1) command.
64
65%prep
66
67# Don't use -b -- it will lead to poblems when compiling magic file
68%setup -q
69%patch0 -p1
70
71#iconv -f iso-8859-1 -t utf-8 < doc/libmagic.man > doc/libmagic.man_
72touch -r doc/libmagic.man doc/libmagic.man_
73mv doc/libmagic.man_ doc/libmagic.man
74
75%build
76export CONFIG_SHELL="/bin/sh"
77export LDFLAGS="-Zbin-files -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
78export LIBS="-lurpo -lmmap"
79export CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
80%configure \
81 --enable-fsect-man5 --disable-rpath \
82 --disable-shared --disable-static \
83 "--cache-file=%{_topdir}/cache/%{name}-%{_target_cpu}.cache"
84
85# remove hardcoded library paths from local libtool
86#sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
87#sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
88#export LD_LIBRARY_PATH=%{_builddir}/%{name}-%{version}/src/.libs
89make %{?_smp_mflags}
90
91cd python
92CFLAGS="%{optflags}" %{__python} setup.py build
93
94%install
95rm -rf $RPM_BUILD_ROOT
96mkdir -p ${RPM_BUILD_ROOT}%{_bindir}
97mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man1
98mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man5
99mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/misc
100mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/file
101
102make DESTDIR=${RPM_BUILD_ROOT} install
103rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.la
104
105cat magic/Magdir/* > ${RPM_BUILD_ROOT}%{_datadir}/misc/magic
106ln -s misc/magic ${RPM_BUILD_ROOT}%{_datadir}/magic
107#ln -s file/magic.mime ${RPM_BUILD_ROOT}%{_datadir}/magic.mime
108ln -s ../magic ${RPM_BUILD_ROOT}%{_datadir}/file/magic
109
110cp src/magic.dll ${RPM_BUILD_ROOT}%{_libdir}
111cp src/.libs/magic_s.a ${RPM_BUILD_ROOT}%{_libdir}
112
113cd python
114%{__python} setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT}
115%{__install} -d ${RPM_BUILD_ROOT}%{_datadir}/%{name}
116
117%clean
118rm -rf $RPM_BUILD_ROOT
119
120#%post libs -p /sbin/ldconfig
121
122#%postun libs -p /sbin/ldconfig
123
124%files
125%defattr(-,root,root,-)
126%doc COPYING ChangeLog README
127%{_bindir}/*
128%{_mandir}/man1/*
129
130%files libs
131%defattr(-,root,root,-)
132%{_libdir}/*.dll
133%{_datadir}/magic*
134%{_mandir}/man5/*
135%{_datadir}/file
136%{_datadir}/misc/*
137
138%files devel
139%defattr(-,root,root,-)
140%{_libdir}/*.dll
141%{_libdir}/magic.a
142%{_includedir}/magic.h
143%{_mandir}/man3/*
144
145%files static
146%defattr(-,root,root,-)
147%{_libdir}/*_s.a
148
149%files -n python-magic
150%defattr(-, root, root, -)
151%doc python/README COPYING python/example.py
152%{_libdir}/python*/*
153
154%changelog
Note: See TracBrowser for help on using the repository browser.