tc01 pushed to libticables2 (f20). "Initial import (#1186501)."

notifications at fedoraproject.org notifications at fedoraproject.org
Tue Apr 7 22:39:35 UTC 2015


>From 99a255d3346c96436310e2db34e9bd2ac496067f Mon Sep 17 00:00:00 2001
From: Ben Rosser <rosser.bjr at gmail.com>
Date: Tue, 7 Apr 2015 18:37:51 -0400
Subject: Initial import (#1186501).


diff --git a/.gitignore b/.gitignore
index e69de29..f84d169 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/libticables2-1.3.4.tar.bz2
diff --git a/69-libticables.rules b/69-libticables.rules
new file mode 100644
index 0000000..edf812c
--- /dev/null
+++ b/69-libticables.rules
@@ -0,0 +1,18 @@
+ACTION!="add", GOTO="libticables_end"
+
+# serial device (assume TI calculator)
+KERNEL=="ttyS[0-3]", ENV{ID_PDA}="1"
+# parallel device (assume TI calculator)
+SUBSYSTEM=="ppdev", ENV{ID_PDA}="1"
+# SilverLink
+SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="e001", ENV{ID_PDA}="1"
+# TI-84+ DirectLink
+SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="e003", ENV{ID_PDA}="1"
+# TI-89 Titanium DirectLink
+SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="e004", ENV{ID_PDA}="1"
+# TI-84+ SE DirectLink
+SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="e008", ENV{ID_PDA}="1"
+# TI-Nspire DirectLink
+SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="e012", ENV{ID_PDA}="1"
+
+LABEL="libticables_end"
diff --git a/libticables-libusb_check.patch b/libticables-libusb_check.patch
new file mode 100644
index 0000000..067ae45
--- /dev/null
+++ b/libticables-libusb_check.patch
@@ -0,0 +1,42 @@
+diff -rupN libticables2-1.3.4/src/ticables.c libticables2-1.3.4_patched/src/ticables.c
+--- libticables2-1.3.4/src/ticables.c	2013-03-29 08:48:00.000000000 -0400
++++ libticables2-1.3.4_patched/src/ticables.c	2015-04-06 15:29:22.929649741 -0400
+@@ -92,6 +92,12 @@ static CableFncts const *const cables[]
+ // not static, must be shared between instances
+ int ticables_instance = 0;	// counts # of instances
+ 
++// Did initializing libusb_1.0 work? Keep track of that with a flag.
++// --Ben Rosser (TC01)
++#ifdef HAVE_LIBUSB_1_0
++	int libusb_working = -1;
++#endif
++
+ /**
+  * ticables_library_init:
+  *
+@@ -153,9 +159,11 @@ TIEXPORT1 int TICALL ticables_library_in
+ 	/* init the libusb */
+ 	usb_init();
+ #elif defined(HAVE_LIBUSB_1_0)
+-	/* init the libusb */
+-	libusb_init(NULL);
+-	libusb_set_debug(NULL, 3);
++	/* init the libusb, if it fails, keep track of that. */
++	libusb_working = libusb_init(NULL);
++	if (libusb_working == LIBUSB_SUCCESS) {
++		libusb_set_debug(NULL, 3);
++	}
+ #endif
+ 
+ 	return (++ticables_instance);
+@@ -175,7 +183,9 @@ TICALL ticables_library_exit(void)
+ #if defined(HAVE_LIBUSB)
+ 	// No exit function for libusb 0.1.x.
+ #elif defined(HAVE_LIBUSB_1_0)
+-	libusb_exit(NULL); // XXX NULL ?
++	if (libusb_working == LIBUSB_SUCCESS) {
++		libusb_exit(NULL); // XXX NULL ?
++	}
+ #endif
+ 	return (--ticables_instance);
+ }
diff --git a/libticables2.spec b/libticables2.spec
new file mode 100644
index 0000000..885b819
--- /dev/null
+++ b/libticables2.spec
@@ -0,0 +1,131 @@
+%global tilp_version 1.17
+%global _udevdir %{_prefix}/lib/udev/rules.d
+
+Name:           libticables2
+Version:        1.3.4
+Release:        3%{?dist}
+Summary:        Texas Instruments link cables library
+
+Group:          Development/Libraries
+License:        GPLv2+
+URL:            https://sourceforge.net/projects/tilp/
+Source0:        http://sourceforge.net/projects/tilp/files/tilp2-linux/tilp2-%{tilp_version}/%{name}-%{version}.tar.bz2
+# Udev rules taken from Arch AUR package.
+Source1:        http://tc01.fedorapeople.org/tilp2/69-libticables.rules
+# Patch to add error checking to libusb_init calls.
+Patch0:         http://tc01.fedorapeople.org/tilp2/libticables-libusb_check.patch
+
+BuildRequires:  glib2-devel, pkgconfig, libusb1-devel, tfdocgen, gettext
+
+%package devel
+
+Group:          Development/Libraries
+Summary:        Development files for %{name}
+Requires:       %{name}%{?_isa} = %{version}-%{release}
+
+%package doc
+
+Group:          Documentation
+Summary:        HTML documentation for %{name}
+BuildArch:      noarch
+
+%description
+The ticables library is able to handle the different link cables
+designed for Texas Instruments's graphing calculators (also called
+handhelds) in a fairly transparent fashion. With this library, the
+developer does not have to worry about the different link cables'
+characteristics as well as the different platforms. The library
+provides a complete API which is very easy to use and makes things
+easier.
+
+%description devel
+Include files and libraries required for developing applications
+that make use of libticables.
+
+%description doc
+HTML documentation for linking and developing applications
+using libticables2.
+
+%prep
+%setup -q
+sed -i 's/\r$//' docs/html/style.css
+%patch0 -p1
+
+%build
+%configure --enable-libusb10 --disable-static
+make %{?_smp_mflags}
+
+%check
+make -C tests check
+
+%install
+make install DESTDIR=%{buildroot}
+rm -f %{buildroot}%{_libdir}/libticables2.la
+make -C docs install DESTDIR=%{buildroot}
+rm %{buildroot}/%{_pkgdocdir}/COPYING
+mkdir -p %{buildroot}%{_udevdir}
+cp -a %SOURCE1 %{buildroot}%{_udevdir}/69-libticables.rules
+%find_lang %{name}
+
+%files -f %{name}.lang
+%{_udevdir}/69-libticables.rules
+%{_libdir}/libticables2.so.*
+%dir %{_pkgdocdir}
+%doc %{_pkgdocdir}/README
+%doc %{_pkgdocdir}/AUTHORS
+%doc %{_pkgdocdir}/ChangeLog
+%license COPYING
+
+%files doc
+%doc %{_pkgdocdir}/html/
+%license COPYING
+
+%files devel
+%dir %{_includedir}/tilp2
+%{_includedir}/tilp2/export1.h
+%{_includedir}/tilp2/stdints1.h
+%{_includedir}/tilp2/ticables.h
+%{_includedir}/tilp2/timeout.h
+%{_libdir}/libticables2.so
+%{_libdir}/pkgconfig/ticables2.pc
+
+%post
+/sbin/udevadm control --reload-rules
+/sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%changelog
+* Mon Apr 6 2015 'Ben Rosser' <rosser.bjr at gmail.com> 1.3.4-3
+- Added a patch that adds error checking around libusb_init, preventing the tests from crashing under mock.
+
+* Fri Mar 6 2015 'Ben Rosser' <rosser.bjr at gmail.com> 1.3.4-2
+- Package now owns its documentation directory.
+- Changed macros from define to global.
+- The tilp2 include dir is now co-owned between this package and libticonv-devel.
+- The doc subpackage now has a license.
+- The test suite is now ran in the check section.
+
+* Fri Feb 27 2015 'Ben Rosser' <rosser.bjr at gmail.com> 1.3.4-1
+- Release bump from 0 to 1.
+- Added HTML documentation subpackage.
+- Fixed localization to use gettext and find_lang macro.
+- Cleaned up commands for installing udev rule.
+
+* Sat Apr 20 2013 'Ben Rosser' <rosser.bjr at gmail.com> 1.3.4-0
+- Updated to latest upstream version of tilp
+
+* Wed Sep 12 2012 'Ben Rosser' <rosser.bjr at gmail.com> 1.3.3-2
+- Placed udev rules in correct directory (/lib, not /etc)
+
+* Wed Jul 11 2012 'Ben Rosser' <rosser.bjr at gmail.com> 1.3.3-1
+- Added full documentation, built by tfdocgen
+
+* Thu Jul 5 2012 'Ben Rosser' <rosser.bjr at gmail.com> 1.3.3-0
+- Updated package to 1.3.3, vastly improved specfile
+- Added devel subpackage for all devel files
+- Udev rules are now hosted online by me
+
+* Sat Jul 30 2011 'Ben Rosser' <rosser.bjr at gmail.com> 1.3.2-0
+- Initial version of the package
+
diff --git a/sources b/sources
index e69de29..b6c5ce7 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+2b724035f735d1d04c8fac134f45744f  libticables2-1.3.4.tar.bz2
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/libticables2.git/commit/?h=f20&id=99a255d3346c96436310e2db34e9bd2ac496067f


More information about the scm-commits mailing list