Guest User

cndrvcups-capt-2.56-r1.ebuild

a guest
Jul 2nd, 2013
59
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Copyright 1999-2006 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # $Header: $
  4.  
  5. EAPI="2"
  6. inherit multilib eutils versionator
  7. MY_P=${P/_p/-}-1
  8. S=${WORKDIR}/${PN}-$(get_version_component_range 1-2)
  9. DESCRIPTION="Canon CUPS Capt driver"
  10. HOMEPAGE="http://www.canon.com/"
  11. SRC_URI="http://gdlp01.c-wss.com/gds/1/0100001301/03/${MY_P}.tar.gz"
  12. LICENSE="CANON"
  13. SLOT="0"
  14. KEYWORDS="~amd64 ~x86"
  15. IUSE="amd64"
  16.  
  17. DEPEND="=net-print/cndrvcups-common-2.56-r1
  18. >=net-print/cups-1.1.17"
  19.  
  20. dir=/usr/$(get_libdir)
  21.  
  22. QA_TEXTRELS="${dir:1}/libcaiocaptnet.so.1.0.0"
  23.  
  24. RDEPEND="${DEPEND}
  25. >=sys-apps/portage-2.1.1_pre1
  26. app-text/ghostscript-gpl
  27. amd64? (
  28. >=app-emulation/emul-linux-x86-gtklibs-2.0
  29. >=app-emulation/emul-linux-x86-baselibs-10.0-r1
  30. )
  31. !amd64? (
  32. dev-libs/popt
  33. dev-libs/libxml2
  34. )"
  35.  
  36. pkg_postinst() {
  37. einfo "To get your printer working you need to restart cupsd"
  38. einfo
  39. einfo "/etc/init.d/cupsd restart"
  40. einfo
  41. einfo "Now you can add your printer with either the webinterface or lpadmin"
  42. einfo
  43. einfo "/usr/sbin/lpadmin -p LBP3010 -m CNCUPSLBP3050CAPTK.ppd -v ccp://localhost:59687 –E"
  44. einfo
  45. einfo "Replace 3050 with either on of the following printers:"
  46. einfo "1120 1210 2900 3000 3050 3200 3210 3300 5000"
  47. einfo
  48. einfo "Now you must register the printer in ccpd, if connected with usb"
  49. einfo
  50. einfo "/usr/sbin/ccpdadmin -p LBP3010 -o /dev/usb/lp0"
  51. einfo
  52. einfo "Notice that you can't use LPT port with this driver."
  53. einfo "If you have a network connection to your printer use -o net:<IP OF PRINTER>"
  54. einfo "instead of -o /dev/usb/lp0"
  55. einfo "See manual for more information, guide-capt-1.3xE.tar.gz at "
  56. einfo "http://software.canon-europe.com/software/0023675.asp"
  57. einfo
  58. einfo "Now you can go ahead and start the ccpd daemon"
  59. einfo
  60. einfo "/etc/init.d/ccpd start"
  61. if use amd64; then
  62. ewarn
  63. ewarn "The file /usr/lib32/libpopt.so.0.0.0 doesn't exist in any x86 package yet"
  64. ewarn "The file comes from a Gentoo x86 machine"
  65. fi
  66. }
  67.  
  68. src_unpack() {
  69. unpack ${A}
  70. cd ${S}
  71. # Fix the cups backend path
  72. for i in backend pstocapt{,2,3}/filter; do
  73. sed -i -e 's@libdir@libexecdir@' "${i}/Makefile.am"
  74. done
  75. }
  76.  
  77. src_configure() {
  78. cd driver
  79. NOCONFIGURE=1 ./autogen.sh
  80. econf --disable-static
  81. cd ..
  82. for i in statusui backend pstocapt pstocapt{,2,3} ppd; do
  83. cd ${i}
  84. NOCONFIGURE=1 ./autogen.sh
  85. econf
  86. cd ..
  87. done
  88. }
  89.  
  90. src_compile() {
  91. for i in statusui driver backend pstocapt{,2,3} ppd; do
  92. cd ${i}
  93. emake
  94. cd ..
  95. done
  96. }
  97.  
  98. src_install() {
  99. for i in statusui driver backend pstocapt{,2,3} ppd; do
  100. cd ${i}
  101. make install DESTDIR=${D}
  102. cd ..
  103. done
  104.  
  105. if use amd64; then
  106. OABI=${ABI}
  107. ABI="x86"
  108. insinto /usr/lib32
  109. i="libpopt.so.0.0.0"
  110. [ ! -e ${FILESDIR}/${i} ] && die "You have to download libpopt.so.0.0.0 from http://bugs.gentoo.org/attachment.cgi?id=132734 and put it to ${FILESDIR} manually!"
  111. dolib.so ${FILESDIR}/${i}
  112. dosym ${i} /usr/lib32/${i%.?}
  113. dosym ${i} /usr/lib32/${i%.?.?}
  114. dosym ${i} /usr/lib32/${i%.?.?.?}
  115. ABI=${OABI}
  116. fi
  117.  
  118. # Install the libs
  119. OABI=${ABI}
  120. has_multilib_profile && ABI="x86"
  121. for i in $(cd libs; ls *.so.?.?.?; cd ..); do
  122. dolib.so libs/${i}
  123. dosym ${i} /usr/$(get_libdir)/${i%.?}
  124. dosym ${i} /usr/$(get_libdir)/${i%.?.?}
  125. dosym ${i} /usr/$(get_libdir)/${i%.?.?.?}
  126. done
  127.  
  128. # Install bin
  129. dobin libs/captdrv \
  130. libs/captfilter \
  131. libs/captemon/captmoncnab6 \
  132. libs/captemon/captmoncnab7 \
  133. libs/captemon/captmoncnab8 \
  134. libs/captemon/captmoncnab9 \
  135. libs/captemon/captmoncnaba \
  136. libs/captemon/captmoncnac5 \
  137. libs/captemon/captmoncnac6 \
  138. libs/captemon/captmoncnac8 \
  139. libs/captemon/captmoncnac9 \
  140. libs/captemon/captmonlbp3300 \
  141. libs/captemon/captmonlbp5000 \
  142. libs/captemon/captmonlbp3300 \
  143. libs/captmon/captmon \
  144. libs/captmon2/captmon2
  145.  
  146. # Install sbin
  147. if use amd64; then
  148. dosbin libs64/ccpd libs64/ccpdadmin
  149. else
  150. dosbin libs/ccpd libs/ccpdadmin
  151. fi
  152.  
  153. ABI=${OABI}
  154.  
  155. # Install the data
  156. insinto /usr/share/ccpd
  157. doins libs/ccpddata/*
  158.  
  159. insinto /usr/share/captmon
  160. doins libs/captmon/msgtable.xml
  161.  
  162. insinto /usr/share/captmon2
  163. doins libs/captmon2/msgtable2.xml
  164.  
  165. insinto /usr/share/captemon
  166. doins libs/captemon/*.xml
  167.  
  168. insinto /usr/share/caepcm
  169. doins data/CnA* libs/CnA* data/CNL*
  170.  
  171. # Install doc
  172. dodoc LICENSE* README* COPYING
  173.  
  174. for i in statusui driver backend pstocapt{,2,3} ppd; do
  175. docinto ${i}
  176. dodoc ${i}/NEWS ${i}/README ${i}/AUTHORS ${i}/ChangeLog ${i}/LICENSE*
  177. done
  178.  
  179. # fix captmon
  180. dodir /var/captmon
  181. fowners lp:lp /var/captmon
  182. keepdir /var/captmon
  183.  
  184. # Install startupscripts
  185. newinitd ${FILESDIR}/${PN}-init.d ccpd
  186.  
  187. insinto /etc
  188. doins samples/ccpd.conf
  189. }
RAW Paste Data