diff --git a/README.md b/README.md index 84f8186..5021775 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # cwiid +A collection of Linux tools written in C for interfacing to the Nintendo Wiimote. + diff --git a/cwiid-0.6.00-hci_read.patch b/cwiid-0.6.00-hci_read.patch new file mode 100644 index 0000000..ebf7019 --- /dev/null +++ b/cwiid-0.6.00-hci_read.patch @@ -0,0 +1,19 @@ +*** libcwiid/bluetooth.c 2008-11-29 12:27:44.000000000 -0600 +--- libcwiid/bluetooth.c 2008-11-29 12:17:24.000000000 -0600 +*************** +*** 122,128 **** + } + + /* timeout (10000) in milliseconds */ +! if (hci_remote_name(sock, &dev_list[i].bdaddr, BT_NAME_LEN, + (*bdinfo)[bdinfo_count].name, 10000)) { + cwiid_err(NULL, "Bluetooth name read error"); + err = 1; +--- 122,128 ---- + } + + /* timeout (10000) in milliseconds */ +! if (hci_read_remote_name(sock, &dev_list[i].bdaddr, BT_NAME_LEN, + (*bdinfo)[bdinfo_count].name, 10000)) { + cwiid_err(NULL, "Bluetooth name read error"); + err = 1; diff --git a/cwiid-0.6.00-libbluetooth.patch b/cwiid-0.6.00-libbluetooth.patch new file mode 100644 index 0000000..e1ed271 --- /dev/null +++ b/cwiid-0.6.00-libbluetooth.patch @@ -0,0 +1,45 @@ +diff -Nru cwiid-0.6.00.orig/wmgui/Makefile.in cwiid-0.6.00/wmgui/Makefile.in +--- cwiid-0.6.00.orig/wmgui/Makefile.in 2007-07-28 20:47:03.000000000 +0200 ++++ cwiid-0.6.00/wmgui/Makefile.in 2013-01-31 07:35:33.893069227 +0100 +@@ -8,7 +8,7 @@ + + CFLAGS += @GTK_CFLAGS@ -I@top_builddir@/libcwiid + LDFLAGS += -L@top_builddir@/libcwiid +-LDLIBS += @GTK_LIBS@ -lm -lcwiid ++LDLIBS += @GTK_LIBS@ -lm -lcwiid -lbluetooth + INST_DIR = @bindir@ + + include $(COMMON)/include/app.mak +--- cwiid-0.6.00.orig/wminput/Makefile.in 2007-07-28 20:47:03.000000000 +0200 ++++ cwiid-0.6.00/wminput/Makefile.in 2013-01-31 07:39:22.914836251 +0100 +@@ -14,7 +14,7 @@ + -DWMINPUT_CONFIG_DIR=\"$(WMINPUT_CONFIG_DIR)\" \ + -DCWIID_PLUGINS_DIR=\"$(CWIID_PLUGINS_DIR)\" + +-LDLIBS += -lcwiid -ldl ++LDLIBS += -lcwiid -ldl -lbluetooth -lpthread + LDFLAGS += -L@top_builddir@/libcwiid -rdynamic + INST_DIR = @bindir@ + +--- cwiid-0.6.00.orig/wmdemo/Makefile.in 2007-04-11 04:57:27.000000000 +0200 ++++ cwiid-0.6.00/wmdemo/Makefile.in 2013-01-31 07:46:37.447599530 +0100 +@@ -8,7 +8,7 @@ + + CFLAGS += -I@top_builddir@/libcwiid + LDFLAGS += -L@top_builddir@/libcwiid +-LDLIBS += -lcwiid ++LDLIBS += -lcwiid -lbluetooth + INST_DIR = @bindir@ + + include $(COMMON)/include/app.mak +--- cwiid-0.6.00.orig/lswm/Makefile.in 2007-07-28 20:47:03.000000000 +0200 ++++ cwiid-0.6.00/lswm/Makefile.in 2013-01-31 07:46:13.539832631 +0100 +@@ -8,7 +8,7 @@ + + CFLAGS += -I@top_builddir@/libcwiid + LDFLAGS += -L@top_builddir@/libcwiid +-LDLIBS += -lcwiid ++LDLIBS += -lcwiid -lbluetooth + INST_DIR = @bindir@ + + include $(COMMON)/include/app.mak diff --git a/cwiid-0.6.00-pkg-config.patch b/cwiid-0.6.00-pkg-config.patch new file mode 100644 index 0000000..d5c2d4c --- /dev/null +++ b/cwiid-0.6.00-pkg-config.patch @@ -0,0 +1,77 @@ +Index: libcwiid/Makefile.in +=================================================================== +--- libcwiid/Makefile.in (revision 152) ++++ libcwiid/Makefile.in (working copy) +@@ -10,6 +10,7 @@ + LDLIBS += -lbluetooth -lpthread -lrt + LIB_INST_DIR = @libdir@ + INC_INST_DIR = @includedir@ ++PKG_CONFIG_INST_DIR = @libdir@/pkgconfig + + include $(COMMON)/include/lib.mak + +Index: libcwiid/cwiid.pc.in +=================================================================== +--- libcwiid/cwiid.pc.in (revision 0) ++++ libcwiid/cwiid.pc.in (revision 0) +@@ -0,0 +1,14 @@ ++prefix=@prefix@ ++exec_prefix=@exec_prefix@ ++libdir=@libdir@ ++includedir=@includedir@ ++sysconfdir=@sysconfdir@ ++cwiid_config_dir=@CWIID_CONFIG_DIR@ ++cwiid_plugins_dir=@CWIID_PLUGINS_DIR@ ++ ++Name: CWiid ++Description: CWiid Wiimote Interface ++Version: @PACKAGE_VERSION@ ++Requires: bluez ++Libs: -L${libdir} -lcwiid ++Cflags: -I${includedir} +Index: common/include/lib.mak.in +=================================================================== +--- common/include/lib.mak.in (revision 152) ++++ common/include/lib.mak.in (working copy) +@@ -7,8 +7,10 @@ + LINK_NAME = lib$(LIB_NAME).so + SO_NAME = $(LINK_NAME).$(MAJOR_VER) + SHARED_LIB = $(SO_NAME).$(MINOR_VER) ++PKG_CONFIG_FILE = $(LIB_NAME).pc + DEST_INC_INST_DIR = $(ROOTDIR)$(INC_INST_DIR) + DEST_LIB_INST_DIR = $(ROOTDIR)$(LIB_INST_DIR) ++DEST_PKG_CONFIG_INST_DIR = $(ROOTDIR)$(PKG_CONFIG_INST_DIR) + + OBJECTS = $(SOURCES:.c=.o) + DEPS = $(SOURCES:.c=.d) +@@ -28,7 +30,7 @@ + $(CC) -shared -Wl,-soname,$(SO_NAME) $(LDFLAGS) $(LDLIBS) \ + -o $(SHARED_LIB) $(OBJECTS) + +-install: install_header install_static install_shared ++install: install_header install_static install_shared install_pkgconfig + + install_header: + install -D $(LIB_NAME).h $(DEST_INC_INST_DIR)/$(LIB_NAME).h +@@ -42,6 +44,9 @@ + ln -sf $(SO_NAME) $(DEST_LIB_INST_DIR)/$(LINK_NAME) + $(LDCONFIG) + ++install_pkgconfig: ++ install -D $(PKG_CONFIG_FILE) $(DEST_PKG_CONFIG_INST_DIR)/$(PKG_CONFIG_FILE) ++ + clean: + rm -f $(STATIC_LIB) $(SHARED_LIB) $(OBJECTS) $(DEPS) + +Index: configure.ac +=================================================================== +--- configure.ac (revision 152) ++++ configure.ac (working copy) +@@ -136,6 +136,7 @@ + [doc/Makefile] + [man/Makefile] + [libcwiid/Makefile] ++ [libcwiid/cwiid.pc] + [wmdemo/Makefile] + [wmgui/Makefile] + [wminput/Makefile] diff --git a/cwiid-0.6.00-x86_64-python.patch b/cwiid-0.6.00-x86_64-python.patch new file mode 100644 index 0000000..e8638f3 --- /dev/null +++ b/cwiid-0.6.00-x86_64-python.patch @@ -0,0 +1,16 @@ +diff -Nru cwiid-0.6.00.orig/python/Makefile.in cwiid-0.6.00/python/Makefile.in +--- cwiid-0.6.00.orig/python/Makefile.in 2007-08-24 00:21:13.000000000 +0000 ++++ cwiid-0.6.00/python/Makefile.in 2013-09-18 11:58:34.344027046 +0000 +@@ -10,10 +10,10 @@ + $(PYTHON) setup.py build_ext $(DEBUGFLAGS) -I@top_builddir@/libcwiid -L@top_builddir@/libcwiid -lcwiid + + install: +- $(PYTHON) setup.py install --install-lib=${libdir}/python@PYTHON_VERSION@/site-packages $(SET_ROOT_DIR) ++ $(PYTHON) setup.py install --install-lib=${prefix}/lib/python@PYTHON_VERSION@/site-packages $(SET_ROOT_DIR) + + uninstall: +- rm -f $(ROOTDIR)${libdir}/python@PYTHON_VERSION@/site-packages/cwiid.so ++ rm -f $(ROOTDIR)${prefix}/lib/python@PYTHON_VERSION@/site-packages/cwiid.so + + clean: + rm -rf build diff --git a/cwiid.spec b/cwiid.spec new file mode 100644 index 0000000..3313d64 --- /dev/null +++ b/cwiid.spec @@ -0,0 +1,121 @@ +Name: cwiid +Version: 0.6.00 +Release: 3mamba +Summary: A collection of Linux tools written in C for interfacing to the Nintendo Wiimote +Group: Applications/Multimedia +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: http://abstrakraft.org/cwiid/ +Source: http://abstrakraft.org/cwiid/downloads/cwiid-%{version}.tgz +Patch0: cwiid-0.6.00-hci_read.patch +Patch1: cwiid-0.6.00-libbluetooth.patch +Patch2: cwiid-0.6.00-pkg-config.patch +Patch3: cwiid-0.6.00-x86_64-python.patch +License: GPL +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: libatk-devel +BuildRequires: libbluetooth-devel +BuildRequires: libcairo-devel +BuildRequires: libfontconfig-devel +BuildRequires: libfreetype-devel +BuildRequires: libgdk-pixbuf-devel +BuildRequires: libglib-devel +BuildRequires: libgtk2-devel +BuildRequires: libpango-devel +BuildRequires: libpython-devel +## AUTOBUILDREQ-END +Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release} +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +A collection of Linux tools written in C for interfacing to the Nintendo Wiimote. + +%package -n lib%{name} +Group: System/Libraries +Summary: Shared libraries for %{name} + +%description -n lib%{name} +This package contains shared libraries for %{name}. + +%package -n lib%{name}-devel +Group: Development/Libraries +Summary: Development files for %{name} +Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release} +## note: you can add this requirement if .pc files are provided by this package +Requires: pkg-config + +%description -n lib%{name}-devel +This package contains libraries and header files for developing applications that use %{name}. + +%debug_package + +%prep +%setup -q +%patch0 -p0 +%patch1 -p1 +%patch2 -p0 +%patch3 -p1 + +%build +autoreconf +%configure +%make + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%makeinstall LDCONFIG=/bin/true + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post -n lib%{name} -p /sbin/ldconfig +%postun -n lib%{name} -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%{_sysconfdir}/cwiid/wminput/acc_ptr +%{_sysconfdir}/cwiid/wminput/buttons +%{_sysconfdir}/cwiid/wminput/default +%{_sysconfdir}/cwiid/wminput/gamepad +%{_sysconfdir}/cwiid/wminput/ir_ptr +%{_sysconfdir}/cwiid/wminput/neverball +%{_sysconfdir}/cwiid/wminput/nunchuk_acc_ptr +%{_bindir}/lswm +%{_bindir}/wmgui +%{_bindir}/wminput +%{_mandir}/man1/wmgui.1.gz +%{_mandir}/man1/wminput.1.gz + +%files -n lib%{name} +%defattr(-,root,root) +%{_libdir}/libcwiid.so.* +%dir %{_libdir}/cwiid +%dir %{_libdir}/cwiid/plugins +%{_libdir}/cwiid/plugins/acc.so +%{_libdir}/cwiid/plugins/ir_ptr.so +%{_libdir}/cwiid/plugins/nunchuk_acc.so +%{python_sitearch}/cwiid-0.6.00-py*.egg-info +%{python_sitearch}/cwiid.so +%doc AUTHORS COPYING + +%files -n lib%{name}-devel +%defattr(-,root,root) +%{_includedir}/cwiid.h +%{_libdir}/libcwiid.a +%{_libdir}/libcwiid.so +%{_libdir}/pkgconfig/cwiid.pc +%{_datadir}/doc/cwiid/Xmodmap +%{_datadir}/doc/cwiid/wminput.list +%doc ChangeLog NEWS README + +%changelog +* Tue May 21 2013 Silvan Calarco 0.6.00-3mamba +- python 2.7 rebuild + +* Thu Mar 28 2013 Silvan Calarco 0.6.00-2mamba +- added pkgconfig support + +* Thu Jan 31 2013 Silvan Calarco 0.6.00-1mamba +- package created by silvan using the webbuild interface