# COPR Ligenix's spec file for php-chartdir # # Copyright (c) 2021 Jean-Marc Liger # # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # # disable build tags as we won't build anything %if 0%{?fedora} || 0%{?rhel} >= 8 %global _build_id_links none %endif %global php_inidir %{_sysconfdir}/php.d %global php_ztsdir %{_sysconfdir}/php-zts.d %global php_extdir %{_libdir}/php/modules %global php_name chartdir %global ini_name 40-%{php_name}.ini %global php_540 5.4 %global php_720 7.2 %global php_730 7.3 %global php_740 7.4 %global php_800 8.0 %global php_810 8.1 Summary: Chart and Graph Plotting module for PHP Name: php-%{php_name} Version: 7 Release: 1%{?dist} License: As is Vendor: Advanced Software Engineering Limited Group: Development/Languages URL: https://www.advsofteng.com/cdphp.html Source0: https://www.advsofteng.net/%{php_name}_php_linux_64.tar.gz ExclusiveArch: x86_64 %if 0%{?fedora} || 0%{?rhel} >= 8 Requires: php >= %{php_720} %else Requires: php >= %{php_540} %endif Requires: %{name}ver = %{version}-%{release} %description ChartDirector for PHP is completely self-contained and does not required any third party PHP or graphics module ("GD" not required). ChartDirector provides built-in multi-threaded graphics engine, specially designed for high performance server side graphics. It is fast and efficient and employs high quality anti-alias graphics. ChartDirector has sophisticated Javascript library to support ASP charts with AJAX features and advanced user interactions, such as mouse events for chart objects, programmable track cursor, zoomimg and scrolling, and realtime charts. %if 0%{?rhel} == 7 %package -n %{name}540 Summary: Chart and Graph Plotting module for PHP %{php_540} Requires: %{name} = %{version}-%{release} Provides: %{name}ver = %{version}-%{release} Requires: php >= %{php_540} Requires: php < 5.5 %description -n %{name}540 ChartDirector librairie for PHP %{php_540} %endif %if 0%{?fedora} || 0%{?rhel} >= 8 %package -n %{name}720 Summary: Chart and Graph Plotting module for PHP %{php_720} Requires: %{name} = %{version}-%{release} Provides: %{name}ver = %{version}-%{release} Requires: (php >= %{php_720} with php < %{php_730}) %description -n %{name}720 ChartDirector librairie for PHP %{php_720} %package -n %{name}730 Summary: Chart and Graph Plotting module for PHP %{php_730} Requires: %{name} = %{version}-%{release} Provides: %{name}ver = %{version}-%{release} Requires: (php >= %{php_730} with php < %{php_740}) %description -n %{name}730 ChartDirector librairie for PHP %{php_730} %endif %package -n %{name}740 Summary: Chart and Graph Plotting module for PHP %{php_740} Requires: %{name} = %{version}-%{release} Provides: %{name}ver = %{version}-%{release} %if 0%{?fedora} || 0%{?rhel} >= 8 Requires: (php >= %{php_740} with php < %{php_800}) %else Requires: php >= %{php_740} Requires: php < %{php_800} %endif %description -n %{name}740 ChartDirector librairie for PHP %{php_740} %package -n %{name}800 Summary: Chart and Graph Plotting module for PHP %{php_800} Requires: %{name} = %{version}-%{release} Provides: %{name}ver = %{version}-%{release} %if 0%{?fedora} || 0%{?rhel} >= 8 Requires: (php >= %{php_800} with php < %{php_810}) %else Requires: php >= %{php_800} Requires: php < %{php_810} %endif %description -n %{name}800 ChartDirector librairie for PHP %{php_800} %prep %setup -q -n ChartDirector mv README.TXT doc # create ini files cat << 'EOF' | tee %{ini_name} ; Enable '%{php_name}' extension module extension = %{php_name}.so EOF cat << 'EOF' | tee zts-%{ini_name} ; Enable '%{php_name}mt' extension module extension = %{php_name}mt.so EOF %build %install mkdir -p %{buildroot}{%{php_inidir},%{php_extdir}} install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} install -D -m 644 zts-%{ini_name} %{buildroot}%{php_ztsdir}/%{ini_name} mkdir -p %{buildroot}%{php_extdir}/fonts install -D -m 644 lib/{FinanceChart.php,php%{php_name}.php} %{buildroot}%{php_extdir}/ install -D -m 755 lib/lib%{php_name}.so %{buildroot}%{php_extdir}/ %if 0%{?fedora} || 0%{?rhel} >= 8 libs="720 730 740 800 720mt 730mt 740mt 800mt" %else libs="540 740 800 540mt 740mt 800mt" %endif for ver in $libs; do install -D -m 755 lib/php%{php_name}$ver.dll %{buildroot}%{php_extdir}/%{php_name}$ver.so done install -D -m 644 lib/fonts/* %{buildroot}%{php_extdir}/fonts/ # create directory for debuginfo package %if 0%{?fedora} || 0%{?rhel} >= 8 mkdir -p %{buildroot}%{_libdir}/debug %endif %check # add directory in debuginfo package %if 0%{?fedora} || 0%{?rhel} >= 8 echo "%dir %{_libdir}/debug" >> %{_builddir}/ChartDirector/debugfiles.list echo "%dir %{_libdir}/debug" >> %{_builddir}/ChartDirector/debugsourcefiles.list %endif # create or delete chardir.so symlink from phpchartdirxxx.so installed versions librairies %if 0%{?rhel} == 7 %pre -n %{name}540 if [ -z "`rpm --verify %{name}540`" ]; then %{_bindir}/rm %{php_extdir}/%{php_name}*.so fi %{_bindir}/ln -s %{php_extdir}/%{php_name}540.so %{php_extdir}/%{php_name}.so %{_bindir}/ln -s %{php_extdir}/%{php_name}540mt.so %{php_extdir}/%{php_name}mt.so %postun -n %{name}540 if [ -n "`rpm --verify %{name}540`" ]; then %{_bindir}/rm %{php_extdir}/%{php_name}*.so fi %endif %if 0%{?fedora} || 0%{?rhel} >= 8 %pre -n %{name}720 if [ -z "`rpm --verify %{name}720`" ]; then %{_bindir}/rm %{php_extdir}/%{php_name}*.so fi %{_bindir}/ln -s %{php_extdir}/%{php_name}720.so %{php_extdir}/%{php_name}.so %{_bindir}/ln -s %{php_extdir}/%{php_name}720mt.so %{php_extdir}/%{php_name}mt.so %postun -n %{name}720 if [ -n "`rpm --verify %{name}720`" ]; then %{_bindir}/rm %{php_extdir}/%{php_name}*.so fi %pre -n %{name}730 if [ -z "`rpm --verify %{name}730`" ]; then %{_bindir}/rm %{php_extdir}/%{php_name}*.so fi %{_bindir}/ln -s %{php_extdir}/%{php_name}730.so %{php_extdir}/%{php_name}.so %{_bindir}/ln -s %{php_extdir}/%{php_name}730mt.so %{php_extdir}/%{php_name}mt.so %postun -n %{name}730 if [ -n "`rpm --verify %{name}730`" ]; then %{_bindir}/rm %{php_extdir}/%{php_name}*.so fi %endif %pre -n %{name}740 if [ -z "`rpm --verify %{name}740`" ]; then %{_bindir}/rm %{php_extdir}/%{php_name}*.so fi %{_bindir}/ln -s %{php_extdir}/%{php_name}740.so %{php_extdir}/%{php_name}.so %{_bindir}/ln -s %{php_extdir}/%{php_name}740mt.so %{php_extdir}/%{php_name}mt.so %postun -n %{name}740 if [ -n "`rpm --verify %{name}740`" ]; then %{_bindir}/rm %{php_extdir}/%{php_name}*.so fi %pre -n %{name}800 if [ -z "`rpm --verify %{name}800`" ]; then %{_bindir}/rm %{php_extdir}/%{php_name}*.so fi %{_bindir}/ln -s %{php_extdir}/%{php_name}800.so %{php_extdir}/%{php_name}.so %{_bindir}/ln -s %{php_extdir}/%{php_name}800mt.so %{php_extdir}/%{php_name}mt.so %postun -n %{name}800 if [ -n "`rpm --verify %{name}800`" ]; then %{_bindir}/rm %{php_extdir}/%{php_name}*.so fi %files %{!?_licensedir:%global license %%doc} %license LICENSE.TXT %doc doc/* %config(noreplace) %{php_inidir}/%{ini_name} %config(noreplace) %{php_ztsdir}/%{ini_name} %{php_extdir}/fonts %{php_extdir}/lib%{php_name}.so %{php_extdir}/php%{php_name}.php %{php_extdir}/FinanceChart.php %if 0%{?rhel} == 7 %files -n %{name}540 %{php_extdir}/%{php_name}540*.so %endif %if 0%{?fedora} || 0%{?rhel} >= 8 %files -n %{name}720 %{php_extdir}/%{php_name}720*.so %files -n %{name}730 %{php_extdir}/%{php_name}730*.so %endif %files -n %{name}740 %{php_extdir}/%{php_name}740*.so %files -n %{name}800 %{php_extdir}/%{php_name}800*.so %changelog * Wed Oct 20 2021 Jean-Marc Liger - 7-1 - Initial RPM for COPR EL7 and EL8