catalinux / Conn (public) (License: LGPLv2) (since 2016-03-01) (hash sha1)
Net library for easy building ipv4/ipv6 network daemons/clients
List of commits:
Subject Hash Author Date (UTC)
Duilder fixes. Removed -O0. Fixed spec file. d8a03dced52e918b6f66a05dfd64a3c75c07c91b Catalin(ux) M. BOIE 2011-12-14 09:12:55
Fixed a stupid logging bug (invalid number of parameters). e7d4c38d0130a142ac6c409c63d63201d2af08e2 Catalin(ux) M. BOIE 2010-12-22 16:46:47
Ignore all Changelog files. fa45b63d3db958228f44bcb3d6431d60f94d1147 Catalin(ux) M. BOIE 2010-12-22 16:46:16
Added mailmap file. a57dcfd6bdf6c8c86161cf7ce3fff942a714a2b9 Catalin(ux) M. BOIE 2010-12-22 16:46:04
Be more verbose in try_expand_buf and error out connection when cannot expand. e95ac8d7e5015958d3594862c6183b63bab80d4a Catalin(ux) M. BOIE 2010-09-30 20:58:08
Ignore xbind1 compiled example. 089b68cf9fc5c16ee7d8136b28a52ec4dd139c78 Catalin(ux) M. BOIE 2010-08-23 19:42:01
Removed direct access to Conn structure in s.c example. f6215273602571ef2c98479bdba930ebe312cbc9 Catalin(ux) M. BOIE 2010-08-23 19:38:33
Bumped the version to 1.0.32. f158fca2cf9f3285ae761cd4ce30b01911b84385 Catalin(ux) M. BOIE 2010-06-23 21:30:47
The cache for epoll_ctl, has to take also the slot in consideration. ed378c16927c707feee481b2cd0ea7fbdf257d9d Catalin(ux) M. BOIE 2010-06-09 19:18:03
After calling getsockname, set cache as clean. 199f0fd96b064fd1e63f5773b1e7ab58e7d91303 Catalin(ux) M. BOIE 2010-06-08 18:30:20
Do not try to call getsockname if connection is not opened. e9853b5b5a01df3c5e07f6fe4607a68fd7181b39 Catalin(ux) M. BOIE 2010-06-08 18:28:49
Supports kernels below 2.6.9 (epoll_ctl). 97919a022fae39bdefc3f7e4c50526fb473dfd34 Catalin(ux) M. BOIE 2010-06-08 18:06:35
Cosmetic logging. ad806920255f8ca5f9281b6b6a3a53edf2d5088f Catalin(ux) M. BOIE 2010-06-08 17:35:45
When generating one line of slot status, do not append \n. 20ed77b4bf5909ded12cd225753a8858d8941792 Catalin(ux) M. BOIE 2010-06-08 15:57:16
Indented Conn_poll_cb to better watch logs. 58d734a8895b03eb17724eefe37e862c9665fb2c Catalin(ux) M. BOIE 2010-06-08 15:52:44
If we have POLLOUT set and the queue is empty, do not call recv function. 2f3b266eea11dea7c28f1c24b615f667585a215e Catalin(ux) M. BOIE 2010-06-08 15:27:40
Conn_{addr,port}_{local,remote} functions added. 47643b30ea900240e821983c89eb1f806f91c6ea Catalin(ux) M. BOIE 2010-06-08 15:03:52
Wrong cache consulted! 6d018b014156ada0bf1a138ac2178386f6bb90ab Catalin(ux) M. BOIE 2010-06-08 15:03:34
If slot is in FREE state and we get events, do not abort, but log an error. 52301f684bb4a49fd74556f8b15fee643c4bfb06 Catalin(ux) M. BOIE 2010-06-07 20:25:21
More verbose logging and added some TODOs. a27014689701b1dd3d0e3c02629d3c7dd0edc77e Catalin(ux) M. BOIE 2010-06-07 20:24:43
Commit d8a03dced52e918b6f66a05dfd64a3c75c07c91b - Duilder fixes. Removed -O0. Fixed spec file.
Author: Catalin(ux) M. BOIE
Author date (UTC): 2011-12-14 09:12
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2011-12-14 09:15
Parent(s): e7d4c38d0130a142ac6c409c63d63201d2af08e2
Signer:
Signing key:
Signing status: N
Tree: 765085f037877ca9a5e774752d6fdcb6885f19da
File Lines added Lines deleted
.gitignore 1 0
Conn.spec.in 2 2
Makefile.in 1 1
TODO 20 8
duilder 142 135
duilder.conf 1 1
File .gitignore changed (mode: 100644) (index 96bedc0..fcdb6d9)
... ... Conn_config.h
7 7 *.so *.so
8 8 *.so.* *.so.*
9 9 *.log *.log
10 duilder_release
File Conn.spec.in changed (mode: 100644) (index 64b1bad..b5f017e)
... ... rm -rf ${RPM_BUILD_ROOT}
34 34
35 35 %files %files
36 36 %attr (-,root,root) %attr (-,root,root)
37 %dir @USR_INCLUDE@/*
38 %dir @USR_LIB@/*
37 @USR_INCLUDE@/*
38 @USR_LIB@/*
39 39 %doc README Changelog examples INSTALL %doc README Changelog examples INSTALL
File Makefile.in changed (mode: 100644) (index 3c820df..9c3a15a)
1 1 export CC := gcc export CC := gcc
2 2 export INCS += -I. export INCS += -I.
3 3 export LIBS += export LIBS +=
4 export CFLAGS += -ggdb3 -Wall -Wextra -pedantic -Wno-long-long -pipe -fpic -O0
4 export CFLAGS += -ggdb3 -Wall -Wextra -pedantic -Wno-long-long -pipe -fpic
5 5 export OBJS += Conn_engine_core.o Conn_engine_poll.o Conn_engine_epoll.o Conn.o export OBJS += Conn_engine_core.o Conn_engine_poll.o Conn_engine_epoll.o Conn.o
6 6
7 7 .PHONY: all .PHONY: all
File TODO changed (mode: 100644) (index 56c4068..f974536)
4 4 [ ] Cache getaddrinfo responses [ ] Cache getaddrinfo responses
5 5 [ ] Replace Conn_X with Conn_get_socket_X! [ ] Replace Conn_X with Conn_get_socket_X!
6 6 [ ] Use shutdown(2) before closing connection (http://www.developerweb.net/forum/archive/index.php/t-2940.html). [ ] Use shutdown(2) before closing connection (http://www.developerweb.net/forum/archive/index.php/t-2940.html).
7 [ ] Switch all pointers to callbacks to a single callback with paramenters +
8 a flag that will say for what type of callbacks to call the callback.
9 [ ] Conn.c:532:19: warning: variable 'psa' set but not used [-Wunused-but-set-variable] & Co.
10 [ ]
7 11
8 12 == LOW PRIORITY == == LOW PRIORITY ==
9 13 [ ] Dump all memory statistics [ ] Dump all memory statistics
 
14 18 [ ] Add a function to set the maximum number of connections. [ ] Add a function to set the maximum number of connections.
15 19 [ ] Fix the whole list scanning for expiration, band and closing. [ ] Fix the whole list scanning for expiration, band and closing.
16 20 [ ] Put callbacks in a structure to free some space from struct Conn. [ ] Put callbacks in a structure to free some space from struct Conn.
17
21 [ ] Check if we are swapping and warn.
22 [ ] Log faults and io.
23 [ ] We must have a single set of pointers to callback, not many. At Conn creation,
24 we copy the default set and than replace, on request, some members.
25 This will simplify the code.
18 26 [ ] Add access control [ ] Add access control
19 27 Conn_ac_set_default(C, CONN_AC_DENY) - default deny (or CONN_AC_ALLOW) Conn_ac_set_default(C, CONN_AC_DENY) - default deny (or CONN_AC_ALLOW)
20 28 Conn_ac_add(C, CONN_AC_ALLOW, "2001::1/64"); - for ipv6 Conn_ac_add(C, CONN_AC_ALLOW, "2001::1/64"); - for ipv6
21 29 Conn_ac_add(C, CONN_AC_ALLOW, "192.168.0.0/25"); - for ipv4 Conn_ac_add(C, CONN_AC_ALLOW, "192.168.0.0/25"); - for ipv4
22 30 [ ] A la redir stuff [ ] A la redir stuff
23
24 31 [ ] Bridge 2 connections together for proxy stuff. [ ] Bridge 2 connections together for proxy stuff.
25 32 [ ] Check PACKET: can we send with "send" without knowing the MAC? [ ] Check PACKET: can we send with "send" without knowing the MAC?
26 33 [ ] UDP [ ] UDP
27 34 [ ] Ce se intimpla daca se ajunge la ~ sfirsitul buffer-ului si nu pot inca sa [ ] Ce se intimpla daca se ajunge la ~ sfirsitul buffer-ului si nu pot inca sa
28 procesez datele?
35 procesez datele? We should log and close the connection. It is
36 programmer's fault or a DoS.
29 37 [ ] Queue for delete/trytoconnect/etc. [ ] Queue for delete/trytoconnect/etc.
30 38
31 39 Performance: Performance:
 
... ... Pentru a reduce numarul de conexiuni in TIME-WAIT:
47 55 echo 200 > /proc/sys/net/ipv4/tcp_max_tw_buckets echo 200 > /proc/sys/net/ipv4/tcp_max_tw_buckets
48 56
49 57 [ ] Add loadbalancing and failover in the base code. [ ] Add loadbalancing and failover in the base code.
50 [ ] Automaticaly put \0 at the end of receive data.
51 [ ] Add the possibility to wait for an char/string before calling recv callback
58 [ ] Automaticaly put \0 at the end of receive data. What for?!
59 [ ] Add the possibility to wait for an char/string before calling recv callback.
60 Maybe do this with socket filtering or in kernel?
52 61 [ ] Change socket buffer accordingly with user settings to minimize [ ] Change socket buffer accordingly with user settings to minimize
53 62 needed memory. needed memory.
54 63
 
... ... Pentru a reduce numarul de conexiuni in TIME-WAIT:
57 66 [ ] Test suite [ ] Test suite
58 67 [ ] Free memory when the number of connections is going down. [ ] Free memory when the number of connections is going down.
59 68 [ ] Bandwidth part should have a separate pointer, to not load too much Conn structure. [ ] Bandwidth part should have a separate pointer, to not load too much Conn structure.
60
61
62
69 [ ] Maybe we should have Bandwidth classes so we can group connections.
70 [ ] http://www.erlang-solutions.com/thesis/tcp_optimisation/tcp_optimisation.html
71 [ ]
63 72
64 73 === When we switch to Conn version 2 library === === When we switch to Conn version 2 library ===
65 74 [ ] Conn_socket will cann Conn_socket_proto [ ] Conn_socket will cann Conn_socket_proto
66 75 [ ] use enums! [ ] use enums!
76 [ ] All internal variables of Conn structure must not be exposed directly.
77 [ ] http://urbanairship.com/blog/2010/09/29/linux-kernel-tuning-for-c500k/
78 [ ]
File duilder changed (mode: 100755) (index bf888f6..a6e2825)
2 2
3 3 set -e set -e
4 4
5 function git_last_changelog()
6 {
7 changelog=""
8
9 # get the list of tags
10 i=0
11 number_of_tags=0
12 for tag in `git tag -l`; do
13 if [ "${tag:0:1}" != "v" ]; then
14 # skip other kind of tags beside versions
15 continue
16 fi
17
18 tags[${i}]=${tag}
19 tags_commit[${i}]=`git show-ref ${tag} | cut -d' ' -f1`
20 number_of_tags=$[${number_of_tags}+1]
21
22 i=$[${i}+1]
23 done
24
25 # get the list of commits, test if is a tag and do the diff
26 prev=""
27 git log --pretty=oneline | cut -f1 | \
28 while read commit junk; do
29 # test if it is a tag
30 tag=""
31 i=0
32 while [ "${i}" -lt "${number_of_tags}" ]; do
33 if [ "${commit}" = "${tags_commit[${i}]}" ]; then
34 tag="${tags[${i}]}"
35 break
36 fi
37
38 i=$[${i}+1]
39 done
40
41 if [ -z "${tag}" ]; then
42 continue
43 fi
44
45 if [ ! -z "${prev}" ]; then
46 current=${tag}
47 git shortlog ${current}..${prev} | \
48 (IFS=""
49 while read line; do
50 echo " ${line}"
51 done)
52 echo
53 break
54 fi
55 prev=${tag}
56 done
57 }
58
59 5 function duilder_final() function duilder_final()
60 6 { {
61 7 PRJ="${1}" PRJ="${1}"
 
... ... function duilder_final()
64 10
65 11 # Run release script # Run release script
66 12 if [ ! -z "${RELEASE_SCRIPT}" -a -x "${RELEASE_SCRIPT}" ]; then if [ ! -z "${RELEASE_SCRIPT}" -a -x "${RELEASE_SCRIPT}" ]; then
67 echo "Running ${RELEASE_SCRIPT}..."
68 export CHANGELOG=`git_last_changelog`
13 echo "[*] Running ${RELEASE_SCRIPT}..."
69 14 ${RELEASE_SCRIPT} ${RELEASE_SCRIPT}
70 15 fi fi
71 16 } }
 
... ... function duilder_docs()
76 21 VER="${2}" VER="${2}"
77 22 EXPORT_PATH="${3}" EXPORT_PATH="${3}"
78 23
79 echo "Copying docs to [${EXPORT_PATH}]..."
80 for f in README License LICENSE Changelog TODO FAQ INSTALL; do
24 if [ ! -d "${EXPORT_PATH}" ]; then
25 echo "[*] WARN: ${EXPORT_PATH} does not exists. Creating it..."
26 mkdir -p "${EXPORT_PATH}"
27 fi
28
29 echo "[*] Copying docs to [${EXPORT_PATH}]..."
30 for f in README License LICENSE Changelog Changelog-last TODO FAQ INSTALL; do
81 31 if [ -r "${f}" ]; then if [ -r "${f}" ]; then
82 32 cp -vp "${f}" "${EXPORT_PATH}/" cp -vp "${f}" "${EXPORT_PATH}/"
83 33 fi fi
84 34 done done
35 echo
85 36
86 37 if [ -d "screenshot" ]; then if [ -d "screenshot" ]; then
87 echo "Copying screenshots..."
38 echo "[*] Copying screenshots..."
88 39 mkdir -p "${EXPORT_PATH}" mkdir -p "${EXPORT_PATH}"
89 40 cp -vp screenshot/* "${EXPORT_PATH}/" cp -vp screenshot/* "${EXPORT_PATH}/"
41 echo
90 42 fi fi
91 43 } }
92 44
 
... ... function duilder_git()
99 51 GIT_PUSH="${5}" GIT_PUSH="${5}"
100 52
101 53 if [ ! -x /usr/bin/git ]; then if [ ! -x /usr/bin/git ]; then
102 echo "Warning: Git not found!"
54 echo "[*] Warning: Git not found!"
103 55 exit 0 exit 0
104 56 fi fi
105 57
106 58 if [ ! -d .git ]; then if [ ! -d .git ]; then
107 echo "Warning: I cannot find .git directory!"
59 echo "[*] Warning: I cannot find .git directory!"
108 60 exit 0 exit 0
109 61 fi fi
110 62
111 63 if [ "${EXPORT_GIT}" = "1" ]; then if [ "${EXPORT_GIT}" = "1" ]; then
112 echo "Generate GIT tree for HTTP transport..."
64 echo "[*] Generating GIT tree for HTTP transport..."
113 65 if [ ! -d "${GIT_DEST}/${PRJ}.git" ]; then if [ ! -d "${GIT_DEST}/${PRJ}.git" ]; then
114 66 git clone --bare . "${GIT_DEST}/${PRJ}.git" git clone --bare . "${GIT_DEST}/${PRJ}.git"
115 67
 
... ... function duilder_git()
143 95 echo -n > Changelog echo -n > Changelog
144 96
145 97 # get the list of tags # get the list of tags
146 i=0
147 98 number_of_tags=0 number_of_tags=0
148 for tag in `git tag -l`; do
149 if [ "${tag:0:1}" != "v" ]; then
150 # skip other kind of tags beside versions
151 continue
152 fi
153
154 tags[${i}]=${tag}
155 tags_commit[${i}]=`git show-ref ${tag} | cut -d' ' -f1`
99 while read sha1 full_tag; do
100 tag=`echo ${full_tag} | sed -e 's#refs/tags/##' | cut -d'^' -f1`
101 tags[${number_of_tags}]=${tag}
102 tags_commit[${number_of_tags}]=${sha1}
156 103 number_of_tags=$[${number_of_tags}+1] number_of_tags=$[${number_of_tags}+1]
157
158 i=$[${i}+1]
159 done
104 done < <(git show-ref --tags -d | grep refs/tags/v)
160 105
161 106 # get the list of commits, test if is a tag and do the diff # get the list of commits, test if is a tag and do the diff
162 107 prev="" prev=""
108 add=""
109 first=1
163 110 git log --pretty=oneline | cut -f1 | \ git log --pretty=oneline | cut -f1 | \
164 111 while read commit junk; do while read commit junk; do
165 112 # test if it is a tag # test if it is a tag
 
... ... function duilder_git()
180 127
181 128 if [ ! -z "${prev}" ]; then if [ ! -z "${prev}" ]; then
182 129 echo "[*] Generating Changelog from ${tag} -> ${prev}..." echo "[*] Generating Changelog from ${tag} -> ${prev}..."
130 echo -en "${add}" >> Changelog
131 add="\n"
183 132 echo "[${tag} -> ${prev}]" >> Changelog echo "[${tag} -> ${prev}]" >> Changelog
184 echo >> Changelog
185 133 git shortlog ${tag}..${prev} | \ git shortlog ${tag}..${prev} | \
186 134 (IFS="" (IFS=""
187 135 while read line; do while read line; do
188 136 echo " ${line}" echo " ${line}"
189 137 done) \ done) \
190 138 >> Changelog >> Changelog
191 echo >> Changelog
139
140 if [ "${first}" = "1" ]; then
141 echo "[*] Generating Changelog-last..."
142 cp Changelog Changelog-last
143 first=0
144 fi
192 145 fi fi
193 146 prev=${tag} prev=${tag}
194 147 done done
 
... ... function duilder_srpm()
206 159
207 160 P="${PRJ}-${VER}" P="${PRJ}-${VER}"
208 161
162 if [ ! -d "${EXPORT_PATH}" ]; then
163 echo "WARN: ${EXPORT_PATH} does not exists. Creating it..."
164 mkdir -p "${EXPORT_PATH}"
165 fi
166
209 167 if [ "${BUILD_SRPM}" != "1" ]; then if [ "${BUILD_SRPM}" != "1" ]; then
210 168 exit 0 exit 0
211 169 fi fi
212 170
213 echo "Building SRPM..."
171 echo "[*] Building SRPM..."
214 172 rpmbuild -ts "${P}.tar.gz" rpmbuild -ts "${P}.tar.gz"
173 echo
215 174
216 PKG="${RPMBUILD}/SRPMS/${P}-1.src.rpm"
175 PKG="${RPMBUILD}/SRPMS/${P}-${REV}.src.rpm"
176
177 # Run a rpmlint on it
178 if [ -x /usr/bin/rpmlint ]; then
179 echo "[*] RPMlinting..."
180 rpmlint -iv "${PKG}" > rpmlint.out
181 else
182 echo "[*] WARN: rpmlint is missing!"
183 fi
217 184
218 185 if [ ! -z "${SRPM_DEST}" ]; then if [ ! -z "${SRPM_DEST}" ]; then
219 echo "Copying [${PKG}] to [${SRPM_DEST}]..."
186 echo "[*] Copying [${PKG}] to [${SRPM_DEST}]..."
220 187 cp -vp "${PKG}" "${SRPM_DEST}/" cp -vp "${PKG}" "${SRPM_DEST}/"
188 echo
221 189 fi fi
222 190
223 echo "Copying to export dir [${EXPORT_PATH}]..."
191 echo "[*] Copying to export dir [${EXPORT_PATH}]..."
224 192 mkdir -p "${EXPORT_PATH}" mkdir -p "${EXPORT_PATH}"
225 193 cp -vp "${PKG}" "${EXPORT_PATH}/" cp -vp "${PKG}" "${EXPORT_PATH}/"
194 echo
226 195
227 196 if [ -x "${SRPM_POST_RUN}" ]; then if [ -x "${SRPM_POST_RUN}" ]; then
228 echo "Running post SRPM build script [${SRPM_POST_RUN}]..."
197 echo "[*] Running post SRPM build script [${SRPM_POST_RUN}]..."
229 198 ${SRPM_POST_RUN} "${PKG}" ${SRPM_POST_RUN} "${PKG}"
230 199 fi fi
231 200 } }
 
... ... function duilder_tar()
239 208
240 209 P="${PRJ}-${VER}" P="${PRJ}-${VER}"
241 210
242 echo "Generating tarball [${P}.tar.gz]..."
211 if [ ! -d "${EXPORT_PATH}" ]; then
212 echo "[*] WARN: ${EXPORT_PATH} does not exists. Creating it..."
213 mkdir -p "${EXPORT_PATH}"
214 fi
215
216 echo "[*] Generating tarball [${P}.tar.gz]..."
243 217 ADD_EXCLUDE="" ADD_EXCLUDE=""
244 218 if [ ! -z "${EXCLUDE}" ]; then if [ ! -z "${EXCLUDE}" ]; then
245 219 ADD_EXCLUDE="--exclude-from ${P}/${EXCLUDE}" ADD_EXCLUDE="--exclude-from ${P}/${EXCLUDE}"
 
... ... function duilder_tar()
256 230 && rm -rf "${P}" && rm -rf "${P}"
257 231 ) )
258 232
259 echo "Copying source to ${EXPORT_PATH}/..."
233 echo "[*] Copying source to ${EXPORT_PATH}..."
260 234 mkdir -p "${EXPORT_PATH}" mkdir -p "${EXPORT_PATH}"
261 235 cp -vp "${P}.tar.gz" "${EXPORT_PATH}/" cp -vp "${P}.tar.gz" "${EXPORT_PATH}/"
236 echo
262 237 } }
263 238
264 239 #################################################################### ####################################################################
 
... ... else
271 246 fi fi
272 247
273 248
249 if [ ! -r duilder.conf ]; then
250 echo "[*] You must build a duilder.conf file!"
251 exit 1
252 fi
253
254 source ${PWD}/duilder.conf
255
256 # fixes
257 if [ -z "${GIT_DEST}" ]; then
258 GIT_DEST="${EXPORT_PATH}"
259 fi
260
261 if [ -z "${PRJ}" ]; then
262 echo "ERROR: PRJ= parameter is missing."
263 exit 1
264 fi
265
266 if [ -z "${VER}" ]; then
267 echo "ERROR: VER= parameter is missing."
268 exit 1
269 fi
270
271 if [ -z "${REV}" ]; then
272 echo "ERROR: REV= parameter is missing."
273 exit 1
274 fi
275
276 # export variables - just in case a script cares
277 export PRJ VER REV EXPORT_PATH EXPORT_GIT GIT_PUSH GIT_DEST SRPM_DEST LICENSE
278
279
274 280 # Multiplexer # Multiplexer
275 281 if [ "${1}" = "docs" ]; then if [ "${1}" = "docs" ]; then
276 282 shift shift
 
... ... if [ "${1}" = "final" ]; then
302 308 exit $? exit $?
303 309 fi fi
304 310
305 if [ ! -r duilder.conf ]; then
306 echo "You must build a duilder.conf file!"
307 exit 1
308 fi
309
310 311
311 312 ###### Main stuff ###### Main stuff
312
313 source ${PWD}/duilder.conf
314
315 # fixes
316 if [ -z "${GIT_DEST}" ]; then
317 GIT_DEST="${EXPORT_PATH}"
318 fi
319
320 # export variables - just in case a script cares
321 export PRJ VER REV EXPORT_PATH EXPORT_GIT GIT_PUSH GIT_DEST SRPMS_DEST LICENSE
322
323 if [ -z "${PRJ}" ]; then
324 echo "ERROR: PRJ= parameter is missing."
325 exit 1
326 fi
327
328 if [ -z "${VER}" ]; then
329 echo "ERROR: PRJ= parameter is missing."
330 exit 1
331 fi
332
333 if [ -z "${REV}" ]; then
334 echo "ERROR: REV= parameter is missing."
335 exit 1
336 fi
337
338 echo
339 echo "Duilder builder script"
340 echo "Copyright Catalin(ux) M BOIE"
341 echo
342 echo "PRJ=${PRJ}, VER=${VER}, REV=${REV}"
343 echo "System: `uname -a`"
313 echo "[*] Duilder builder script"
314 echo "[*] Copyright Catalin(ux) M. BOIE - catab at embedromix dot ro"
315 echo "[*] PRJ=${PRJ}, VER=${VER}, REV=${REV}"
316 echo "[*] System: `uname -a`"
344 317
345 318 ETC="/etc" ETC="/etc"
346 319 BIN="/bin" BIN="/bin"
 
... ... USR_BIN="/usr/bin"
348 321 USR_SBIN="/usr/sbin" USR_SBIN="/usr/sbin"
349 322 USR_INCLUDE="/usr/include" USR_INCLUDE="/usr/include"
350 323 USR_LIB="/usr/lib" USR_LIB="/usr/lib"
324 USR_SHARE="/usr/share"
351 325 USR_SHARE_DOC="/usr/share/doc/${PRJ}-${VER}" USR_SHARE_DOC="/usr/share/doc/${PRJ}-${VER}"
352 326 SBIN="/usr/sbin" SBIN="/usr/sbin"
353 VAR_LOG="/var/log/${PRJ}"
327 VAR="/var"
328 VAR_LIB="/var/lib"
354 329
355 330 while [ "${1}" != "" ]; do while [ "${1}" != "" ]; do
356 331 VAR="`echo ${1} | cut -d'=' -f1`" VAR="`echo ${1} | cut -d'=' -f1`"
 
... ... while [ "${1}" != "" ]; do
371 346 --libdir) --libdir)
372 347 USR_LIB="${VAL}" USR_LIB="${VAL}"
373 348 ;; ;;
349 --localstatedir)
350 VAR="${VAL}"
351 ;;
352 --sharedstatedir)
353 VAR_LIB="${VAL}"
354 ;;
355 --datadir)
356 USR_SHARE="${VAL}"
357 ;;
374 358 esac esac
375 359 shift shift
376 360 done done
377 361
362 # Last fixes
363 VAR_LOG="${VAR}/log"
364 VAR_RUN="${VAR}/run"
365
366
378 367 # Truncate future sed file # Truncate future sed file
379 368 > tmp.sed > tmp.sed
380 369
381 370 DB_SUPPORT=0 DB_SUPPORT=0
382 371
383 echo -n "Searching for PostgreSQL..."
372 echo -n "[*] Searching for PostgreSQL..."
384 373 set +e set +e
385 374 PG_VERSION="`pg_config --version 2>/dev/null`" PG_VERSION="`pg_config --version 2>/dev/null`"
386 375 set -e set -e
 
... ... fi
403 392 echo "s#@PG_FOUND@#${PG_FOUND}#g" >> tmp.sed echo "s#@PG_FOUND@#${PG_FOUND}#g" >> tmp.sed
404 393
405 394
406 echo -n "Searching for MySQL..."
395 echo -n "[*] Searching for MySQL..."
407 396 set +e set +e
408 397 MYSQL_VERSION="`mysql_config --version 2>/dev/null`" MYSQL_VERSION="`mysql_config --version 2>/dev/null`"
409 398 set -e set -e
 
... ... else
425 414 fi fi
426 415 echo "s#@MYSQL_FOUND@#${MYSQL_FOUND}#g" >> tmp.sed echo "s#@MYSQL_FOUND@#${MYSQL_FOUND}#g" >> tmp.sed
427 416
428 echo -n "Searching for poll..."
417 echo -n "[*] Searching for poll..."
429 418 set +e set +e
430 419 echo -e "#include <poll.h> \n int main(void) { return poll(0, 0, 0); }" | gcc -x c -pipe - -o /dev/null 2>/dev/null echo -e "#include <poll.h> \n int main(void) { return poll(0, 0, 0); }" | gcc -x c -pipe - -o /dev/null 2>/dev/null
431 420 E="${?}" E="${?}"
 
... ... else
438 427 echo "s#@POLL_FOUND@#1#g" >> tmp.sed echo "s#@POLL_FOUND@#1#g" >> tmp.sed
439 428 fi fi
440 429
441 echo -n "Searching for epoll..."
430 echo -n "[*] Searching for epoll..."
442 431 set +e set +e
443 432 echo -e "#include <sys/epoll.h> \n int main(void) { return epoll_create(64); }" | gcc -x c -pipe - -o /dev/null 2>/dev/null echo -e "#include <sys/epoll.h> \n int main(void) { return epoll_create(64); }" | gcc -x c -pipe - -o /dev/null 2>/dev/null
444 433 E="${?}" E="${?}"
 
... ... else
451 440 echo "s#@EPOLL_FOUND@#1#g" >> tmp.sed echo "s#@EPOLL_FOUND@#1#g" >> tmp.sed
452 441 fi fi
453 442
443 echo -n "[*] Searching for ncurses..."
444 set +e
445 echo -e "#include <ncurses.h> \n int main(void) { initscr(); return 0; }" | gcc -x c -pipe - -o /dev/null -lncurses 2>/dev/null
446 E="${?}"
447 set -e
448 if [ "${E}" != "0" ]; then
449 echo " not found."
450 echo "s#@NCURSES_FOUND@#0#g" >> tmp.sed
451 else
452 echo " found."
453 echo "s#@NCURSES_FOUND@#1#g" >> tmp.sed
454 fi
455
454 456 # generic stuff # generic stuff
455 457 echo "s#@PRJ@#${PRJ}#g" >> tmp.sed echo "s#@PRJ@#${PRJ}#g" >> tmp.sed
456 458 echo "s#@VER@#${VER}#g" >> tmp.sed echo "s#@VER@#${VER}#g" >> tmp.sed
457 459 echo "s#@REV@#${REV}#g" >> tmp.sed echo "s#@REV@#${REV}#g" >> tmp.sed
458 echo "s#@DESCRIPTION@#${DESCRIPTION}#g" >> tmp.sed
459
460 460 echo "s#@ETC@#${ETC}#g" >> tmp.sed echo "s#@ETC@#${ETC}#g" >> tmp.sed
461 461 echo "s#@BIN@#${BIN}#g" >> tmp.sed echo "s#@BIN@#${BIN}#g" >> tmp.sed
462 462 echo "s#@USR_BIN@#${USR_BIN}#g" >> tmp.sed echo "s#@USR_BIN@#${USR_BIN}#g" >> tmp.sed
463 463 echo "s#@SBIN@#${SBIN}#g" >> tmp.sed echo "s#@SBIN@#${SBIN}#g" >> tmp.sed
464 464 echo "s#@USR_SBIN@#${USR_SBIN}#g" >> tmp.sed echo "s#@USR_SBIN@#${USR_SBIN}#g" >> tmp.sed
465 echo "s#@VAR@#${VAR}#g" >> tmp.sed
466 echo "s#@VAR_LIB@#${VAR_LIB}#g" >> tmp.sed
465 467 echo "s#@VAR_LOG@#${VAR_LOG}#g" >> tmp.sed echo "s#@VAR_LOG@#${VAR_LOG}#g" >> tmp.sed
468 echo "s#@VAR_RUN@#${VAR_RUN}#g" >> tmp.sed
466 469 echo "s#@USR_INCLUDE@#${USR_INCLUDE}#g" >> tmp.sed echo "s#@USR_INCLUDE@#${USR_INCLUDE}#g" >> tmp.sed
467 470 echo "s#@USR_INC@#${USR_INCLUDE}#g" >> tmp.sed echo "s#@USR_INC@#${USR_INCLUDE}#g" >> tmp.sed
468 471 echo "s#@USR_LIB@#${USR_LIB}#g" >> tmp.sed echo "s#@USR_LIB@#${USR_LIB}#g" >> tmp.sed
472 echo "s#@USR_SHARE@#${USR_SHARE}#g" >> tmp.sed
469 473 echo "s#@USR_SHARE_DOC@#${USR_SHARE_DOC}#g" >> tmp.sed echo "s#@USR_SHARE_DOC@#${USR_SHARE_DOC}#g" >> tmp.sed
470 474 # Export stuff # Export stuff
471 475 echo "s#@EXPORT_PATH@#${EXPORT_PATH}#g" >> tmp.sed echo "s#@EXPORT_PATH@#${EXPORT_PATH}#g" >> tmp.sed
 
... ... echo "s#@EXPORT_PATH@#${EXPORT_PATH}#g" >> tmp.sed
473 477
474 478
475 479 if [ -r Makefile.in ]; then if [ -r Makefile.in ]; then
476 echo "Building Makefile..."
480 echo "[*] Building Makefile..."
477 481 echo -n > Makefile echo -n > Makefile
478 482 echo "# duilder header starts #" >> Makefile echo "# duilder header starts #" >> Makefile
479 483 echo "export PRJ := ${PRJ}" >> Makefile echo "export PRJ := ${PRJ}" >> Makefile
 
... ... if [ -r Makefile.in ]; then
488 492 echo "export I_USR_SBIN := \$(DESTDIR)${USR_SBIN}" >> Makefile echo "export I_USR_SBIN := \$(DESTDIR)${USR_SBIN}" >> Makefile
489 493 echo "export I_USR_INCLUDE := \$(DESTDIR)${USR_INCLUDE}" >> Makefile echo "export I_USR_INCLUDE := \$(DESTDIR)${USR_INCLUDE}" >> Makefile
490 494 echo "export I_USR_INC := \$(DESTDIR)${USR_INCLUDE}" >> Makefile echo "export I_USR_INC := \$(DESTDIR)${USR_INCLUDE}" >> Makefile
495 echo "export I_USR_SHARE := \$(DESTDIR)${USR_SHARE}" >> Makefile
491 496 echo "export I_USR_SHARE_DOC := \$(DESTDIR)${USR_SHARE_DOC}" >> Makefile echo "export I_USR_SHARE_DOC := \$(DESTDIR)${USR_SHARE_DOC}" >> Makefile
492 497 echo "export I_USR_LIB := \$(DESTDIR)${USR_LIB}" >> Makefile echo "export I_USR_LIB := \$(DESTDIR)${USR_LIB}" >> Makefile
493 498 echo "export I_LIB := \$(DESTDIR)${USR_LIB}" >> Makefile echo "export I_LIB := \$(DESTDIR)${USR_LIB}" >> Makefile
499 echo "export I_VAR := \$(DESTDIR)${VAR}" >> Makefile
500 echo "export I_VAR_LIB := \$(DESTDIR)${VAR_LIB}" >> Makefile
494 501 echo "export I_VAR_LOG := \$(DESTDIR)${VAR_LOG}" >> Makefile echo "export I_VAR_LOG := \$(DESTDIR)${VAR_LOG}" >> Makefile
502 echo "export I_VAR_RUN := \$(DESTDIR)${VAR_RUN}" >> Makefile
495 503 echo >> Makefile echo >> Makefile
496 504 echo "# DB stuff" >> Makefile echo "# DB stuff" >> Makefile
497 505 echo "export DB_SUPPORT := ${DB_SUPPORT}" >> Makefile echo "export DB_SUPPORT := ${DB_SUPPORT}" >> Makefile
 
... ... if [ -r Makefile.in ]; then
528 536 fi fi
529 537
530 538 if [ -r "${PRJ}.spec.in" ]; then if [ -r "${PRJ}.spec.in" ]; then
531 echo "Generate .spec file..."
539 echo "[*] Generating .spec file..."
532 540 sed -f tmp.sed ${PRJ}.spec.in > ${PRJ}.spec sed -f tmp.sed ${PRJ}.spec.in > ${PRJ}.spec
533 541 fi fi
534 542
535 if [ -z "${CONFIG_H}" ]; then
536 CONFIG_H="config.h"
543 if [ ! -z "${CONFIG_H}" ]; then
544 echo "[*] Generating ${CONFIG_H} file..."
545 sed -f tmp.sed ${CONFIG_H}.in > ${CONFIG_H}
537 546 fi fi
538 echo "Generating ${CONFIG_H} file..."
539 sed -f tmp.sed ${CONFIG_H}.in > ${CONFIG_H}
540 547
541 548 rm -f tmp.sed rm -f tmp.sed
542 549
543 550 if [ "`basename ${0}`" = "duilderx" ]; then if [ "`basename ${0}`" = "duilderx" ]; then
544 echo "Clone myself to destination as 'duilder'..."
551 echo "[*] Cloning myself to destination as 'duilder'..."
545 552 cp -vpf "${0}" ${PWD}/duilder cp -vpf "${0}" ${PWD}/duilder
546 553 fi fi
547 554
548 echo "Done. Run make."
555 echo "[*] Done. Run make."
File duilder.conf changed (mode: 100644) (index 638c60d..0397e6b)
... ... BUILD_DEB="1"
14 14
15 15 CONFIG_H="Conn_config.h" CONFIG_H="Conn_config.h"
16 16
17 RELEASE_SCRIPT="/usr/local/bin/duilder_release"
17 RELEASE_SCRIPT="./duilder_release"
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/catalinux/Conn

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/catalinux/Conn

Clone this repository using git:
git clone git://git.rocketgit.com/user/catalinux/Conn

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main