Summary: libusb for AIX Name: libusb Version: 1.0.19 Release:1 Group: System Environment/Libraries License: LGPL URL: http://sourceforge.net/projects/libusb/ Distribution: Open Source Vendor: IBM Pvt Ltd. Packager: IBM Pvt Ltd. Source0: http://sourceforge.net/projects/libusb/%{name}-%{version}.tar.gz Patch0: %{name}-%{version}-1-aix.patch Patch1: %{name}-%{version}-1-aix.patch1 Patch2: %{name}-%{version}-1-aix.patch2 %ifos aix7.1 Requires: AIX-rpm >= 7.1.4.30 %endif %ifos aix7.2 Requires: AIX-rpm >= 7.2.1.0 %endif %description A library which allows userspace access to USB devices. #Add shell commands here to untar your sources # and command to remove previous builds %prep %setup -q %patch0 -p1 -b .aix %patch1 -p1 -b .aix %patch2 -p1 -b .aix %build ./configure --prefix=/usr --enable-shared="no" --enable-static --enable-examples-build make all %install rm -rf $RPM_BUILD_ROOT make DESTDIR=${RPM_BUILD_ROOT} install #do the job manually as bin directory is not created due to lack of make install in # examples folder of libusb mkdir -p ${RPM_BUILD_ROOT}/usr/bin cd examples cp listdevs ${RPM_BUILD_ROOT}/usr/bin/usb_listdevs cp xusb ${RPM_BUILD_ROOT}/usr/bin/usb_xusb %post /usr/bin/cp /etc/syslog.conf /etc/syslog.conf.libusbbackup if [[ $? -ne 0 ]] then echo "Failed to copy backup of /etc/syslog.conf. Please take a manual backup" fi echo "user.debug /var/adm/ras/libusb.log rotate size 1m files 10" >> /etc/syslog.conf if [[ $? -ne 0 ]] then echo "1.Failed to change /etc/syslog.conf. Libusb logging wont work" fi echo "user.err /var/adm/ras/libusb.log rotate size 1m files 10" >> /etc/syslog.conf if [[ $? -ne 0 ]] then echo "2.Failed to change /etc/syslog.conf. Libusb logging wont work" fi echo "user.info /var/adm/ras/libusb.log rotate size 1m files 10" >> /etc/syslog.conf if [[ $? -ne 0 ]] then echo "3.Failed to change /etc/syslog.conf. Libusb logging wont work" fi /usr/bin/touch /var/adm/ras/libusb.log if [[ $? -ne 0 ]] then echo "Failed to create /var/adm/ras/libusb.log. Please do it manually. " fi /usr/bin/refresh -s syslogd if [[ $? -ne 0 ]] then echo "Failed to refresh syslogd" fi %preun #0 is uninstall and 1 is upgrade. do cleanup only during install #if upgrade, dont cleanup. if [ "$1" = 0 ]; then usr/bin/cp /etc/syslog.conf.libusbbackup /etc/syslog.conf if [[ $? -ne 0 ]] then echo "Failed to restore backup of /etc/syslog.conf. Please restore manually if backup is taken while installing, otherwise ignore it" else /usr/bin/rm /etc/syslog.conf.libusbbackup fi # there may be file like libusb.log.1 if file is over 10MB /usr/bin/rm /var/adm/ras/libusb.log* if [[ $? -ne 0 ]] then echo "Failed to delete /var/adm/ras/libusb.log. " fi /usr/bin/refresh -s syslogd fi %clean rm -rf $RPM_BUILD_ROOT %files /usr/lib/libusb* /usr/include/libusb* /usr/lib/pkgconfig/libusb-1.0.pc /usr/bin/usb_listdevs /usr/bin/usb_xusb %changelog * Mon Nov 28 2017 Phani Ayyagari 1.0.19-1 - Handle asynchronous I/O completions - Depend on status argument instead of errno to know the kernel returned errors - Fixed memory leaks - Shipping listdevs and xusb as usb_listdevs and usb_xusb respectively - Add upgrade code for future RPM upgraded * Fri Aug 18 2017 Phani Ayyagari 1.0.19-1 - Fix problem of configs starting from zero instead of 1 - Change the ODM query to also check for available state, otherwise some stale entries may cause open to fail - remove the Big Endian message from xusb * Thu Mar 30 2017 Phani Ayyagari 1.0.19-1 - static compilation with libgcc and check for AIX supported versions for libusb * Mon Feb 15 2016 Phani Ayyagari 1.0.19-1 - AIX Support for LIBUSB