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

Last change on this file since 123 was 117, checked in by Yuri Dario, 15 years ago

spec: added dist tag to release build number.

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