1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils toolchain-funcs user
8 DESCRIPTION="IRC bot to share files via DCC"
9 HOMEPAGE="http://iroffer.dinoex.de/projects/iroffer"
10 SRC_URI="http://iroffer.dinoex.net/${P}.tar.gz
11 http://iroffer.dinoex.net/HISTORY/${P}.tar.gz"
18 DINOEX_DEFAULT_MODULES="+admin +blowfish +chroot +http +memsave +ssl +telnet"
19 DINOEX_OPTIONAL_MODULES="curl debug geoip gnutls ruby static upnp"
20 DINOEX_LANGUAGES="de en fr it"
22 IUSE="${DINOEX_DEFAULT_MODULES} ${DINOEX_OPTIONAL_MODULES} daemon"
23 for lang in ${DINOEX_LANGUAGES}
25 IUSE="${IUSE} linguas_${lang}"
31 # Handle in src_configure: gnutls? ( !ssl )
34 chroot? ( dev-libs/nss )
35 curl? ( net-misc/curl )
36 geoip? ( dev-libs/geoip )
37 gnutls? ( net-libs/gnutls )
38 ruby? ( dev-lang/ruby )
39 ssl? ( dev-libs/openssl )
48 # Create user if USE="+daemon"
51 enewuser ${PN} -1 -1 -1 ${PN}
56 epatch "${FILESDIR}/${P}-Makefile.patch"
57 epatch "${FILESDIR}/${PN}-config.patch"
63 # Remove unselected default modules
64 for opts in ${DINOEX_DEFAULT_MODULES}
66 opts=${opts:1} # Remove "+"
69 if [[ $opts != "ssl" ]] ; then
70 my_conf="${my_conf} -no-$opts"
72 my_conf="${my_conf} -no-openssl"
77 # Add selected optional modules
78 for opts in ${DINOEX_OPTIONAL_MODULES}
83 # Conflicting USE ssl and gnutls, priority to gnutls
84 my_conf="${my_conf} -no-openssl -tls";;
86 my_conf="${my_conf} -no-libs";;
88 my_conf="${my_conf} -$opts";;
93 # Iroffer uses an unusual configuration file. Need PREFIX (install by default in /usr/local, forbidden in portage)
94 ./Configure CC=$(tc-getCC) PREFIX="/usr" ${my_conf} || die "Error during ./Configure"
98 # Iroffer need the language as first argument of Makefile
99 # Compile each available languages or just English
100 strip-linguas "${DINOEX_LANGUAGES}"
108 for lang in ${LINGUAS:-en}
110 emake DESTDIR="${D}" install-${lang}
113 dodoc help-admin-${lang}.txt
116 dodoc beispiel.config LIESMICH.modDinoex;;
118 dodoc exemple.config;;
120 dodoc sample.config;;
125 dodoc README README.modDinoex dynip.sh iroffer.cron
126 newdoc "${FILESDIR}/${PN}-HOWTO" HOWTO
129 # Specific stuff for "+daemon"
132 insopts -m0660 -o root -g ${PN}
134 for lang in ${LINGUAS:-en}
138 doins beispiel.config;;
140 doins exemple.config;;
142 doins sample.config;;
146 insinto /etc/logrotate.d
147 insopts -m0644 -o root -g root
148 newins "${FILESDIR}/${PN}.logrotate" ${PN}
150 newinitd "${FILESDIR}/${PN}.init" ${PN}
151 newconfd "${FILESDIR}/${PN}.conf" ${PN}
156 elog "Quick start: \"HOWTO\" in \"/usr/share/doc/${PF}\""
160 ewarn "If you upgrade ${PN}, you can restart all ${PN}'s daemons with:"
161 ewarn " find /etc/init.d/ -name ${PN}.* -execdir {} restart \;"
162 ewarn "This command will disconnect all users!"