From a54da773c30cb864f10e0d8e660f5b60a933bee6 Mon Sep 17 00:00:00 2001 From: Tim Fenn Date: Feb 04 2012 21:41:55 +0000 Subject: Initial import (#523877). --- diff --git a/.gitignore b/.gitignore index e69de29..4090b48 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/CBFlib-0.9.2.3.tar.gz diff --git a/CBFlib.spec b/CBFlib.spec new file mode 100644 index 0000000..0be6cb4 --- /dev/null +++ b/CBFlib.spec @@ -0,0 +1,167 @@ +Summary: Crystallographic Binary File and Image Library +Name: CBFlib +Version: 0.9.2.3 +Release: 2%{?dist} +# library files (*.so*) are LGPLv2+, all else is GPLv2+ +License: GPLv2+ and (GPLv2+ or LGPLv2+) +Group: System Environment/Libraries +URL: http://www.bernstein-plus-sons.com/software/CBF +Source0: http://downloads.sourceforge.net/cbflib/%{name}-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: gcc-gfortran + +%description +CBFlib (Crystallographic Binary File library) is a library of ANSI-C +functions providing a simple mechanism for accessing Crystallographic +Binary Files (CBF files) and Image-supporting CIF (imgCIF) files. The +CBFlib API is loosely based on the CIFPARSE API for mmCIF files. Like +CIFPARSE, CBFlib does not perform any semantic integrity checks; +rather it simply provides functions to create, read, modify and write +CBF binary data files and imgCIF ASCII data files. + +%package devel +Summary: Header files and library for developing programs with cbf +Requires: %{name}%{?_isa} = %{version}-%{release} +Group: Development/Libraries + +%description devel + +This package contains libraries and header files needed for program +development using the crystallographic binary file and image library. + +%prep +%setup -q -n %{name}-%{version} + +# various cleanups +iconv -f iso8859-15 -t utf-8 doc/cif_img_1.5.3_8Jul07.dic > doc/cif_img_1.5.3_8Jul07.dic.conv && mv -f doc/cif_img_1.5.3_8Jul07.dic.conv doc/cif_img_1.5.3_8Jul07.dic +rm doc/.symlinks +rm doc/.undosymlinks +chmod 644 examples/*.c + +%build +# make %{?_smp_mflags} +cd src +gcc -fPIC -DCBF_DONT_USE_LONG_LONG -D_USE_XOPEN_EXTENDED %{optflags} -c *.c ../examples/img.c -I../include/ -I../examples/ +gcc -shared -Wl,-soname,libcbf.so.0 -o libcbf.so.0.0.0 *.o -lm +rm *.o +gfortran -fPIC -fno-range-check %{optflags} -c *.f90 -I../include/ +gfortran -shared -Wl,-soname,libfcb.so.0 -o libfcb.so.0.0.0 *.o + +cd ../examples +utilsublist="adscimg2cbf +cbf2adscimg +adscimg2cbf" +for i in $utilsublist; do + gcc %{optflags} ${i}.c ${i}_sub.c -I../include ../src/libcbf.so.0.0.0 -o ${i} +done +utillist="convert_image +convert_minicbf +makecbf +img2cif +cif2cbf +cif2c" +for i in $utillist; do + gcc %{optflags} ${i}.c -I../include ../src/libcbf.so.0.0.0 -o ${i} -lm +done + +%install +rm -rf %{buildroot} +# make install DESTDIR=%{buildroot} INSTALL='install -p' + +mkdir -p %{buildroot}%{_libdir} +install -p -m 644 src/*.so* %{buildroot}%{_libdir}/ +pushd %{buildroot}%{_libdir} +chmod +x libcbf.so.0.0.0 +ln -sf libcbf.so.0.0.0 libcbf.so.0 +ln -sf libcbf.so.0.0.0 libcbf.so +chmod +x libfcb.so.0.0.0 +ln -sf libfcb.so.0.0.0 libfcb.so.0 +ln -sf libfcb.so.0.0.0 libfcb.so +popd + +mkdir -p %{buildroot}%{_bindir} +utilsublist="adscimg2cbf +cbf2adscimg +adscimg2cbf" +for i in $utilsublist; do + install -p -m 755 examples/${i} %{buildroot}%{_bindir}/ +done +utillist="convert_image +convert_minicbf +makecbf +img2cif +cif2cbf +cif2c" +for i in $utillist; do + install -p -m 755 examples/${i} %{buildroot}%{_bindir}/ +done + +mkdir -p %{buildroot}%{_includedir}/cbf +install -p -m 644 include/* %{buildroot}%{_includedir}/cbf/ +install -p -m 644 examples/img.h %{buildroot}%{_includedir}/cbf/ + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root,-) +%doc README doc/gpl.txt +# GPLv2+ +%{_bindir}/adscimg2cbf +%{_bindir}/cbf2adscimg +%{_bindir}/convert_image +%{_bindir}/convert_minicbf +%{_bindir}/makecbf +%{_bindir}/img2cif +%{_bindir}/cif2cbf +%{_bindir}/cif2c +# LGPLv2+ +%{_libdir}/libcbf.so.0.0.0 +%{_libdir}/libcbf.so.0 +%{_libdir}/libfcb.so.0.0.0 +%{_libdir}/libfcb.so.0 + +%files devel +%defattr(-,root,root,-) +# GPLv2+ +%doc doc +# LGPLv2+ +%{_libdir}/libcbf.so +%{_libdir}/libfcb.so +# GPLv2+ +%{_includedir}/cbf + +%changelog +* Sun Jan 29 2012 Tim Fenn - 0.9.2.3-2 +- update requires +- fix permissions of .c files in examples directory + +* Fri Dec 30 2011 Tim Fenn - 0.9.2.3-1 +- update to 0.9.2.3 +- remove duplicate adscimg2cbf +- fix typo +- use optflags and buildroot instead of RPM_OPT_FLAGS and RPM_BUILD_ROOT +- keep gpl.txt in doc dir + +* Fri Jul 01 2011 Tim Fenn - 0.9.2.2-1 +- update to 0.9.2.2 (removes pycifrw dependency) + +* Mon Nov 15 2010 Tim Fenn - 0.9.1-1 +- update to 0.9.1rc2 +- add lm to linker for utils + +* Mon Mar 08 2010 Tim Fenn - 0.9.0-1 +- update to 0.9.0 +- include examples + +* Wed Dec 09 2009 Tim Fenn - 0.8.1-2 +- add a define to cflags +- fix up doc +- license update + +* Wed Sep 16 2009 Tim Fenn - 0.8.1-1 +- initial build diff --git a/sources b/sources index e69de29..8226894 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +90c566de5d9b8a57edffb3c328f3066b CBFlib-0.9.2.3.tar.gz