diff options
author | Sébastien Picavet (SebastienP) <sebastien.picavet@gmail.com> | 2012-07-14 18:59:31 +0200 |
---|---|---|
committer | Sébastien Picavet (SebastienP) <sebastien.picavet@gmail.com> | 2012-07-14 18:59:31 +0200 |
commit | 07413c244b766c208a3db762438af2dd694542d5 (patch) | |
tree | bf0b43729cef1f8e72b7aa49b240c7c9af817c80 | |
parent | net-nntp/sabnzbd: Remove a bashism, thanks to floppym (diff) | |
download | sunrise-07413c244b766c208a3db762438af2dd694542d5.tar.gz sunrise-07413c244b766c208a3db762438af2dd694542d5.tar.bz2 sunrise-07413c244b766c208a3db762438af2dd694542d5.zip |
net-irc/iroffer-dinoex: New ebuild for bug #426616 thanks to floppym and many others
-rw-r--r-- | net-irc/iroffer-dinoex/ChangeLog | 14 | ||||
-rw-r--r-- | net-irc/iroffer-dinoex/Manifest | 11 | ||||
-rw-r--r-- | net-irc/iroffer-dinoex/files/iroffer-dinoex-3.27-Makefile.patch | 126 | ||||
-rw-r--r-- | net-irc/iroffer-dinoex/files/iroffer-dinoex-3.27-exit-status-background.patch | 20 | ||||
-rw-r--r-- | net-irc/iroffer-dinoex/files/iroffer-dinoex-HOWTO | 34 | ||||
-rw-r--r-- | net-irc/iroffer-dinoex/files/iroffer-dinoex-config.patch | 130 | ||||
-rw-r--r-- | net-irc/iroffer-dinoex/files/iroffer-dinoex.conf | 21 | ||||
-rw-r--r-- | net-irc/iroffer-dinoex/files/iroffer-dinoex.init | 77 | ||||
-rw-r--r-- | net-irc/iroffer-dinoex/files/iroffer-dinoex.logrotate | 8 | ||||
-rw-r--r-- | net-irc/iroffer-dinoex/iroffer-dinoex-3.27.ebuild | 174 | ||||
-rw-r--r-- | net-irc/iroffer-dinoex/metadata.xml | 26 |
11 files changed, 641 insertions, 0 deletions
diff --git a/net-irc/iroffer-dinoex/ChangeLog b/net-irc/iroffer-dinoex/ChangeLog new file mode 100644 index 000000000..bd6411d95 --- /dev/null +++ b/net-irc/iroffer-dinoex/ChangeLog @@ -0,0 +1,14 @@ +# ChangeLog for net-irc/iroffer-dinoex +# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 +# $Header: $ + +*iroffer-dinoex-3.27 (14 Jul 2012) + + 14 Jul 2012; Sébastien Picavet (SebastienP) sebastien.picavet@gmail.com + +iroffer-dinoex-3.27.ebuild, +files/iroffer-dinoex-3.27-Makefile.patch, + +files/iroffer-dinoex-3.27-exit-status-background.patch, + +files/iroffer-dinoex.conf, +files/iroffer-dinoex.init, + +files/iroffer-dinoex.logrotate, +files/iroffer-dinoex-HOWTO, + +files/iroffer-dinoex-config.patch, +metadata.xml: + New ebuild for bug #426616 thanks to floppym and many others + diff --git a/net-irc/iroffer-dinoex/Manifest b/net-irc/iroffer-dinoex/Manifest new file mode 100644 index 000000000..aa7776b83 --- /dev/null +++ b/net-irc/iroffer-dinoex/Manifest @@ -0,0 +1,11 @@ +AUX iroffer-dinoex-3.27-Makefile.patch 4084 RMD160 f02b8f77d90a2eae491ccb7934195ef2c735f2fd SHA1 f829a935864e7ee862db989d4abf93552e2c600a SHA256 069c61bf26a4646d9c671acc56a83cb7d630c0f77f9438ce74321b42ca2d3e09 +AUX iroffer-dinoex-3.27-exit-status-background.patch 565 RMD160 14ef7693b854bca60e1d24ba864312deb202de9c SHA1 2b3cef792e8988b4ce48d97d5d8846be9839f715 SHA256 f4f6aec5f8fdf1a20c7ffc48c99ec9f0186361f7bf653018569c4a564f6c9938 +AUX iroffer-dinoex-HOWTO 1282 RMD160 eb2d509240c0673d813fe0b1cd8d48ebd64369ae SHA1 b369d4425495e2549a8c66123690bf426d4e49a5 SHA256 46cf016182320ce34d07737bddfc1f81541c86a93877dba76ac623893e541df2 +AUX iroffer-dinoex-config.patch 7000 RMD160 93d095f699a137cb6dd1b060c0dee451950bc4f3 SHA1 b119ee4af0fe4501a1f4e26810a3a9ae6641d477 SHA256 d82a1377202b942d048fa59026b54872a7156a31f9e6d9035516953d4aae8774 +AUX iroffer-dinoex.conf 611 RMD160 333654d634675a44a97a27f653df757b567a2243 SHA1 d91616ad3c377a600329e4e1cb765081bd0a354e SHA256 b370ac40d62672090764066c6761f5b5c7751602a93dde5f619aede2062380b1 +AUX iroffer-dinoex.init 2060 RMD160 5b8518564516c154882c851a6bc14e4d6cfe4a1d SHA1 448afccbe1daabec46d5f085a681ba477ee2d4bf SHA256 491c11369fa800822d9f378a40fa17b62ce833185f186877476369b4a6cb44c4 +AUX iroffer-dinoex.logrotate 198 RMD160 cd162111cc245f468d9a6dd3a450a2f4595b9644 SHA1 638acf9e3063d7580b01f0c5f145ded6af955325 SHA256 09034c8ae2b2a86770534e825279d10cf81371a2b985a74373932cbdf78985d9 +DIST iroffer-dinoex-3.27.tar.gz 497569 RMD160 e373945fb6301702d2368c0fda8a6caeeeb59fc5 SHA1 c0ab1e3e1c84c83775d8ac71bb02c3aa6a93cdad SHA256 496f5dd71f23f2f20c0c6c80b48889e4859c14178de9fc06245425a43cd6983b +EBUILD iroffer-dinoex-3.27.ebuild 4255 RMD160 4452373ffab23666cdb6e8a5c28776d945b26b00 SHA1 ae86a0ebfdeffdd3cfe3211a9947990962c451fc SHA256 cb9d1b417d627919b5abf7c3dfd99cb0d0e387e886209ad6ed162841c530d7af +MISC ChangeLog 606 RMD160 396d955ad2d035744696b3a5315b5603c8fb0663 SHA1 cced0d2635920485d2f69d02a653a3a428bf0a44 SHA256 afca669abf6f7f7ffcb418edb611d5892bca54744ed11f6ea7bfd7005dd12bd9 +MISC metadata.xml 1207 RMD160 b8decda667a8da116dbd75b7aa03c3fe9bcac51d SHA1 c62dcb492a138a78f434fdb34a5138e37d0a2ff8 SHA256 a6de4be1d4cfcca74529431c5de205ad80cc179ef2fe5bd9b0ecc69e75e38618 diff --git a/net-irc/iroffer-dinoex/files/iroffer-dinoex-3.27-Makefile.patch b/net-irc/iroffer-dinoex/files/iroffer-dinoex-3.27-Makefile.patch new file mode 100644 index 000000000..108096cd6 --- /dev/null +++ b/net-irc/iroffer-dinoex/files/iroffer-dinoex-3.27-Makefile.patch @@ -0,0 +1,126 @@ +--- Configure 2012-04-28 16:47:50.589162001 +0200 ++++ Configure.NEW 2012-06-04 19:44:28.757397001 +0200 +@@ -43,6 +43,7 @@ + -upnp Compiler avec le support UPNP avec miniupnpc (pour les Routeurs NAT) + -ruby Compiler avec le support du script RUBY + -no-blowfish Compiler sans encodage blowfish ++ -no-chroot Compiler sans support chroot + -no-openssl Compiler sans OpenSSL lib + -no-http Compiler sans HTTP server + -no-admin Compiler sans HTTP Admin +@@ -71,6 +72,7 @@ + -upnp Benutze miniupnpc Bibliothek (fr UPNP-NAT Routers) + -ruby Benutze RUBY Skript Erweiterung + -no-blowfish Baue ohne Blowfish Verschlusselung ++ -no-chroot Baue ohne chroot + -no-openssl Baue ohne OpenSSL Bibliothek + -no-http Baue ohne HTTP Server + -no-admin Baue ohne HTTP Admin +@@ -99,6 +101,7 @@ + -upnp Compile with UPNP support with miniupnpc (for NAT Routers) + -ruby Compile with RUBY scripting support + -no-blowfish Compile without blowfish encryption ++ -no-chroot Compile without chroot support + -no-openssl Compile without OpenSSL lib + -no-http Compile without HTTP server + -no-admin Compile without HTTP Admin +@@ -455,6 +458,7 @@ + OPT_RUBY=false + OPT_NOADMIN=false + OPT_NOBLOWFISH=false ++OPT_NOCHROOT=false + OPT_NOHTTP=false + OPT_NOTELNET=false + OPT_NOMEMSAVE=false +@@ -490,6 +494,7 @@ + -r*) OPT_RUBY=true;; + -no-a*) OPT_NOADMIN=true ;; + -no-b*) OPT_NOBLOWFISH=true ;; ++ -no-c*) OPT_NOCHROOT=true ;; + -no-h*) OPT_NOHTTP=true ;; + -no-t*) OPT_NOTELNET=true ;; + -no-o*) OPT_SSL=false ;; +@@ -634,8 +639,6 @@ + " + ;; + esac +-else +-DEBUG="-O2" + fi + + if $OPT_WARN; then +@@ -747,31 +750,36 @@ + ${msg} "${irt_start} UPNP ${irt_with} lminiupnpc." + fi + +-if $OPT_NOHTTP; then +- ${msg} "${irt_configure} ${irt_without} HTTP Server." +- echo "#define WITHOUT_HTTP" >> src/iroffer_config.h +-fi +- + if $OPT_NOADMIN; then + ${msg} "${irt_configure} ${irt_without} HTTP Admin." + echo "#define WITHOUT_HTTP_ADMIN" >> src/iroffer_config.h + fi + +-if $OPT_NOTELNET; then +- ${msg} "${irt_configure} ${irt_without} Telnet Server." +- echo "#define WITHOUT_TELNET" >> src/iroffer_config.h +-fi +- + if $OPT_NOBLOWFISH; then + ${msg} "${irt_configure} ${irt_without} ${irt_blowfish}." + echo "#define WITHOUT_BLOWFISH" >> src/iroffer_config.h + fi + ++if $OPT_NOCHROOT; then ++ ${msg} "${irt_configure} ${irt_without} ${irt_nochroot}." ++ echo "#define NO_CHROOT" >> src/iroffer_config.h ++fi ++ ++if $OPT_NOHTTP; then ++ ${msg} "${irt_configure} ${irt_without} HTTP Server." ++ echo "#define WITHOUT_HTTP" >> src/iroffer_config.h ++fi ++ + if $OPT_NOMEMSAVE; then + ${msg} "${irt_configure} ${irt_without} ${irt_memory}." + echo "#define WITHOUT_MEMSAVE" >> src/iroffer_config.h + fi + ++if $OPT_NOTELNET; then ++ ${msg} "${irt_configure} ${irt_without} Telnet Server." ++ echo "#define WITHOUT_TELNET" >> src/iroffer_config.h ++fi ++ + ${msg} -n "${irt_checkfor} make... " + makebin="`type make | awk '{print $NF}'`" + gmakebin="`type gmake | awk '{print $NF}'`" +@@ -1296,18 +1304,6 @@ + echo "#define NO_CRYPT" >> src/iroffer_config.h + fi + +- +-${msg} -n "${irt_checkfor} chroot()... " +-echo "${irmain1} +- chroot(\".\"); +-${main2}" > config.temp.c +-if $cctype -o config.temp $WARNS $WERROR $CFLAGS config.temp.c $LDFLAGS $libs $LIBS; then +-${msg} "${irt_found}" +-else +-echo "#define NO_CHROOT" >> src/iroffer_config.h +-${msg} "${irt_msssing1}, ${irt_nochroot}." +-fi +- + ${msg} -n "${irt_seeingif_lib} NSS ${irt_lib_exists} (${irt_for} chroot)... " + echo "${irmain0}" > config.temp.c + if $cctype -o config.temp $WARNS $WERROR $CFLAGS config.temp.c $LDFLAGS -lnss_files -lnss_dns $libs $LIBS; then +@@ -1881,7 +1877,7 @@ + groff -t -e -mandoc -Tps iroffer.1 > doc/iroffer.1.ps + + install: all +- install -o root -g $(INSTALL_GROUP) -m 0755 $(IRNAME)$(CONFIG_EXE) $(DESTDIR)$(INSDIR)/$(IRNAME)$(CONFIG_EXE) ++ install -D -o root -g $(INSTALL_GROUP) -m 0755 $(IRNAME)$(CONFIG_EXE) $(DESTDIR)$(INSDIR)/$(IRNAME)$(CONFIG_EXE) + + installuser: all + install -m 0755 $(IRNAME)$(CONFIG_EXE) $(DESTDIR)$(INSDIR)/$(IRNAME)$(CONFIG_EXE) diff --git a/net-irc/iroffer-dinoex/files/iroffer-dinoex-3.27-exit-status-background.patch b/net-irc/iroffer-dinoex/files/iroffer-dinoex-3.27-exit-status-background.patch new file mode 100644 index 000000000..4e250d130 --- /dev/null +++ b/net-irc/iroffer-dinoex/files/iroffer-dinoex-3.27-exit-status-background.patch @@ -0,0 +1,20 @@ +--- src/iroffer_misc.c 2011-09-04 08:50:18.000000000 +0200 ++++ src/iroffer_misc.c.NEW 2012-05-03 18:05:27.163446001 +0200 +@@ -726,7 +726,7 @@ + outerror(OUTERROR_TYPE_CRASH, "Unable to Fork: %s", strerror(errno)); + else if (s > 0) { + /* parent exits */ +- exit(69); ++ exit(0); + } + + /* struct rlimit r = { 0 }; */ +@@ -748,7 +748,7 @@ + outerror(OUTERROR_TYPE_CRASH, "Unable to Fork: %s", strerror(errno)); + else if (s > 0) + /* parent exits */ +- exit(69); ++ exit(0); + + + /* background continues... */ diff --git a/net-irc/iroffer-dinoex/files/iroffer-dinoex-HOWTO b/net-irc/iroffer-dinoex/files/iroffer-dinoex-HOWTO new file mode 100644 index 000000000..518626f81 --- /dev/null +++ b/net-irc/iroffer-dinoex/files/iroffer-dinoex-HOWTO @@ -0,0 +1,34 @@ +-------------- +Configuration: +-------------- +Samples of configuration files are in "/usr/share/doc/iroffer-dinoex-*" + +-------------- +Simple launch: +-------------- +iroffer <MyBot.config> +Or i18n version: iroffer-{de,fr,it} <MyBot.config> + +------------------------------- +Remote administration (by IRC): +------------------------------- +If you want to administrate iroffer-dinoex on IRC, you have to generate an encrypt password: + launch "iroffer -c" (or translated versions "iroffer-{de,fr,it}") + change the variable "adminpass" of your file "*.config" with the given hash + specify the allowed hosts with "adminhost" + +You can find administration commands on "help-admin-*.txt" in "/usr/share/doc/iroffer-dinoex-*" + +----------------- +Launch as daemon: +----------------- +To create a new daemon, you have to: + copy sample configuration file from "/etc/iroffer-dinoex/": cp -p /etc/iroffer-dinoex/******.config /etc/iroffer-dinoex/YourBot.config + adapt "YourBot.config" (take care of variables "pid", "logfile" and "statefile"; "mybot" become "YourBot") + create a symbolic link: ln -s /etc/init.d/iroffer-dinoex /etc/init.d/iroffer-dinoex.YourBot + rc-update add iroffer-dinoex.YourBot default + +------------ +Advance use: +------------ +See "/usr/share/doc/iroffer-dinoex-*" and "man iroffer"
\ No newline at end of file diff --git a/net-irc/iroffer-dinoex/files/iroffer-dinoex-config.patch b/net-irc/iroffer-dinoex/files/iroffer-dinoex-config.patch new file mode 100644 index 000000000..0c630d060 --- /dev/null +++ b/net-irc/iroffer-dinoex/files/iroffer-dinoex-config.patch @@ -0,0 +1,130 @@ +diff -ru iroffer-dinoex-3.27/beispiel.config iroffer-dinoex-3.27.NEW/beispiel.config +--- iroffer-dinoex-3.27/beispiel.config 2011-07-17 21:10:21.000000000 +0200 ++++ iroffer-dinoex-3.27.NEW/beispiel.config 2012-05-01 19:30:10.378116001 +0200 +@@ -15,19 +15,19 @@ + ############################################################################## + ### - pid file - ### + ### Schreibt die Prozess-ID beim Start in diese Datei ### +-pidfile mybot.pid ++pidfile /var/run/iroffer-dinoex/mybot.pid + + ############################################################################## + ### - log file - ### + ### logfile gibt die Logdatei fr den Bot an. ### +-logfile mybot.log ++logfile /var/log/iroffer-dinoex/mybot.log + + ############################################################################## + ### - log rotate - ### + ### logrotate gibt den Zeitraum vor, nach dem die Logdatei gewechselt ### + ### wird, mgliche Werte "none" (nie), "monthly" (monatlich), ### + ### "weekly" (wchentlich), "daily" (tglich) und 1-24 (stndlich). ### +-logrotate weekly ++#logrotate weekly + + ############################################################################## + ### - expire logfiles - ### +@@ -48,7 +48,7 @@ + ### Diese Datei dient als allgemeines Datenlager fr die bereitgestellten ### + ### Dateien und die dazugehrigen statistische Daten. Hier werden auch die ### + ### Beschreibungen der Pakete gespeichert. ### +-statefile mybot.state ++statefile /var/lib/iroffer-dinoex/mybot.state + + ############################################################################## + ### - old state file - ### +@@ -74,7 +74,7 @@ + ### als Packliste auf einer Webseite zu dienen, oder fr andere Zwecke. ### + ### Wenn xdcclistfileraw gesetzt ist, werden die IRC-Farbcode auch mit ### + ### ausgegeben. ### +-xdcclistfile mybot.txt ++xdcclistfile /var/lib/iroffer-dinoex/mybot.txt + #xdcclistfileraw + + ############################################################################## +diff -ru iroffer-dinoex-3.27/exemple.config iroffer-dinoex-3.27.NEW/exemple.config +--- iroffer-dinoex-3.27/exemple.config 2011-09-04 08:45:41.000000000 +0200 ++++ iroffer-dinoex-3.27.NEW/exemple.config 2012-05-01 19:29:03.954116001 +0200 +@@ -15,18 +15,18 @@ + ############################################################################## + ### - pid file - ### + ### Ecrit l'id du processus dans ce fichier au lancement ### +-pidfile monbot.pid ++pidfile /var/run/iroffer-dinoex/monbot.pid + + ############################################################################## + ### - log file - ### + ### crit les informations du bot dans ce fichier. ### +-logfile monbot.log ++logfile /var/log/iroffer-dinoex/monbot.log + + ############################################################################## + ### - log rotate - ### + ### Archivage du fichier de log jamais (none), 1-24 h quotidien (daily), ### + ### hebdomadaire (weekly) ou mensuelle (monthly). ### +-logrotate weekly ++#logrotate weekly + + ############################################################################## + ### - expire logfiles - ### +@@ -44,7 +44,7 @@ + ############################################################################## + ### - state file - ### + ### fichier temporaire de stockage des informations d'tat d'iroffer. ### +-statefile monbot.state ++statefile /var/lib/iroffer-dinoex/monbot.state + + ############################################################################## + ### - old state file - ### +@@ -70,7 +70,7 @@ + ### 'xdcclistfile' et iroffer crira la liste xdcc ds que ncessaire. ### + ### Si xdcclistfileraw est dfinit, le fichier sera crit avec les ### + ### caractres spciaux IRC (couleur, format, etc...). ### +-xdcclistfile monbot.txt ++xdcclistfile /var/lib/iroffer-dinoex/monbot.txt + #xdcclistfileraw + + ############################################################################## +diff -ru iroffer-dinoex-3.27/sample.config iroffer-dinoex-3.27.NEW/sample.config +--- iroffer-dinoex-3.27/sample.config 2011-07-17 21:10:21.000000000 +0200 ++++ iroffer-dinoex-3.27.NEW/sample.config 2012-05-01 19:31:11.682116001 +0200 +@@ -15,18 +15,18 @@ + ############################################################################## + ### - pid file - ### + ### Writes the process id to this file on startup ### +-pidfile mybot.pid ++pidfile /var/run/iroffer-dinoex/mybot.pid + + ############################################################################## + ### - log file - ### + ### Writes logging information to this file. ### +-logfile mybot.log ++logfile /var/log/iroffer-dinoex/mybot.log + + ############################################################################## + ### - log rotate - ### + ### After the time given here a logfile will be rotated. ### + ### logrotate can be set to none, 1 - 24 hours, daily, weekly or monthly ### +-logrotate weekly ++#logrotate weekly + + ############################################################################## + ### - expire logfiles - ### +@@ -44,7 +44,7 @@ + ############################################################################## + ### - state file - ### + ### temporary storage for iroffer state information across restarts ### +-statefile mybot.state ++statefile /var/lib/iroffer-dinoex/mybot.state + + ############################################################################## + ### - old state file - ### +@@ -71,7 +71,7 @@ + ### needed. ### + ### If xdcclistfileraw is set the file will be written with the IRC ### + ### control characters included (color, formatting, etc..). ### +-xdcclistfile mybot.txt ++xdcclistfile /var/lib/iroffer-dinoex/mybot.txt + #xdcclistfileraw + + ############################################################################## diff --git a/net-irc/iroffer-dinoex/files/iroffer-dinoex.conf b/net-irc/iroffer-dinoex/files/iroffer-dinoex.conf new file mode 100644 index 000000000..210d1ed30 --- /dev/null +++ b/net-irc/iroffer-dinoex/files/iroffer-dinoex.conf @@ -0,0 +1,21 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +# /etc/conf.d/iroffer-dinoex +# Config file for iroffer-dinoex init script + +# Binary file. You can change "iroffer" by "iroffer-de", "iroffer-fr" or "iroffer-it" (depends on $LINGUAS) +IROFFER_BIN="/usr/bin/iroffer" + +# User used by the deamon +IROFFER_USER="iroffer-dinoex" + +# Default directory of PID files +IROFFER_PID="/var/run/iroffer-dinoex" + +# Default directory of log files +IROFFER_LOG="/var/log/iroffer-dinoex" + +# Default directory of state files +IROFFER_STATE="/var/lib/iroffer-dinoex"
\ No newline at end of file diff --git a/net-irc/iroffer-dinoex/files/iroffer-dinoex.init b/net-irc/iroffer-dinoex/files/iroffer-dinoex.init new file mode 100644 index 000000000..caa861324 --- /dev/null +++ b/net-irc/iroffer-dinoex/files/iroffer-dinoex.init @@ -0,0 +1,77 @@ +#!/sbin/runscript +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +extra_commands="reload reconnect" + +description="Script to use iroffer-dinoex like a daemon. You have to make a symbolic link of this script: ln -s /etc/init.d/iroffer-dinoex /etc/init.d/iroffer-dinoex.MyBot. Create a config file: cp -p /etc/iroffer-dinoex/******.config /etc/iroffer-dinoex/MyBot.config and adapt it (take care of first variables \"pidfile\", \"logfile\", \"statefile\" and \"xdcclistfile\")." +description_reload="Reload the config file" +description_reconnect="Force reconnection to an IRC server" + +# Bot name from filename +BOT=${RC_SVCNAME#*.} + +depend(){ + need net +} + +start(){ + ebegin "Starting $RC_SVCNAME" + + # Control mandatory folders or files + if [ ! -f "/etc/iroffer-dinoex/${BOT}.config" ] + then + eerror "/etc/iroffer-dinoex/${BOT}.config not found" + fi + + if [ ! -d "${IROFFER_PID}" ] + then + einfo "Create ${IROFFER_PID}" + + mkdir "${IROFFER_PID}" + chown "root:${IROFFER_USER}" "${IROFFER_PID}" + chmod 770 "${IROFFER_PID}" + fi + + if [ ! -d "${IROFFER_LOG}" ] + then + einfo "Create ${IROFFER_LOG}" + + mkdir "${IROFFER_LOG}" + chown "root:${IROFFER_USER}" "${IROFFER_LOG}" + chmod 770 "${IROFFER_LOG}" + fi + + if [ ! -d "${IROFFER_STATE}" ] + then + einfo "Create ${IROFFER_STATE}" + + mkdir "${IROFFER_STATE}" + chown "root:${IROFFER_USER}" "${IROFFER_STATE}" + chmod 770 "${IROFFER_STATE}" + fi + + # Start iroffer-dinoex in background mode + start-stop-daemon --start --quiet --user "${IROFFER_USER}" --pidfile "${IROFFER_PID}/${BOT}.pid" --exec "${IROFFER_BIN}" -- -b "/etc/iroffer-dinoex/${BOT}.config" + + eend $? +} + +stop(){ + ebegin "Stop $RC_SVCNAME" + start-stop-daemon --stop --retry 10 --pidfile "${IROFFER_PID}/${BOT}.pid" + eend $? +} + +reload(){ + ebegin "Reload $RC_SVCNAME" + start-stop-daemon --signal SIGUSR2 --pidfile "${IROFFER_PID}/${BOT}.pid" + eend $? +} + +reconnect(){ + ebegin "Try to reconnect $RC_SVCNAME" + start-stop-daemon --signal SIGUSR1 --pidfile "${IROFFER_PID}/${BOT}.pid" + eend $? +} diff --git a/net-irc/iroffer-dinoex/files/iroffer-dinoex.logrotate b/net-irc/iroffer-dinoex/files/iroffer-dinoex.logrotate new file mode 100644 index 000000000..e39fad7d8 --- /dev/null +++ b/net-irc/iroffer-dinoex/files/iroffer-dinoex.logrotate @@ -0,0 +1,8 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +/var/log/iroffer-dinoex/*.log{ + missingok + su iroffer-dinoex iroffer-dinoex +}
\ No newline at end of file diff --git a/net-irc/iroffer-dinoex/iroffer-dinoex-3.27.ebuild b/net-irc/iroffer-dinoex/iroffer-dinoex-3.27.ebuild new file mode 100644 index 000000000..f22fc771e --- /dev/null +++ b/net-irc/iroffer-dinoex/iroffer-dinoex-3.27.ebuild @@ -0,0 +1,174 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="4" +inherit eutils user + +DESCRIPTION="IRC bot to share files via DCC" +HOMEPAGE="http://iroffer.dinoex.de/projects/iroffer" +SRC_URI="http://iroffer.dinoex.net/${P}.tar.gz + http://iroffer.dinoex.net/HISTORY/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64" + +# Generate IUSE +DINOEX_DEFAULT_MODULES="+admin +blowfish +chroot +http +memsave +ssl +telnet" +DINOEX_OPTIONAL_MODULES="curl debug geoip gnutls ruby static upnp" +DINOEX_LANGUAGES="de en fr it" + +IUSE="${DINOEX_DEFAULT_MODULES} ${DINOEX_OPTIONAL_MODULES} daemon" +for lang in ${DINOEX_LANGUAGES} +do + IUSE="${IUSE} linguas_${lang}" +done + +REQUIRED_USE=" + admin? ( http ) +" +# Handle in src_configure: gnutls? ( !ssl ) + +DEPEND=" + chroot? ( dev-libs/nss ) + curl? ( net-misc/curl ) + geoip? ( dev-libs/geoip ) + gnutls? ( net-libs/gnutls ) + ruby? ( dev-lang/ruby ) + ssl? ( dev-libs/openssl ) +" + +RDEPEND=" + ${DEPEND} + !net-irc/iroffer +" + +pkg_setup(){ + # Create user if USE="+daemon" + if use daemon ; then + enewgroup ${PN} + enewuser ${PN} -1 -1 -1 ${PN} + fi +} + +src_prepare(){ + # Patch for Makefile: + # add an option on "install" (otherwise it will install some files outside of sandbox) [ FIXME: Will be replace on next version to avoid the problem ] + # remove forced "-o2" option when "debug" is not select [ FIXME: Will be replace on next version to avoid the problem ] + # remove a chroot test (always fail due to sandbox I presume) [ FIXME: Refused by upstream because it is system specific ] + # add an option to avoid automagic with chroot (-no-chroot, enabled by default) [ FIXME: Will be upstream on next version ] + epatch "${FILESDIR}/${P}-Makefile.patch" + + # Although the launch is ok, exit status is 69 in background mode [ FIXME: Will be upstream on next version ] + epatch "${FILESDIR}/${P}-exit-status-background.patch" + + # Update defaults configuration files (usefull for "+daemon") + epatch "${FILESDIR}/${PN}-config.patch" +} + +src_configure(){ + local my_conf opts + + # Remove unselected default modules + for opts in ${DINOEX_DEFAULT_MODULES} + do + opts=${opts:1} # Remove "+" + + if ! use $opts ; then + if [[ $opts != "ssl" ]] ; then + my_conf="${my_conf} -no-$opts" + else + my_conf="${my_conf} -no-openssl" + fi + fi + done + + # Add selected optional modules + for opts in ${DINOEX_OPTIONAL_MODULES} + do + if use $opts ; then + case $opts in + "gnutls") + # Conflicting USE ssl and gnutls, priority to gnutls + my_conf="${my_conf} -no-openssl -tls";; + "static") + my_conf="${my_conf} -no-libs";; + *) + my_conf="${my_conf} -$opts";; + esac + fi + done + + # Iroffer uses a unusual configuration file. Need PREFIX (install in /usr/local, forbidden in portage) + ./Configure PREFIX="/usr" ${my_conf} || die "Error during ./Configure" +} + +src_compile(){ + # Iroffer need the language as first argument of Makefile + # Compile each available languages or just English + strip-linguas "${DINOEX_LANGUAGES}" + + emake ${LINGUAS:-en} +} + +src_install(){ + local lang + + for lang in ${LINGUAS:-en} + do + emake DESTDIR="${D}" install-${lang} + + # i18n docs + dodoc help-admin-${lang}.txt + case $lang in + "de") + dodoc beispiel.config LIESMICH.modDinoex;; + "fr") + dodoc exemple.config;; + *) + dodoc sample.config;; + esac + done + + # Common docs + dodoc LICENSE README README.modDinoex dynip.sh iroffer.cron + newdoc "${FILESDIR}/${PN}-HOWTO" HOWTO + doman iroffer.1 + + # Specific stuff for "+daemon" + if use daemon ; then + insinto /etc/${PN} + insopts -m0660 -o root -g ${PN} + + for lang in ${LINGUAS:-en} + do + case $lang in + "de") + doins beispiel.config;; + "fr") + doins exemple.config;; + *) + doins sample.config;; + esac + done + + insinto /etc/logrotate.d + insopts -m0644 -o root -g root + newins "${FILESDIR}/${PN}.logrotate" ${PN} + + newinitd "${FILESDIR}/${PN}.init" ${PN} + newconfd "${FILESDIR}/${PN}.conf" ${PN} + fi +} + +pkg_postinst(){ + elog "Quick start: \"HOWTO\" in \"/usr/share/doc/${PF}\"" + + if use daemon ; then + elog + ewarn "If you upgrade ${PN}, you can restart all ${PN}'s daemons with:" + ewarn " find /etc/init.d/ -name ${PN}.* -execdir {} restart \;" + ewarn "This command will disconnect all users!" + fi +} diff --git a/net-irc/iroffer-dinoex/metadata.xml b/net-irc/iroffer-dinoex/metadata.xml new file mode 100644 index 000000000..7bd80fbf1 --- /dev/null +++ b/net-irc/iroffer-dinoex/metadata.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<!-- <herd>net-irc</herd>--> + <maintainer> + <email>maintainer-wanted@gentoo.org</email> + </maintainer> + <longdescription>Standalone XDCC server. Extension of iroffer by dinoex</longdescription> + <use> + <flag name="admin">Add HTTP admin (need flag “http”)</flag> + <flag name="blowfish">Add blowfish encryption support (for channel)</flag> + <flag name="chroot">Add chroot support</flag> + <flag name="curl">Needed for FETCH command</flag> + <flag name="daemon">Add daemon support</flag> + <flag name="debug">Compile with debug option</flag> + <flag name="geoip">Add geoip support (country and city lookup)</flag> + <flag name="gnutls">Add SSL and TLS support with net-libs/gnutls</flag> + <flag name="http">Add HTTP server support</flag> + <flag name="memsave">Memory protection</flag> + <flag name="ruby">Add RUBY support</flag> + <flag name="ssl">Add SSL support with OpenSSL</flag> + <flag name="static">Build a static binary</flag> + <flag name="telnet">Add support for telnet administration</flag> + <flag name="upnp">Forward ports using UPnP</flag> + </use> +</pkgmetadata>
\ No newline at end of file |