%define lib_major 3 %define lib_name_orig libtclink %define libname %mklibname tclink %lib_major %define libnamedev %{libname}-devel %define phpsource %{_prefix}/src/php-devel %define _docdir %{_datadir}/doc/%{name}-%{version} %{expand:%(cat /usr/src/php-devel/PHP_BUILD||(echo -e "error: failed build dependencies:\n php-devel >= 430 (4.3.0) is needed by this package." >/dev/stderr;kill -2 $PPID))} %define phpdir %{_libdir}/php %define phpsource /usr/src/php-devel %define tclink_php_version 3.4 %define tclink_c_version 3.4 %define tclink_version 3.4 %define apachecontent /var/www/html Summary: TrustCommerce payment Name: tclink Version: %{tclink_version} Release: 1mdk Group: System/Servers License: LGPL URL: http://www.trustcommerce.com Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root Source0: %{name}-%{tclink_php_version}-php.tar.bz2 Source1: %{name}-%{tclink_c_version}-C.tar.bz2 Provides: ADVXpackage %description TCLink is a thin client library to allow your e-commerce servers to connect to the TrustCommerce payment gateway easily and consistently. The protocol (which is the same across all platforms and languages) is well-documented in the Web Developer's Guide, so please consult it for any questions you may have about the protocol syntax itself. The TrustCommerce web site is at http://www.trustcommerce.com %package -n %{libname} Summary: Main library for tclink Group: System/Libraries Provides: %{name} = %{version}-%{release} Provides: ADVXpackage %description -n %{libname} This package contains the library needed to run programs dynamically linked with tclink (Trust Commerce Payment Gateway). %package -n %{libnamedev} Summary: Headers for developping programs with TCLink Group: Development/Other Requires: %{libname} = %version-%release Provides: %{lib_name_orig}-devel = %{version}-%{release} Provides: %{name}-devel = %{version}-%{release} Provides: ADVXpackage %description -n %{libnamedev} This package contains the header file you need to develop applications which will use TCLink (Trust Commerce Payment Gateway). %package -n php-%{name} Version: %{phpversion}_%{version} Summary: PHP module for tclink Group: System/Servers Requires: %{libname} = %{tclink_version} Provides: php-%{name} = %{phpversion} Requires: libphp_common%{libversion} BuildRequires: openssl-devel BuildRequires: php%{libversion}-devel Provides: ADVXpackage %description -n php-%{name} This package contains the php module you need to develop PHP scripts which will use TCLink (Trust Commerce Payment). %prep %setup -q -n tclink-%{tclink_php_version}-php %setup -q -n tclink-%{tclink_c_version}-C -b 1 #Build libtclink.so %build %configure2_5x perl -pi -e 's|\$\(CC\) \$\(LDFLAGS\) -shared|ld \$\(LDFLAGS\) -shared -lc -soname lib_name_orig.so.3|;' Makefile make mv %{lib_name_orig}.so %{lib_name_orig}.so.%{lib_major} ln -sf %{lib_name_orig}.so.%{lib_major} %{lib_name_orig}.so cp -a ../tclink-%{tclink_php_version}-php/doc . #Build PHP modules cd ../tclink-%{tclink_php_version}-php ./build.sh %install rm -rf %{buildroot} mkdir -p %{buildroot}%{_libdir}/%{libname} mkdir -p %{buildroot}%{_includedir}/%{libname} cp -P %{lib_name_orig}*so* %{buildroot}%{_libdir} cp -P %{lib_name_orig}.a %{buildroot}%{_libdir}/%{libname} install -m 644 -s tclink.h %{buildroot}%{_includedir}/%{libname} cd ../tclink-%{tclink_php_version}-php mkdir -p %{buildroot}%{phpdir}/extensions install -m 755 -s modules/tclink.so %{buildroot}%{phpdir}/extensions/ mkdir -p %{buildroot}%{_docdir}/%{name}-%{version} echo > %{buildroot}%{_docdir}/%{name}-%{version}/README <<EOF The php-tclink package contains a dynamic shared object (DSO) for PHP4. To activate it, make sure the line 'extension=tclink.so' is uncommented in your /etc/php.ini file. EOF mkdir -p %{buildroot}%{_sysconfdir}/php cat > %{buildroot}%{_sysconfdir}/php/49_tclink.ini << EOF extension = tclink.so EOF mkdir -p %{buildroot}%{apachecontent}/addon-modules install -m 755 tctest.php %{buildroot}%{apachecontent}/addon-modules cd %{buildroot}%{apachecontent}/addon-modules ln -s tctest.php tctest.phps %clean rm -fr %buildroot %post -n %{libname} -p /sbin/ldconfig %postun -n %{libname} -p /sbin/ldconfig %files -n php-%{name} %defattr(-,root,root) %{phpdir}/extensions/tclink.so %{apachecontent}/addon-modules/* %doc %{_docdir}/%{name}-%{version}/README %config(noreplace) %{_sysconfdir}/php/49_tclink.ini %files -n %{libname} %defattr(-,root,root) %{_libdir}/*.so.* %attr(755,root,root) %doc README %files -n %{libnamedev} %defattr(-,root,root) %{_libdir}/*.so %{_libdir}/%{libname}/*.a %{_includedir}/%{libname}/*.h %doc doc/TCDevGuide.txt doc/TCDevGuide.html %changelog * Wed Nov 05 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 3.4-1mdk - built for php 4.3.4 - TCLink-C 3.4 - TCLink-php 3.4 * Mon Jul 21 2003 David Baudens <baudens@mandrakesoft.com> 3.3.1-15mdk - Rebuild to fix bad signature * Tue Jun 03 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 3.3.1-14mdk - rebuild for php v4.3.2 - use the %%configure2_5x macro * Mon May 05 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 3.3.1-13mdk - the obvious rebuild * Mon Jan 20 2003 Frederic Lepied <flepied@mandrakesoft.com> 3.3.1-12mdk - use %%mklibname * Sun Jan 19 2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 3.3.1-11mdk - rebuild with new openssl - try to use %%mklibname, only to have it fail miserably. flepied, can you check that out? * Sun Jan 5 2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 3.3.1-10mdk - New 4.3.0 PHP release - New method of installing extensions thanks to Oden Eriksson - Add Provides: ADVXpackage, all ADVX package will have this tag, so we can easily do a rpm --whatprovides ADVXpackage to find out what ADVX packages a user has installed on his system. - Add soname to libtclink.so.3 * Mon Nov 25 2002 Jean-Michel Dault <jmdault@mandrakesoft.com> 3.3.1-9mdk - Up relase to 9mdk to try and get Cooker to synchronize * Fri Nov 22 2002 Jean-Michel Dault <jmdault@mandrakesoft.com> 3.3.1-4mdk - Make php-tclink require only libtclink, not libtclink-devel - Add tclink version to php-tclink version, so the package stops being rejected! * Thu Nov 21 2002 Jean-Michel Dault <jmdault@mandrakesoft.com> 3.3.1-3mdk - re-added BuildRequires openssl-devel (thanks Stefan) * Wed Nov 20 2002 Jean-Michel Dault <jmdault@mandrakesoft.com> 3.3.1-2mdk - New 3.3.1 API * Tue Oct 29 2002 Stefan van der Eijk <stefan@eijk.nu> 3.3-8mdk - BuildRequires: openssl-devel php-pear * Sat Sep 7 2002 Jean-Michel Dault <jmdault@mandrakesoft.com> 3.3-8mdk - PHP 4.2.3 maintenance release - Do not reload apache - Why was it missing in Cooker?!!?! * Sat Sep 07 2002 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.2.3-1mdk - 4.2.3 maintenance release - Do not reload apache * Thu Aug 22 2002 Jean-Michel Dault <jmdault@mandrakesoft.com> 3.3-7mdk - Rebuild for 4.2.2 - Macroize a bit more, make php version depend on "php -v" * Thu May 30 2002 Christian Belisle <cbelisle@mandrakesoft.com> 3.3-6mdk - rebuild against latest php. * Fri Mar 22 2002 David BAUDENS <baudens@mandrakesoft.com> 3.3-5mdk - Sync phpversion with php package. I really like packages which are not builded on the cluster... * Fri Mar 22 2002 David BAUDENS <baudens@mandrakesoft.com> 3.3-4mdk - Use %%release for phprelease * Fri Mar 22 2002 David BAUDENS <baudens@mandrakesoft.com> 3.3-3mdk - Clean after build - Requires %%version-%%release and not only %%version - Use %%version-%%release in changelog * Tue Feb 05 2002 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.1.1-2mdk - Fix spec and reput the documentation into the devel package * Tue Feb 05 2002 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.1.1-1mdk - New 3.3 API finally compiles with PHP 4.1! * Mon Oct 29 2001 Christian Belisle <cbelisle@mandrakesoft.com> 4.0.6-2mdk - Fixed errors in changelog. - Fixed devel files location. * Thu Oct 25 2001 Christian Belisle <cbelisle@mandrakesoft.com> 4.0.6-1mdk - PHP 4.0.6. - TCLink-C 3.2.2. - TCLink-php 3.2.6. - s/Copyright/License. - TCLink-C no longer in the php package. - Respect library policy (spec cleaning). * Sat Apr 14 2001 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.0.4pl1-1mdk - New package, will be used by the Mandrake Payment web sites