Changeset 1061


Ignore:
Timestamp:
Mar 17, 2017, 5:05:57 PM (8 years ago)
Author:
Silvan Scherrer
Message:

spec: file: Release version 5.30-1"

Location:
spec/trunk/SPECS
Files:
2 added
1 edited

Legend:

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

    r519 r1061  
    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 :
     1%global with_python3 0
    82
    93Summary: A utility for determining file types
    104Name: file
    11 Version: 5.04
    12 Release: 7%{?dist}
     5Version: 5.30
     6Release: 1%{?dist}
    137License: BSD
    148Group: Applications/File
     9
     10Vendor:  bww bitwise works GmbH
     11%scm_source svn  http://svn.netlabs.org/repos/ports/file/trunk 2149
     12
     13# DEF files to create forwarders for the legacy package
     14Source10:       magic.def
     15
    1516URL: http://www.darwinsys.com/file/
    16 
    17 Source: %{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip
    18 
    1917Requires: file-libs = %{version}-%{release}
    20 Requires: mmap >= 20110103
    21 
    22 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
    2318BuildRequires: zlib-devel
     19BuildRequires: autoconf automake libtool
    2420
    2521%description
     
    3228Summary: Libraries for applications using libmagic
    3329Group:   Applications/File
     30License: BSD
    3431
    3532%description libs
     
    4643necessary for developing programs using libmagic.
    4744
    48 %package static
    49 Summary: Static library for file development
    50 Group:    Applications/File
    51 Requires: %{name} = %{version}-%{release}
    52 
    53 %description static
    54 The file-static package contains the static version of
    55 the libmagic library.
    56 
    5745%package -n python-magic
    58 Summary: Python bindings for the libmagic API
     46Summary: Python 2 bindings for the libmagic API
    5947Group:   Development/Libraries
    60 BuildRequires: python-devel
     48BuildRequires: python2-devel
     49BuildArch: noarch
    6150Requires: %{name} = %{version}-%{release}
    6251
     
    6655file(1) command.
    6756
    68 %package debug
    69 Summary: HLL debug data for exception handling support.
     57%if %{with_python3}
     58%package -n python3-magic
     59Summary: Python 3 bindings for the libmagic API
     60Group:   Development/Libraries
     61BuildRequires: python3-devel
     62BuildArch: noarch
     63Requires: %{name} = %{version}-%{release}
    7064
    71 %description debug
    72 HLL debug data for exception handling support.
     65%description -n python3-magic
     66This package contains the Python 3 bindings to allow access to the
     67libmagic API. The libmagic library is also used by the familiar
     68file(1) command.
     69%endif
     70
     71%debug_package
    7372
    7473%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
    79 svn export %{?svn_rev:-r %{svn_rev}} %{svn_url} . --force
    80 rm -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
     74%scm_setup
     75autoreconf -fvi
     76
     77# Prepare forwarder DLLs.
     78for m in %{SOURCE10}; do
     79  cp ${m} .
     80done
    8381
    8482#iconv -f iso-8859-1 -t utf-8 < doc/libmagic.man > doc/libmagic.man_
     
    8684mv doc/libmagic.man_ doc/libmagic.man
    8785
     86%if %{with_python3}
     87rm -rf %{py3dir}
     88cp -a python %{py3dir}
     89%endif
     90
    8891%build
    89 export CONFIG_SITE="/@unixroot/usr/share/config.legacy"
    90 export LDFLAGS="-Zbin-files -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
    91 export LIBS="-lurpo -lmmap"
     92export LDFLAGS="-Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
     93export LIBS="-lcx"
    9294export 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
     95export VENDOR="%{vendor}"
     96%configure --enable-fsect-man5 --disable-rpath
    9697
     98export BEGINLIBPATH=%{_builddir}/%{name}-%{version}/src/.libs
    9799make %{?_smp_mflags}
    98100
    99101cd python
    100102CFLAGS="%{optflags}" %{__python} setup.py build
     103%if %{with_python3}
     104cd %{py3dir}
     105CFLAGS="%{optflags}" %{__python3} setup.py build
     106%endif
    101107
    102108%install
    103 rm -rf $RPM_BUILD_ROOT
    104109mkdir -p ${RPM_BUILD_ROOT}%{_bindir}
    105110mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man1
     
    113118cat magic/Magdir/* > ${RPM_BUILD_ROOT}%{_datadir}/misc/magic
    114119ln -s misc/magic ${RPM_BUILD_ROOT}%{_datadir}/magic
    115 #ln -s file/magic.mime ${RPM_BUILD_ROOT}%{_datadir}/magic.mime
    116120ln -s ../magic ${RPM_BUILD_ROOT}%{_datadir}/file/magic
    117121
    118 cp src/magic.dll ${RPM_BUILD_ROOT}%{_libdir}
    119 cp src/.libs/magic_s.a ${RPM_BUILD_ROOT}%{_libdir}
     122# Generate & install forwarder DLLs.
     123gcc -Zomf -Zdll -nostdlib magic.def -l$RPM_BUILD_ROOT/%{_libdir}/magic1.dll -lend -o $RPM_BUILD_ROOT/%{_libdir}/magic.dll
    120124
    121125cd python
    122126%{__python} setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT}
     127%if %{with_python3}
     128cd %{py3dir}
     129%{__python3} setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT}
     130%endif
    123131%{__install} -d ${RPM_BUILD_ROOT}%{_datadir}/%{name}
    124132
    125 %clean
    126 rm -rf $RPM_BUILD_ROOT
     133#post libs -p /sbin/ldconfig
     134
     135#postun libs -p /sbin/ldconfig
    127136
    128137%files
    129 %defattr(-,root,root,-)
    130 %doc COPYING ChangeLog README
    131 %{_bindir}/*
     138%{!?_licensedir:%global license %%doc}
     139%license COPYING
     140%doc ChangeLog README
     141%{_bindir}/*.exe
    132142%{_mandir}/man1/*
    133143
    134144%files libs
    135 %defattr(-,root,root,-)
     145%{!?_licensedir:%global license %%doc}
     146%license COPYING
     147%doc ChangeLog README
    136148%{_libdir}/*.dll
    137149%{_datadir}/magic*
     
    141153
    142154%files devel
    143 %defattr(-,root,root,-)
    144 %{_libdir}/*.dll
    145 %{_libdir}/magic.a
     155%{_libdir}/magic*_dll.a
    146156%{_includedir}/magic.h
    147157%{_mandir}/man3/*
    148158
    149 %files static
    150 %defattr(-,root,root,-)
    151 %{_libdir}/*_s.a
    152159
    153160%files -n python-magic
    154 %defattr(-, root, root, -)
    155 %doc python/README COPYING python/example.py
     161%{!?_licensedir:%global license %%doc}
     162%license COPYING
     163%doc python/README python/example.py
    156164%{_libdir}/python*/*
     165%{python_sitelib}/magic.py
     166%{python_sitelib}/magic.pyc
     167%{python_sitelib}/magic.pyo
     168%{python_sitelib}/*egg-info
    157169
    158 %files debug
    159 %defattr(-,root,root)
    160 %{_libdir}/*.dbg
     170%if %{with_python3}
     171%files -n python3-magic
     172%{!?_licensedir:%global license %%doc}
     173%license COPYING
     174%doc python/README python/example.py
     175%{python3_sitelib}/magic.py
     176%{python3_sitelib}/*egg-info
     177%{python3_sitelib}/__pycache__/*
     178%endif
    161179
    162180%changelog
     181* Mon Mar 06 2017 Silvan Scherrer <silvan.scherrer@aroa.ch> 5.30-1
     182- updated to vendor version 5.30
     183- use scm_ macros
     184- add forwarder
     185
    163186* Mon Feb 02 2015 yd <yd@os2power.com> 5.04-7
    164187- r266, rebuilt with gcc 4.9.2 and python 2.7.
Note: See TracChangeset for help on using the changeset viewer.