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

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

spec: initial import for base .spec files.

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