%define TDSVER 7.4 %define major 0 %define ct_major 4 %define sy_major 5 %define libtdsodbc %mklibname tdsodbc %{major} %define libct %mklibname ct %{ct_major} %define libsybdb %mklibname sybdb %{sy_major} %define develname %mklibname %{name} -d Summary: An Open Source implementation of the tabular data stream protocol Name: freetds Version: 1.4.12 Release: %mkrel 1 License: LGPLv2+ and GPLv2+ Group: System/Libraries URL: https://www.freetds.org/ Source0: ftp://ftp.freetds.org/pub/freetds/stable/freetds-%{version}.tar.gz Patch0: freetds-do_not_build_the_docs.diff BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool BuildRequires: doxygen BuildRequires: docbook-style-dsssl BuildRequires: gettext-devel BuildRequires: pkgconfig(ncurses) BuildRequires: pkgconfig(readline) BuildRequires: pkgconfig(odbc) >= 2.0.0 BuildRequires: pkgconfig(gnutls) BuildRequires: pkgconfig(krb5) BuildRequires: pkgconfig(libgcrypt) %description FreeTDS is a free (open source) implementation of Sybase's db-lib, ct-lib, and ODBC libraries. Currently, dblib and ctlib are most mature. Both of these libraries have several programs know to compile and run against them. ODBC is just a roughed in skeleton, and not useful for real work. This package is built with support for TDS version %{TDSVER}. %package -n %{libct} Summary: An Open Source implementation of the tabular data stream protocol Group: System/Libraries Requires: %{name} >= %{version}-%{release} %description -n %{libct} This package contains a shared library for %{name} and is built with support for TDS version %{TDSVER}. %package -n %{libsybdb} Summary: An Open Source implementation of the tabular data stream protocol Group: System/Libraries Requires: %{name} >= %{version}-%{release} %description -n %{libsybdb} This package contains a shared library for %{name} and is built with support for TDS version %{TDSVER}. %package -n %{libtdsodbc} Summary: Driver ODBC for unixODBC Group: System/Libraries Provides: %{name}-unixodbc %description -n %{libtdsodbc} This package contains the ODBC driver build for unixODBC and is built with support for TDS version %{TDSVER}. %package -n %{develname} Summary: Development libraries and header files for the FreeTDS library Group: Development/C Requires: %{libtdsodbc} = %{version}-%{release} Requires: %{libct} = %{version}-%{release} Requires: %{libsybdb} = %{version}-%{release} Provides: lib%{name}-devel = %{version}-%{release} Provides: %{name}-devel = %{version}-%{release} Provides: freetds_mssql-devel = %{version}-%{release} %description -n %{develname} FreeTDS is a free (open source) implementation of Sybase's db-lib, ct-lib, and ODBC libraries. Currently, dblib and ctlib are most mature. Both of these libraries have several programs know to compile and run against them. ODBC is just a roughed in skeleton, and not useful for real work. This package is built with support for TDS version %{TDSVER}. This package allows you to compile applications with freetds libraries. %package doc Summary: User documentation for FreeTDS Group: Documentation %description doc The freetds-doc package contains the user guide and reference of FreeTDS and can be installed even if FreeTDS main package is not installed %prep %setup -q %patch0 -p1 find . -type d -perm 0700 -exec chmod 755 {} \; find . -type f -perm 0555 -exec chmod 755 {} \; find . -type f -perm 0444 -exec chmod 644 {} \; for i in `find . -type d -name CVS` `find . -type d -name .svn` `find . -type f -name .cvs\*` `find . -type f -name .#\*`; do if [ -e "$i" ]; then rm -rf $i; fi >&/dev/null done # lib64 fix perl -pi -e "s|/lib\b|/%{_lib}|g" configure* # perl path fix find -type f | xargs perl -pi -e "s|/usr/local/bin/perl|%{_bindir}/perl|g" # cleanup the initial source sed -i 's/\r//' doc/tds_ssl.html sed -i '1 s,#!.*/perl,#!%{__perl},' samples/*.pl doc/api_status.txt find doc/ samples/ COPYING* -type f -print0 | xargs -0 chmod -x find . -name "*.[ch]" -print0 | xargs -0 chmod -x # cause to rebuild docs # rm doc/reference/index.html # rm doc/userguide/index.htm %build autoreconf -fis %configure \ --disable-dependency-tracking \ --disable-rpath \ --disable-static \ --with-tdsver="%{TDSVER}" \ --with-unixodbc="%{_prefix}" \ --enable-msdblib \ --enable-sybase-compat \ --with-gnutls \ --enable-krb5 %make_build # DOCBOOK_DSL="`rpm -ql docbook-style-dsssl | grep html/docbook.dsl`" # (oe) the test suite assumes you have access to a sybase/mssql database # server (tds_connect) and have a correct freedts config... #make check %install install -d %{buildroot}/interfaces install -d %{buildroot}%{_sysconfdir}/%{name} install -d %{buildroot}%{_datadir}/%{name}-%{version}/samples install -d %{buildroot}%{_mandir}/man1 install -d %{buildroot}%{_mandir}/man5 %make_install find %{buildroot} -name '*.la' -delete # keep this for now... install -m0644 include/freetds/tds.h %{buildroot}%{_includedir}/ install -m0644 doc/*.1 %{buildroot}%{_mandir}/man1/ install -m0644 doc/*.5 %{buildroot}%{_mandir}/man5/ chmod +x %{buildroot}%{_libdir}/*.so cp -a -f samples/* %{buildroot}%{_datadir}/%{name}-%{version}/samples/ mv %{buildroot}/interfaces %{buildroot}%{_datadir}/%{name}-%{version}/ pushd %{buildroot}%{_sysconfdir}/%{name} ln -sf ../..%{_datadir}/%{name}-%{version}/interfaces/ popd #remove unwanted files rm -rf %{buildroot}%{_sysconfdir}/locales.conf rm -rf %{buildroot}%{_docdir}/%{name}* %files %doc AUTHORS.md ChangeLog NEWS.md README.md PWD %license COPYING.txt %config(noreplace) %{_sysconfdir}/freetds.conf %config(noreplace) %{_sysconfdir}/pool.conf %dir %{_datadir}/%{name}-%{version} %{_bindir}/bsqldb %{_bindir}/bsqlodbc %{_bindir}/datacopy %{_bindir}/defncopy %{_bindir}/fisql %{_bindir}/freebcp %{_bindir}/osql %{_bindir}/tdspool %{_bindir}/tsql %{_datadir}/%{name}-%{version}/interfaces %{_sysconfdir}/%{name}/interfaces %{_mandir}/man1/* %{_mandir}/man5/* %files -n %{libtdsodbc} %license COPYING_LIB.txt %{_libdir}/libtdsodbc.so.%{major}{,.*} %files -n %{libct} %license COPYING_LIB.txt %{_libdir}/libct.so.%{ct_major}{,.*} %files -n %{libsybdb} %license COPYING_LIB.txt %{_libdir}/libsybdb.so.%{sy_major}{,.*} %files -n %{develname} %doc TODO.md %{_includedir}/*.h %{_libdir}/*.so %{_datadir}/%{name}-%{version}/samples %files doc %doc doc/images doc/userguide doc/reference