don't package static libraries (#430330) use %bcond_... macros for package

options
This commit is contained in:
Nils Philippsen 2008-01-28 11:18:40 +00:00
parent 742e451e69
commit 8d6a2a3e81

100
gimp.spec
View File

@ -2,7 +2,7 @@
# Use the following --with/--without <option> switches to control how the
# package will be built:
#
# modular_x: modular X deps
# modular_x: modular X dependencies
# lcms: lcms support
# python: python support
# mp: multi processor support
@ -13,31 +13,31 @@
# convenience: install convenience symlinks
%if 0%{?fedora}%{?rhel} == 0 || 0%{?fedora} >= 5 || 0%{?rhel} >= 5
%define _enable_modularX 0%{!?_without_modular_x:1}
%define _enable_lcms 0%{!?_without_lcms:1}
%bcond_without modular_x
%bcond_without lcms
%else
%define _enable_modularX 0%{?_with_modular_x:1}
%define _enable_lcms 0%{?_with_lcms:1}
%bcond_with modular_x
%bcond_with lcms
%endif
%if 0%{?fedora}%{?rhel} == 0 || 0%{?fedora} >= 7 || 0%{?rhel} >= 6
%define _enable_gutenprint 0%{!?_without_gutenprint:1}
%define _enable_xdg_open 0%{!?_without_xdg_open:1}
%bcond_without gutenprint
%bcond_without xdg_open
%else
%define _enable_gutenprint 0%{?_with_gutenprint:1}
%define _enable_xdg_open 0%{?_with_xdg_open:1}
%bcond_with gutenprint
%bcond_with xdg_open
%endif
%if 0%{?fedora}%{?rhel} == 0 || 0%{?fedora} >= 8 || 0%{?rhel} >= 6
%define _enable_print 0%{!?_without_print:1}
%bcond_without print
%else
%define _enable_print 0%{?_with_print:1}
%bcond_with print
%endif
%define _enable_python 0%{!?_without_python:1}
%define _enable_mp 0%{!?_without_mp:1}
%define _enable_static 0%{!?_without_static:1}
%define _enable_convenience %{!?_without_convenience:1}
%bcond_without python
%bcond_without mp
%bcond_without convenience
%bcond_with static
#
#
@ -51,7 +51,7 @@ Version: 2.4.3
%define age 0
%define minorver 400
%define microver %(ver=%{version}; echo ${ver##*.*.})
Release: 1%{?dist}
Release: 2%{?dist}
Epoch: 2
License: GPLv2+
Group: Applications/Multimedia
@ -84,7 +84,7 @@ BuildRequires: poppler-devel >= 0.4.1
BuildRequires: python-devel
BuildRequires: pygtk2-devel >= 2.10.4
BuildRequires: pygobject2-devel
%if %_enable_modularX
%if %{with modular_x}
BuildRequires: libX11-devel
BuildRequires: libXmu-devel
%else
@ -94,7 +94,7 @@ BuildRequires: sed
BuildRequires: intltool
BuildRequires: gettext
BuildRequires: findutils
%if %_enable_lcms
%if %{with lcms}
BuildRequires: lcms-devel
%endif
Requires: desktop-file-utils >= 0.9
@ -103,8 +103,8 @@ Requires: gtk2 >= 2.10.13
Requires: pango >= 1.12.2
Requires: freetype >= 2.1.7
Requires: fontconfig >= 2.2.0
%if ! %_enable_print
%if %_enable_gutenprint
%if ! %{with print}
%if %{with gutenprint}
Requires: gutenprint-plugin
%else
Requires: gimp-print-plugin
@ -113,7 +113,7 @@ Requires: gimp-print-plugin
Requires(post): /usr/bin/update-desktop-database
Requires(postun): /usr/bin/update-desktop-database
Requires: hicolor-icon-theme
%if %_enable_xdg_open
%if %{with xdg_open}
Requires: xdg-utils
%else
Requires: htmlview
@ -161,25 +161,25 @@ extensions.
cat << EOF
Build options:
modular X: %_enable_modularX
LCMS support: %_enable_lcms
Python support: %_enable_python
MP support: %_enable_mp
build static libs: %_enable_static
build internal print plugin: %_enable_print
include convenience symlinks: %_enable_convenience
build the print plugin: %_enable_print
%if ! %_enable_print
modular X: %{with modular_x}
LCMS support: %{with lcms}
Python support: %{with python}
MP support: %{with mp}
build static libs: %{with static}
build internal print plugin: %{with print}
include convenience symlinks: %{with convenience}
build the print plugin: %{with print}
%if ! %{with print}
prefer gutenprint over (external) gimp-print plugin:
%_enable_gutenprint
%{with gutenprint}
%endif
use xdg-open instead of htmlview: %_enable_xdg_open
use xdg-open instead of htmlview: %{with xdg_open}
EOF
%setup -q -n gimp-%{version}
%if %_enable_xdg_open
%if %{with xdg_open}
%patch1 -p1 -b .xdg-open
%else
%patch0 -p1 -b .htmlview
@ -193,27 +193,27 @@ fi
CFLAGS="%optflags -fomit-frame-pointer" \
%configure \
--disable-perl \
%if %_enable_python
%if %{with python}
--enable-python \
%else
--disable-python \
%endif
%if %_enable_mp
%if %{with mp}
--enable-mp \
%else
--disable-mp \
%endif
%if %_enable_static
%if %{with static}
--enable-static \
%else
--disable-static \
%endif
%if %_enable_print
%if %{with print}
--with-print \
%else
--without-print \
%endif
%if %_enable_lcms
%if %{with lcms}
--with-lcms \
%else
--without-lcms \
@ -247,7 +247,8 @@ find %buildroot -name \*.la -exec %__rm -f {} \;
# Plugins and modules change often (grab the executeable ones)
#
echo "%defattr (-, root, root)" > gimp-plugin-files
find %{buildroot}%{_libdir}/gimp/%{interfacever} -type f | sed "s@^%{buildroot}@@g" | egrep -v 'modules/.*\.a$|modules/.*\.la$' >>gimp-plugin-files
find %{buildroot}%{_libdir}/gimp/%{interfacever} -type f | sed "s@^%{buildroot}@@g" | grep -v '\.a$' >> gimp-plugin-files
# .pyc and .pyo files don't exist yet
grep "\.py$" gimp-plugin-files > gimp-plugin-files-py
for file in $(cat gimp-plugin-files-py); do
@ -256,6 +257,11 @@ for file in $(cat gimp-plugin-files-py); do
done
done >> gimp-plugin-files
%if %{with static}
echo "%defattr (-, root, root)" > gimp-static-files
find %{buildroot}%{_libdir}/gimp/%{interfacever} -type f | sed "s@^%{buildroot}@@g" | grep '\.a$' >> gimp-static-files
%endif
#
# Auto detect the lang files.
#
@ -273,7 +279,7 @@ cat gimp%{gimp_lang_ver}.lang gimp%{gimp_lang_ver}-std-plug-ins.lang gimp%{gimp_
#
cat gimp-plugin-files gimp-all.lang > gimp.files
%if %_enable_convenience
%if %{with convenience}
# install convenience symlinks
ln -snf gimp-%{binver} %{buildroot}%{_bindir}/gimp
ln -snf gimp-%{binver}.1 %{buildroot}%{_mandir}/man1/gimp.1
@ -380,7 +386,7 @@ fi
%{_bindir}/gimp-console-%{binver}
%{_sbindir}/gimp-plugin-mgr
%if %_enable_convenience
%if %{with convenience}
%{_bindir}/gimp
%{_bindir}/gimp-remote
%{_bindir}/gimptool
@ -393,7 +399,7 @@ fi
%{_mandir}/man1/gimp-console-%{binver}.1*
%{_mandir}/man5/gimprc-%{binver}.5*
%if %_enable_convenience
%if %{with convenience}
%{_mandir}/man1/gimp.1*
%{_mandir}/man1/gimp-remote.1*
%{_mandir}/man1/gimptool.1*
@ -425,17 +431,19 @@ fi
%{_libdir}/libgimpwidgets-%{interfacever}.so.%{age}.%{minorver}.%{microver}
%{_libdir}/libgimpwidgets-%{interfacever}.so.%{age}
%if %{with static}
%files devel -f gimp-static-files
%else
%files devel
%endif
%defattr (-, root, root, 0755)
%doc HACKING README.i18n
%doc %{_datadir}/gtk-doc/*
%{_libdir}/*.so
%{_libdir}/*.a
%dir %{_libdir}/gimp
%dir %{_libdir}/gimp/%{interfacever}
%dir %{_libdir}/gimp/%{interfacever}/modules
%{_libdir}/gimp/%{interfacever}/modules/*.a
%ifnos linux
%{_libdir}/*.la
%{_libdir}/gimp/%{interfacever}/modules/*.la
@ -445,6 +453,10 @@ fi
%{_libdir}/pkgconfig/*
%changelog
* Mon Jan 28 2008 Nils Philippsen <nphilipp@redhat.com> - 2:2.4.3-2
- don't package static libraries (#430330)
- use %%bcond_... macros for package options
* Mon Dec 17 2007 Nils Philippsen <nphilipp@redhat.com> - 2:2.4.3-1
- version 2.4.3