%global pkgvers 2 %global scdate0 20220625 %global schash0 08570046d5f162d27b206b4479f7b27bc56e7ddd %global branch0 master %global source0 https://git.code.sf.net/p/blt/src.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: blt Version: 4.0 Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: Widget extension to the Tcl/Tk scripting language License: MIT URL: http://sourceforge.net/projects/blt Patch0: blt-hash.patch BuildRequires: gcc make git autoconf automake BuildRequires: tk-devel tcl-devel libpq-devel BuildRequires: freetype-devel libjpeg-turbo-devel libpng-devel BuildRequires: libXpm-devel expat-devel libtiff-devel sqlite-devel %if 0%{?fedora} BuildRequires: libssh2-devel %endif Requires: tk tcl Provides: tk-blt = %{version}-%{release} %{!?tcl_version: %global tcl_version %(echo 'puts $tcl_version' | tclsh)} %{!?tcl_sitearch: %global tcl_sitearch %{_libdir}/tcl%{tcl_version}} %{!?tcl_sitelib: %global tcl_sitelib %{_datadir}/tcl%{tcl_version}} %description BLT is a very powerful extension to Tk. It adds plotting widgets (graph, barchart and stripchart), hierarchy tree and table, tab notebook, table geometry manager, vector, background program execution, busy utility, eps canvas item, drag and drop facility, bitmap command and miscellaneous commands. %package devel Summary: Development files for BLT Requires: tcl-devel Requires: %{name} = %{version}-%{release} %description devel This package provides headers needed to build packages based on BLT. %prep %setup -T -c -n %{name} git clone --depth 1 -n -b %{branch0} %{source0} . git fetch --depth 1 origin %{schash0} git reset --hard %{schash0} git log --format=fuller %patch -P 0 -p0 -b .hash~ %build # Fix bad interpreter path sed -i -e 's#/usr/local/bin/tclsh#/usr/bin/tclsh#' demos/scripts/page.tcl %if 0%{?fedora} > 40 %global tclvers %(cat /usr/include/tcl.h | grep MAJOR_VERSION | grep define | grep -E -o "[0-9]+") sed -i -e 's|BLT_GET_SYMBOL(TCL_MAJOR_VERSION.*|TCL_MAJOR_VERSION=%{tclvers}|' configure.in #sed -i -e 's|AC_ERROR.*Mismatched Tcl|AC_MSG_CHECKING([Mismatched Tcl|' configure.in %endif sed -i -e 's|libdir=${exec_prefix}/lib|libdir=${exec_prefix}/%{_lib}|g' configure.in sed -i -e 's|-Wl,-rpath,$(LD_RPATH)||g' configure.in sed -i -e 's|$(SO_CFLAGS)|$(SO_CFLAGS) ${C_FLAGS}|' src/Makefile.in sed -i -e 's|555|777|' src/Makefile.in sed -i -e 's|i $(destdir)|i $(DESTDIR)$(destdir)|' library/palettes/Makefile.in sed -i -e 's|i $(destdir)|i $(DESTDIR)$(destdir)|' library/dd_protocols/Makefile.in sed -i -e 's|bltConfig.sh $(libdir)|bltConfig.sh $(DESTDIR)$(libdir)|' Makefile.in export C_FLAGS="%{optflags}" autoreconf -f %configure --with-tcl=%{_libdir} \ --with-tk=%{_libdir} \ --with-blt=%{tcl_sitelib} \ --without-pqincdir \ --without-pqlibdir \ --without-mysqlincdir \ --without-mysqllibdir \ --includedir=%{_includedir}/%{name} %make_build for file in demos/*.tcl ; do sed -i -e 's#../src/bltwish#/usr/bin/wish#' $file done sed -i -e 's#../bltwish#/usr/bin/wish#' demos/scripts/xcolors.tcl %install %make_install rm -f %{buildroot}%{_bindir}/bltsh* rm -f %{buildroot}%{_bindir}/bltwish* rm -f %{buildroot}%{_libdir}/*.a rm -f %{buildroot}%{tcl_sitelib}/%{name}%{version}/{README,NEWS,PROBLEMS} rm -rf %{buildroot}%{_mandir}/ mv -f %{buildroot}%{_libdir}/bltConfig.sh %{buildroot}%{_bindir}/ %ldconfig_scriptlets %files %doc README INSTALL MANIFEST %{_bindir}/* %{_libdir}/*.so %{tcl_sitelib}/* %files devel %{_includedir}/* %changelog * Wed Dec 04 2019 Balint Cristian - github build releases