⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 install

📁 Media transfer protocol implementation on POSIX. Have detailed readme on how to move to windows
💻
字号:
INSTALLATION OVERVIEW=====================Once libmtp is built and installed, you will have the following files($PREFIX is the --prefix option given to the "configure" script anddefaults to /usr/local/):   $PREFIX/lib/libmtp.a               Static C library   $PREFIX/lib/libmtp.so.x.y.z        Dynamic C library   $PREFIX/lib/libmtp.so.x            A link to the library   $PREFIX/lib/libmtp.so              A link to the library   $PREFIX/include/libmtp.h           C header file for libmtp API   $PREFIX/lib/pkgconfig/libmtp.pc    pkg-config configuration fileSample programs will be built in the "example" directory, and shouldhelp you get used to using the libmtp API, as well as provide someimmediate gratification. Links to other programs using the libmtpAPI may be found at the homepage: http://libmtp.sourceforge.net/Shared Library Support----------------------Shared library linking is supported. You will need to 'make install'the library before you can execute the sample binaries, and add thelibmtp install directory to your shared library search path.On Linux, you would add the line "/usr/local/lib" to your"/etc/ld.so.conf" or as a oneliner in for example a"/etc/ld.so.conf.d/local.conf" file and run theprogram "ldconfig" to scan in the shared libraries at the new path. This is a part of the Linux shared library loader actually.To access the library from real odd locations you can usethe LD_LIBRARY_PATH environment variable by setting it beforeyou run your program, for example:  % export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib  % my_programThis way of enabling the library to link is a workaround hack.Note that the LD_LIBRARY_PATH is actually supposed to be used fortesting, not production systems or distributions. It is commonlyused as a workaround when a user is installing libraries in her/hishome directory however. Read more about this environment variablehere: http://www.visi.com/~barr/ldpath.htmlThe shared library comes with different interface version numbers,for example libmtp.so.4, libmtp.so.5 and so forth. This is used sothat both old and new libmtp libraries shall be able to coexist onthe same system. When you compile your programs they will typically bind to the latest version of the shared library. A link to the latest version is always provided as $PREFIX/lib/libmtp.so.libusb Support--------------This package depends on libusb.  Get libusb from sourceforge at:   http://www.sourceforge.net/projects/libusb/On Linux, please use the very latest version you can get, between0.1.8 and 0.1.12 a lot of things happened which pertains tothe udev hotplugging support, see below.BASIC BUILD PROCEDURE=====================To build the package:   % ./configure   % make   % make installBy default, libmtp will add the program-prefix "mtp-" to all theexample programs prior to installation. The program-prefix optionmakes libmtp sample programs avoid collision with other programs likesox' "play" program. On Linux you should then typically type (seebelow for details):   % ./hotplug.shyou can achieve the same with   % ./configure --enable-hotpluggingyou can turn off some speed enhancements (for testing) with:   % ./configure --no-turboif you want to install the documentation type:   % make install-docsif you checked out the sources from CVS, you must first run theautogen.sh script that generates all the GNU autotools files.Notice that this requires GNU autoconf, automake and libtool. Thisis done with:   % ./autogen.shLinux hotplugging-----------------After compilation and installation you may (and should) add hotpluggingsupport by running the hotplug script, if your distribution supportshotplugging (all do). This typically means you have somethingin /etc/hotplug and that hotplugging is started when you boot yourmachine in a script named /etc/init.d/hotplug or similar.Activate hotplugging by running:   %./hotplug.shHotplug will (typically) use the device map file installed by hotplug.shat /etc/hotplug/usb/libmtp.usermap to lift the device to userspace for thecurrent user by running the script /etc/hotplug/usb/libmtp.sh. Ifyou have the program "resmgr" installed (currently used only by SuSE toour knowledge) that program will be used for enabling desktop useraccess, otherwise the current user of the desktop will be determinedfrom files in /var/run. (See the script "libmtp.sh" for details.)Linux udev hotplugging----------------------Newer Linux distributions have dropped support for the old hotplug systemand rely solely on udev, and rules stored below /etc/udev/rules.d tohandle permissions and actions on device connections. It's quite solidbut the whole thing is rather shaky when it comes to such things ascustom devices handled solely by libusb, which is what libmtp and forexample SANE backends use.The libmtp.rules file that comes with libmtp can be used as a starter.First you need a crazy rule that creates a device node in the/dev/bus/usb hierarchy whenever any USB device is connected. Thescript has this at the top, you can comment it in if yourdistribution does not already create these device nodes.Then libusb may need to be patched to recognize this hierarchy. The 0.1.12 version is the first which is properly fixed.The script sets the device access to "666" which is rather nasty(not that big security issue, unless you think someone will breakinto your jukebox) some systems prefer to let PAM do this by placinga configuration file in /etc/security/ somewhere. See the Fedora ExtrasSRPM source package in case you're interested in how it is handledthere.If you cannot run hotplugging-----------------------------If you have a distro without hotplugging enabled try this as root:  % chmod -R a+w /proc/bus/usbYou have to do this again every time you unplug/replug your USB cableor restart the jukebox, every time you quit libnjb and restart it,etc etc etc an alternative is to run libmtp as root which works just fine.The problem is to somehow assure that you (ie the current user) alwayshas write access on  /proc/bus/usb/*You can find the Linux hotplug project at:http://linux-hotplug.sourceforge.net/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -