netatalk-3.1.8.ebuild 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. PYTHON_COMPAT=( python2_7 )
  5. AUTOTOOLS_AUTORECONF=yes
  6. inherit autotools-utils flag-o-matic multilib pam python-r1 systemd versionator
  7. DESCRIPTION="Open Source AFP server"
  8. HOMEPAGE="http://netatalk.sourceforge.net/"
  9. SRC_URI="mirror://sourceforge/project/${PN}/${PN}/$(get_version_component_range 1-3)/${P}.tar.bz2"
  10. LICENSE="GPL-2 BSD"
  11. SLOT="0/17.0"
  12. KEYWORDS="amd64 arm ~ppc ~ppc64 x86 ~x86-fbsd"
  13. IUSE="acl cracklib dbus debug pgp kerberos ldap pam quota samba +shadow ssl static-libs tracker tcpd +utils zeroconf"
  14. CDEPEND="
  15. !app-editors/yudit
  16. dev-libs/libevent
  17. >=dev-libs/libgcrypt-1.2.3:0
  18. sys-apps/coreutils
  19. >=sys-libs/db-4.2.52:=
  20. sys-libs/tdb
  21. acl? (
  22. sys-apps/attr
  23. sys-apps/acl
  24. )
  25. cracklib? ( sys-libs/cracklib )
  26. dbus? ( sys-apps/dbus dev-libs/dbus-glib )
  27. kerberos? ( virtual/krb5 )
  28. ldap? ( net-nds/openldap )
  29. pam? ( virtual/pam )
  30. ssl? ( dev-libs/openssl:0 )
  31. tcpd? ( sys-apps/tcp-wrappers )
  32. tracker? ( app-misc/tracker )
  33. utils? ( ${PYTHON_DEPS} )
  34. zeroconf? ( net-dns/avahi[dbus] )
  35. "
  36. RDEPEND="${CDEPEND}
  37. utils? (
  38. dev-lang/perl
  39. dev-python/dbus-python[${PYTHON_USEDEP}]
  40. )"
  41. DEPEND="${CDEPEND}
  42. virtual/yacc
  43. sys-devel/flex"
  44. RESTRICT="test"
  45. REQUIRED_USE="
  46. ldap? ( acl )
  47. utils? ( ${PYTHON_REQUIRED_USE} )"
  48. PATCHES=(
  49. "${FILESDIR}"/${PN}-3.1.7-gentoo.patch
  50. "${FILESDIR}"/${PN}-3.1.8-disable-ld-library-path.patch #564350
  51. )
  52. src_prepare() {
  53. if ! use utils; then
  54. sed \
  55. -e "s:shell_utils::g" \
  56. -i contrib/Makefile.am || die
  57. fi
  58. autotools-utils_src_prepare
  59. }
  60. src_configure() {
  61. local myeconfargs=()
  62. append-flags -fno-strict-aliasing
  63. # Ignore --with-init-style=gentoo, we install the init.d by hand and we avoid having
  64. # to sed the Makefiles to not do rc-update.
  65. # TODO:
  66. # systemd : --with-init-style=systemd
  67. myeconfargs+=(
  68. $(use_enable debug)
  69. $(use_enable debug debugging)
  70. $(use_enable pgp pgp-uam)
  71. $(use_enable kerberos)
  72. $(use_enable kerberos krbV-uam)
  73. $(use_enable quota)
  74. $(use_enable tcpd tcp-wrappers)
  75. $(use_enable zeroconf)
  76. $(use_with acl acls)
  77. $(use_with cracklib)
  78. $(use_with dbus afpstats)
  79. $(use_with ldap)
  80. $(use_with pam)
  81. $(use_with samba smbsharemodes)
  82. $(use_with shadow)
  83. $(use_with ssl ssl-dir)
  84. $(use_with tracker)
  85. $(use_with tracker tracker-pkgconfig-version $(get_version_component_range 1-2 $(best_version app-misc/tracker | sed 's:app-misc/tracker-::g')))
  86. --enable-overwrite
  87. --disable-krb4-uam
  88. --disable-afs
  89. --with-libevent-header=/usr/include
  90. --with-libevent-lib=/usr/$(get_libdir)
  91. --with-bdb=/usr
  92. --with-uams-path=/usr/$(get_libdir)/${PN}
  93. --disable-silent-rules
  94. --with-init-style=gentoo
  95. --without-libevent
  96. --without-tdb
  97. --with-lockfile=/run/lock/${PN}
  98. )
  99. autotools-utils_src_configure
  100. }
  101. src_install() {
  102. autotools-utils_src_install
  103. if use zeroconf; then
  104. sed -i -e '/avahi-daemon/s:use:need:g' "${D}"/etc/init.d/${PN} || die
  105. else
  106. sed -i -e '/avahi-daemon/d' "${D}"/etc/init.d/${PN} || die
  107. fi
  108. # The pamd file isn't what we need, use pamd_mimic_system
  109. rm -rf "${ED}/etc/pam.d" || die
  110. pamd_mimic_system netatalk auth account password session
  111. sed \
  112. -e "s|:SBINDIR:|${EPREFIX}/usr/sbin|g" \
  113. -e "s|:PATH_NETATALK_LOCK:|/run/lock/netatalk|g" \
  114. distrib/initscripts/service.systemd.tmpl \
  115. > "${T}"/service.systemd || die
  116. systemd_newunit "${T}"/service.systemd ${PN}.service
  117. use utils && python_foreach_impl python_doscript contrib/shell_utils/afpstats
  118. }
  119. pkg_postinst() {
  120. local fle v
  121. for v in ${REPLACING_VERSIONS}; do
  122. if ! version_is_at_least 3 ${v}; then
  123. for fle in afp_signature.conf afp_voluuid.conf; do
  124. if [[ -f "${ROOT}"etc/netatalk/${fle} ]]; then
  125. if [[ ! -f "${ROOT}"var/lib/netatalk/${fle} ]]; then
  126. mv \
  127. "${ROOT}"etc/netatalk/${fle} \
  128. "${ROOT}"var/lib/netatalk/
  129. fi
  130. fi
  131. done
  132. echo ""
  133. elog "Starting from version 3.0 only uses a single init script again"
  134. elog "Please update your runlevels accordingly"
  135. echo ""
  136. elog "Dependencies should be resolved automatically depending on settings"
  137. elog "but please report issues with this on https://bugs.gentoo.org/ if"
  138. elog "you find any."
  139. echo ""
  140. elog "Following config files are obsolete now:"
  141. elog "afpd.conf, netatalk.conf, AppleVolumes.default and afp_ldap.conf"
  142. elog "in favour of"
  143. elog "/etc/afp.conf"
  144. echo ""
  145. elog "Please convert your existing configs before you restart your daemon"
  146. echo ""
  147. elog "The new AppleDouble default backend is appledouble = ea"
  148. elog "Existing entries will be updated on access, but can do an offline"
  149. elog "conversion with"
  150. elog "dbd -ruve /path/to/Volume"
  151. echo ""
  152. elog "For general notes on the upgrade, please visit"
  153. elog "http://netatalk.sourceforge.net/3.0/htmldocs/upgrade.html"
  154. echo ""
  155. break
  156. fi
  157. done
  158. }