Support This Project

Ticket #137: wzdftpd.ebuild

File wzdftpd.ebuild, 4.2 kB (added by virdiq, 1 year ago)

wzdftpd ebuild 0.8.2 (revision 1)

Line 
1 # Copyright 1999-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit eutils flag-o-matic
6
7 SLOT="0"
8 LICENSE="GPL-2"
9 KEYWORDS="~amd64 ~x86"
10 DESCRIPTION="A portable, modular, small, and efficient FTP server"
11 SRC_URI="http://downloads.sourceforge.net/wzdftpd/${P}.tar.gz"
12 HOMEPAGE="http://www.wzdftpd.net"
13 IUSE="mysql postgres sqlite ssl ipv6 sfv zeroconf pam gnutls tcl perl utf8
14                 debug tests"
15 RESTRICT="strip"
16
17 RDEPEND="sqlite? ( dev-db/sqlite )
18                         mysql? ( virtual/mysql )
19                         postgres? ( dev-db/postgresql )
20                         ssl? ( dev-libs/openssl )
21                         gnutls? ( net-libs/gnutls )
22                         pam? ( sys-libs/pam )
23                         tcl? ( dev-lang/tcl )
24                         perl? ( dev-lang/perl )
25                         zeroconf? ( net-dns/avahi )"
26
27 DEPEND="${RDEPEND}
28                         >=dev-util/cmake-2.4.6"
29
30 pkg_setup() {
31         if use ssl && use gnutls; then
32                 eerror "You may select either OpenSSL (ssl) or GnuTLS (gnutls) USE"
33                 eerror "flags but not both at the same time. Please disable one of"
34                 eerror "these USE flags for the wzdftpd package."
35                 die "Cannot install with both ssl and gnutls flags selected"
36         fi
37         if use perl; then
38                 if ! built_with_use perl ithreads; then
39                         eerror "You must compile dev-lang/perl with the ithreads USE"
40                         eerror "flag if you want to build the wzdftpd Perl module."
41                         die "You must compile dev-lang/perl with the ithreads USE flag"
42                 fi
43         fi
44 }
45
46 src_unpack() {
47         unpack "${A}"
48         cd "${S}"
49         epatch "${FILESDIR}/${P}-perlinc.patch" || die "Error patching wzdftpd: perlinc"
50         epatch "${FILESDIR}/${P}-valgrind.patch" || die "Error patching wzdftpd:
51         valgrind"
52 }
53
54 src_compile() {
55         local CMAKE_VARIABLES=""
56
57         if use debug; then
58                 append-flags -ggdb -o1
59                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DDEBUG:BOOL=ON     -DCMAKE_BUILD_TYPE:STRING=Debug"
60         else
61                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DDEBUG:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=Release"
62         fi
63
64         if use sqlite; then
65                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_SQLite3:BOOL=ON"
66         else
67                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_SQLite3:BOOL=OFF"
68         fi
69
70         if use mysql; then
71                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_MySQL:BOOL=ON"
72         else
73                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_MySQL:BOOL=OFF"
74         fi
75
76         if use postgres; then
77                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_PostgreSQL:BOOL=ON"
78         else
79                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_PostgreSQL:BOOL=OFF"
80         fi
81
82         if use ssl; then
83                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_OpenSSL:BOOL=ON"
84         else
85                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_OpenSSL:BOOL=OFF"
86         fi
87
88         if use gnutls; then
89                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_GnuTLS:BOOL=ON"
90         else
91                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_GnuTLS:BOOL=OFF"
92         fi
93
94         if use pam; then
95                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_PAM:BOOL=ON"
96         else
97                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_PAM:BOOL=OFF"
98         fi
99
100         if use tcl; then
101                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_TCLDev:BOOL=ON"
102         else
103                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_TCLDev:BOOL=OFF"
104         fi
105
106         if use perl; then
107                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_PerlDev:BOOL=ON"
108         else
109                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_PerlDev:BOOL=OFF"
110         fi
111
112         if use zeroconf; then
113                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_Zeroconf:BOOL=ON"
114         else
115                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_Zeroconf:BOOL=OFF"
116         fi
117
118         if use ipv6; then
119                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_IPV6:BOOL=ON"
120         else
121                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_IPV6:BOOL=OFF"
122         fi
123
124         if use utf8; then
125                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_UTF8:BOOL=ON"
126         else
127                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_UTF8:BOOL=OFF"
128         fi
129
130         if use tests; then
131                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_TESTS:BOOL=ON"
132         else
133                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DWITH_TESTS:BOOL=OFF"
134         fi
135
136         CMAKE_VARIABLES="${CMAKE_VARIABLES} -DCMAKE_INSTALL_PREFIX:PATH=/usr"
137         CMAKE_VARIABLES="${CMAKE_VARIABLES} -DCONF_INSTALL_PATH:PATH=/etc/wzdftpd"
138
139         mkdir "${WORKDIR}/${P}-cmake"
140         cd "${WORKDIR}/${P}-cmake" || die "Could not create/access temporary CMake directory"
141
142         cmake ${CMAKE_VARIABLES} "${S}" && cmake ${CMAKE_VARIABLES} "${S}"\
143                 || die "CMake configuration failed"
144         emake -j1 || die "emake build of wzdftpd failed"
145 }
146
147 src_install() {
148         cd "${WORKDIR}/${P}-cmake" || die "Could not access temporary CMake directory"
149         einstall -j1 DESTDIR="${D}" || die "Installation of wzdftpd failed"
150 #       die "**** CRASHING FOR DEBUG REASONS ****"
151 }