Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/blueness:master commit in: dev-libs/axTLS/files/, dev-libs/axTLS/
Date: Fri, 06 Apr 2012 15:12:10
Message-Id: 1333725104.f3fea476aea4c3702d9af4a86d48dc4b5260961e.blueness@gentoo
1 commit: f3fea476aea4c3702d9af4a86d48dc4b5260961e
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 6 15:11:44 2012 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 6 15:11:44 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=dev/blueness.git;a=commit;h=f3fea476
7
8 dev-libs/axTLS: add USE=savedconfig and USE=doc code
9
10 ---
11 dev-libs/axTLS/Manifest | 4 +-
12 dev-libs/axTLS/axTLS-1.4.5.ebuild | 94 ++++++++++++++++++++++++++++++------
13 dev-libs/axTLS/files/config | 4 +-
14 3 files changed, 82 insertions(+), 20 deletions(-)
15
16 diff --git a/dev-libs/axTLS/Manifest b/dev-libs/axTLS/Manifest
17 index f1bc27e..48fca04 100644
18 --- a/dev-libs/axTLS/Manifest
19 +++ b/dev-libs/axTLS/Manifest
20 @@ -1,4 +1,4 @@
21 -AUX config 3068 RMD160 cc43051398f7bfab7a429832b8aa748a82b413f8 SHA1 62693549c6c9b892debb628f9120e8804dc4aa71 SHA256 462ab8900abc31b518b49967905b6a081312af0b3a26b5920ce2e3face838d9a
22 +AUX config 3064 RMD160 50852bca5ca0e0d62af398805fd30133fd2361a3 SHA1 32de40d7e7300f0a43607a236f5890a38414fa3b SHA256 a2a52b3ca276755f3629d9b13685a52fc2415309afa9607d4ab361bc1360015f
23 DIST axTLS-1.4.5.tar.gz 1299325 RMD160 fb8f78578a998ed0a88cfef18127e4d24ff35bfc SHA1 33b8c4b7babd433d78889218bc5fa6932bfd0a24 SHA256 04e9c235d59cff98c393c920d4d7975b7ba32979c1d9675cee73996d22d232f1
24 -EBUILD axTLS-1.4.5.ebuild 1993 RMD160 c7758f2af414ca08979cd9530a680b8d4c55f8d0 SHA1 c30cc1f43f26d017587f33fb673e2e2a91311e42 SHA256 2c696b605f274b8ef05f4c4ce060fe007e334a554d8f1bf067dd5f1d7ea05ba2
25 +EBUILD axTLS-1.4.5.ebuild 3732 RMD160 9b60fb66caf54369fc905efcff3de9e2c0b7e4c7 SHA1 71601a754f2a40cd110e617c9183373e7f9eaf9a SHA256 0ee53de947ab47770ce85adcf0b453ab727a9f15f4fdbd0ee09124555c3f4a51
26 MISC metadata.xml 539 RMD160 66d2200563130d8af1e6b9ea42aac0098cca0ece SHA1 977793dc0d626b3c9144cdac6e85ec137efd3e72 SHA256 678ce846bdfbf9df350ed0ba25520abe1588a12c229cbc54642269cf2fbe0966
27
28 diff --git a/dev-libs/axTLS/axTLS-1.4.5.ebuild b/dev-libs/axTLS/axTLS-1.4.5.ebuild
29 index 25c17da..c1f12d0 100644
30 --- a/dev-libs/axTLS/axTLS-1.4.5.ebuild
31 +++ b/dev-libs/axTLS/axTLS-1.4.5.ebuild
32 @@ -4,17 +4,40 @@
33
34 EAPI="4"
35
36 -inherit user toolchain-funcs
37 +inherit user savedconfig toolchain-funcs
38 +
39 +################################################################################
40 +# axTLS CONFIG MINI-HOWTO
41 +#
42 +# Note: axTLS is highly configurable and uses mconf, much like busybox or the
43 +# the linux kernel. You may configure it in two ways:
44 +#
45 +# 1) USE="-savedconfig" and set/unset the remaining use flags to obtain the
46 +# configuration you want.
47 +#
48 +# 2) Do
49 +#
50 +# FEATURES="keepwork" USE="savedconfig -*" emerge axTLS
51 +#
52 +# then
53 +#
54 +# cd /var/tmp/portage/busybox*/work/busybox-*
55 +#
56 +#
57 +################################################################################
58
59 DESCRIPTION="Embedded client/server TLSv1 SSL library and small HTTP(S) server"
60 HOMEPAGE="http://axtls.sourceforge.net/"
61 SRC_URI="mirror://sourceforge/axtls/${PN}-1.4.5.tar.gz"
62 +S="${WORKDIR}/${PN}"
63
64 LICENSE="BSD"
65 SLOT="0"
66 KEYWORDS="~amd64 ~x86"
67 -IUSE="httpd cgi-lua cgi-php static"
68 +IUSE="httpd cgi-lua cgi-php static doc"
69
70 +# TODO: add ipv6, and c#, java, lua, perl bindings
71 +# Currently these all have some issue
72 DEPEND=""
73 RDEPEND="${DEPEND}
74 httpd? (
75 @@ -22,13 +45,12 @@ RDEPEND="${DEPEND}
76 cgi-php? ( dev-lang/php[cgi] )
77 )"
78
79 +#Note1: static, cgi-* makes no sense if httpd is not given
80 REQUIRED_USE="
81 static? ( httpd )
82 cgi-lua? ( httpd )
83 cgi-php? ( httpd )"
84
85 -S="${WORKDIR}/${PN}"
86 -
87 AXTLS_GROUP="axtls"
88 AXTLS_USER="axtls"
89
90 @@ -42,55 +64,95 @@ pkg_setup() {
91
92 src_prepare() {
93 tc-export CC
94 +
95 + #Use CC as the host compiler for mconf
96 sed -i -e "s:^HOSTCC.*:HOSTCC=${CC}:" \
97 "${S}"/config/Rules.mak
98 -}
99
100 -src_configure() {
101 - tc-export CC
102 + #We want CONFIG_DEBUG to avoid stripping
103 + #but not for debugging info
104 + sed -i -e 's: -g::' \
105 + "${S}"/config/Rules.mak
106 + sed -i -e 's: -g::' \
107 + "${S}"/config/makefile.conf
108 +}
109
110 +use_flag_config() {
111 cp "${FILESDIR}"/config "${S}"/config/.config
112
113 + #Respect CFLAGS/LDFLAGS
114 sed -i -e "s:^CONFIG_EXTRA_CFLAGS_OPTIONS.*$:CONFIG_EXTRA_CFLAGS_OPTIONS=\"${CFLAGS}\":" \
115 "${S}"/config/.config
116 -
117 sed -i -e "s:^CONFIG_EXTRA_LDFLAGS_OPTIONS.*$:CONFIG_EXTRA_LDFLAGS_OPTIONS=\"${LDLAGS}\":" \
118 "${S}"/config/.config
119
120 + #The logic is that the default config file enables everything and we disable
121 + #here with sed unless a USE flags says to keep it
122 if use httpd; then
123 -
124 if ! use static; then
125 sed -i -e 's:^CONFIG_HTTP_STATIC_BUILD:# CONFIG_HTTP_STATIC_BUILD:' \
126 "${S}"/config/.config
127 fi
128 -
129 if ! use cgi-php && ! use cgi-lua; then
130 sed -i -e 's:^CONFIG_HTTP_HAS_CGI:# CONFIG_HTTP_HAS_CGI:' \
131 "${S}"/config/.config
132 fi
133 -
134 if ! use cgi-php; then
135 sed -i -e 's:,.php::' "${S}"/config/.config
136 fi
137 -
138 if ! use cgi-lua; then
139 sed -i -e 's:\.lua,::' \
140 -e 's:lua:php:' \
141 -e 's:^CONFIG_HTTP_ENABLE_LUA:# CONFIG_HTTP_ENABLE_LUA:' \
142 "${S}"/config/.config
143 fi
144 -
145 else
146 -
147 sed -i -e 's:^CONFIG_AXHTTPD:# CONFIG_AXHTTPD:' \
148 "${S}"/config/.config
149 + fi
150 +
151 + yes "n" | emake -j1 oldconfig > /dev/null
152 +}
153 +
154 +src_configure() {
155 + tc-export CC
156
157 + if use savedconfig; then
158 + restore_config config/.config
159 + if [ -f config/.config ]; then
160 + ewarn "Using saved config, all other USE flags ignored"
161 + else
162 + ewarn "No saved config, seeding with the default"
163 + cp "${FILESDIR}"/config "${S}"/config/.config
164 + fi
165 + yes "" | emake -j1 oldconfig > /dev/null
166 + else
167 + use_flag_config
168 fi
169 +}
170
171 - yes "n" | emake -j1 oldconfig
172 +src_compile() {
173 + default
174 + if use doc; then
175 + emake docs
176 + mv www README
177 + fi
178 }
179
180 src_install() {
181 + if use savedconfig; then
182 + save_config config/.config
183 + fi
184 +
185 emake PREFIX="${ED}/usr" install
186 - use httpd && mv "${ED}"/usr/bin/{,ax}htpasswd
187 + if [ -f "${ED}"/usr/bin/htpasswd ]; then
188 + mv "${ED}"/usr/bin/{,ax}htpasswd
189 + fi
190 +
191 + docompress -x /usr/share/doc/${PF}/README
192 + dodoc -r README
193 +
194 + if use doc; then
195 + dodoc -r docsrc/html
196 + fi
197 }
198
199 diff --git a/dev-libs/axTLS/files/config b/dev-libs/axTLS/files/config
200 index 4e80653..7cfaab7 100644
201 --- a/dev-libs/axTLS/files/config
202 +++ b/dev-libs/axTLS/files/config
203 @@ -62,7 +62,7 @@ CONFIG_HTTP_STATIC_BUILD=y
204 CONFIG_HTTP_PORT=8080
205 CONFIG_HTTP_HTTPS_PORT=4343
206 CONFIG_HTTP_SESSION_CACHE_SIZE=5
207 -CONFIG_HTTP_WEBROOT="/var/www/localhost"
208 +CONFIG_HTTP_WEBROOT="/var/www/localhost/htdocs"
209 CONFIG_HTTP_TIMEOUT=300
210
211 #
212 @@ -101,7 +101,7 @@ CONFIG_LUA_CORE=""
213 # Samples
214 #
215 CONFIG_SAMPLES=y
216 -# CONFIG_C_SAMPLES is not set
217 +CONFIG_C_SAMPLES=y
218 # CONFIG_CSHARP_SAMPLES is not set
219 # CONFIG_VBNET_SAMPLES is not set
220 # CONFIG_JAVA_SAMPLES is not set