File xmedcon.spec of Package xmedcon

#
# spec file for package xmedcon
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

Name:           xmedcon
Version:        0.24.0
Release:        0
Summary:        Xmedcom - a medical image conversion utility and library
Group:          Productivity/Graphics/Convertors
# i think i have all of them http://xmedcon.sourceforge.net/pub/readme/README
# but should be rechecked!
License:        BSD-3-Clause and LGPL-2.1+ and GPL-2.0+
Url:            https://xmedcon.sourceforge.io/
Requires(pre):  /sbin/ldconfig
BuildRequires:  giflib-devel
BuildRequires:  libtool
BuildRequires:  pkgconfig(gdk-pixbuf-2.0)
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:  pkgconfig(libpng16)
BuildRequires:  pkgconfig(zlib)
BuildRequires:  update-desktop-files
Source:         https://prdownloads.sourceforge.net/xmedcon/%{name}-%{version}.tar.bz2
Source1:        xmedcon.desktop
Patch0:         xmedcon-0.16.2.dif
# PATCH-FIX-UPSTREAM xmedcon-fix-implicit-fortify-declaration.patch --fix implicit-fortify-declaration
#  rpmlint warning
Patch1:         xmedcon-fix-implicit-fortify-declaration.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This project stands for Medical Image Conversion and is released under the
GNU's (L)GPL license. It bundles the C sourcecode, a library, a flexible
command-line utility and a graphical front-end based on the amazing Gtk+
toolkit.

Its main purpose is image conversion while preserving valuable medical
study information. The currently supported formats are: Acr/Nema 2.0,
Analyze (SPM), Concorde/uPET, DICOM 3.0, CTI ECAT 6/7, InterFile 3.3
and PNG or Gif87a/89a towards desktop applications.

%package devel
Summary:        Static libraries and header files for (X)MedCon development
Group:          Development/Libraries/C and C++
Requires:       xmedcon = %{version}

%description devel
The xmedcon-devel package contains the header files and static libraries
necessary for developing programs that make use of the (X)MedCon library
(libmdc).

%prep
%setup -q
%patch -P0 -b .p0
%patch -P1 -b .p1

%build
# autoreconf
AUTOPOINT=true autoreconf -fi
libtoolize
%configure  --disable-static	\
	--enable-shared		\
	--enable-acr		\
	--enable-gif		\
	--enable-inw		\
	--enable-anlz		\
	--enable-conc		\
	--enable-ecat		\
	--enable-intf		\
	--enable-dicom		\
	--enable-png		\
	--enable-nifti		\
	--enable-ljpg		\
	--enable-tpc		\
	--enable-glib		\
	--enable-gui		\
	--enable-llcheck	\
	--sysconfdir=%{_sysconfdir}	    \
	--includedir=%{_includedir}/xmedcon \

sed -ri -e 's@(hardcode_libdir_flag_spec=).*@\1""@g' \
	-e 's@(runpath_var=)LD_RUN_PATH@\1PLACEBO@g' libtool
make %{?_smp_mflags}

%install
%makeinstall
rm -f %{buildroot}%{_libdir}/libmdc.la
rm -f %{buildroot}%{_libdir}/libmdc.a

install -d %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/
install -m 0644 -p etc/%{name}.png -t %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/
%suse_update_desktop_file -i %{name} Graphics RasterGraphics
mv -v %{buildroot}%{_includedir}/*.h %{buildroot}%{_includedir}//%{name}/

%clean
exit 0

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,0755)
%license COPYING COPYING.LIB
%doc ChangeLog README REMARKS AUTHORS
%config %{_sysconfdir}/xmedcon.css
%{_bindir}/*medcon
%{_libdir}/*so.*
%{_mandir}/man1/*medcon.*
%dir %{_datadir}/appdata
%{_datadir}/appdata/%{name}.appdata.xml
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/48x48/apps/%{name}.png

%files devel
%defattr(-,root,root,0755)
%{_bindir}/xmedcon-config
%{_mandir}/man1/xmedcon-config.*
%{_mandir}/man3/*
%{_mandir}/man4/*
%{_includedir}/*
%{_libdir}/*.so
%{_datadir}/aclocal/*

%changelog
openSUSE Build Service is sponsored by