Changeset 111 for spec/trunk/SPECS


Ignore:
Timestamp:
Nov 18, 2010, 5:58:46 PM (15 years ago)
Author:
Yuri Dario
Message:

spec: file build as dll, build python module, enable mmap access.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • spec/trunk/SPECS/file.spec

    r11 r111  
    66Name: file
    77Version: 5.04
    8 Release: 1
     8Release: 2
    99License: BSD
    1010Group: Applications/File
    1111Source0: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz
    1212URL: http://www.darwinsys.com/file/
    13 Patch0: file-5.04-base.patch
     13
     14Patch0: file-os2.diff
    1415
    1516Requires: file-libs = %{version}-%{release}
     
    5253Summary: Python bindings for the libmagic API
    5354Group:   Development/Libraries
    54 #BuildRequires: python-devel
     55BuildRequires: python-devel
    5556Requires: %{name} = %{version}-%{release}
    5657
     
    7172
    7273%build
    73 CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" \
    74 %configure --enable-fsect-man5 --disable-rpath \
     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 \
    7581        "--cache-file=%{_topdir}/cache/%{name}.cache"
    7682
    7783# remove hardcoded library paths from local libtool
    78 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
    79 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
    80 export LD_LIBRARY_PATH=%{_builddir}/%{name}-%{version}/src/.libs
     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
    8187make %{?_smp_mflags}
    82 #cd python
    83 #CFLAGS="%{optflags}" %{__python} setup.py build
     88
     89cd python
     90CFLAGS="%{optflags}" %{__python} setup.py build
    8491
    8592%install
     
    99106ln -s ../magic ${RPM_BUILD_ROOT}%{_datadir}/file/magic
    100107
    101 #cd python
    102 #%{__python} setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT}
    103 #%{__install} -d ${RPM_BUILD_ROOT}%{_datadir}/%{name}
     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}
    104114
    105115%clean
     
    118128%files libs
    119129%defattr(-,root,root,-)
    120 #%{_libdir}/*so.*
     130%{_libdir}/*.dll
    121131%{_datadir}/magic*
    122132%{_mandir}/man5/*
     
    126136%files devel
    127137%defattr(-,root,root,-)
    128 #%{_libdir}/*.so
     138%{_libdir}/*.dll
     139%{_libdir}/magic.a
    129140%{_includedir}/magic.h
    130141%{_mandir}/man3/*
     
    132143%files static
    133144%defattr(-,root,root,-)
    134 %{_libdir}/*.a
     145%{_libdir}/*_s.a
    135146
    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
     147%files -n python-magic
     148%defattr(-, root, root, -)
     149%doc python/README COPYING python/example.py
     150%{_libdir}/python*/*
    143151
    144152%changelog
Note: See TracChangeset for help on using the changeset viewer.