#!/bin/sh # ===================================================================== # Projet : DARKMAKE # Fichier : compile # Auteur : Nicolas "DarkHack" Chapuis (c) 2026 # ================== DARKHACK ================== # [ darkweb.fr - system online ] # Powered by Perplexity, your AI assistant # [https://www.perplexity.ai](https://www.perplexity.ai) # ============================================== # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ===================================================================== rootDarkMake="${rootDarkMake:-/etc/darkmake}" if ! type "shInclude" > /dev/null; then . /etc/darksh/lib/shTools shLog="${shLog:-"lib gnutls install"}" shDebugEnable="${shDebugEnable:-1}" shDebug "$*" rootDarkMake="${rootDarkMake:-/etc/darkmake}" $(shInclude ${rootDarkMake}/pkg/lib-sh/pkg-config) fi autoPath="lib/crypto/gnutls" shErrorOnMissing "autoPath" extraConfigure="--enable-shared" extraConfigure="${extraConfigure} --with-trousers-lib=/usr/local/lib/libtspi.so" path_install_vars="${rootDarkMake}/${autoPath}/global/install_vars" \ . "${rootDarkMake}/pkg/bin/checks" shLog="[ $pkgName/$pkgVersion ]" #if [ ! -f "${pkgSrc}/.darkPatch" ];then # touch "${pkgSrc}/.darkPatch" # cd "${pkgSrc}" # cpt=0 # fileLog="${pkgDirLog}/B${cpt}_bootstrap.log" # cpt=$((cpt + 1 ));shDebug 1 "BOOTSTRAP $fileLog" # printEnv > $fileLog # ./bootstrap --gnulib-srcdir="${LIBGNU_PATH}" --no-git >> $fileLog 2>&1 ## echo "en@boldquot" > ${pkgSrc}/po/LINGUAS ## echo "en@quot" >> ${pkgSrc}/po/LINGUAS #fi ##[ -d "${pkgSrc}/src/gl" ] && gnuLibFilesToSearch=$( find "${pkgSrc}/src/gl" | tr ' ' '¤' ) # ##filesToInit="${pkgSrc}/src/libopts/configure $( pkgSrc="${pkgSrc}" findConfigures )" #. "${rootDarkMake}/lib/autotools/libtool/install/basics" #exit 0 autoconfVers="$(autoconf --version | head -n 1 | rev | cut -f 1 -d' ' | rev | cut -f 1,2 -d'.')" [ -d "${pkgSrc}/gl/m4" ] && M4DIR="$M4DIR -I${pkgSrc}/gl/m4" [ -d "${pkgSrc}/m4" ] && M4DIR="$M4DIR -I${pkgSrc}/m4" #touch "${pkgSrc}/.darkPatch" if [ ! -f "${pkgSrc}/.darkPatch" ];then touch "${pkgSrc}/.darkPatch" # gnuLibAvoid="\-\-avoid=lseek\-tests \-\-avoid=select\-tests \-\-avoid=spawn\-tests" gnuLibAvoid="\-\-avoid=lseek\-tests \-\-avoid=select\-tests" gnuLibImports="posix\_spawn\-tests posix\_spawnp\-tests spawn " gnuLibImports="${gnuLibImports} connect ftell ioctl malloc stdio stdbool autobuild fdl getaddrinfo gnupload" gnuLibImports="${gnuLibImports} gpl-3.0 inet\_ntop inet\_pton lgpl\-2\.1" gnuLibImports="${gnuLibImports} sys\_select sys\_stat sys\_socket nonblocking byteswap stdnoreturn string strings limits c\-ctype" gnuLibImports="${gnuLibImports} lib\-symbol\-versions lib\-msvc\-compat sched ld\-version\-script" gnuLibImports="${gnuLibImports} gettext\-h extensions pmccabe2html read\-file warnings manywarnings base64 u64" gnuLibImports="${gnuLibImports} unistd stdint snprintf strcase strndup strtok\_r strverscmp time\_r vsnprintf vasprintf" gnuLibImports="${gnuLibImports} memmem\-simple secure\_getenv func gettimeofday hash\-pjw\-bare havelib intprops minmax netdb netinet\_in" gnuLibImports="${gnuLibImports} arpa\_inet getpeername recv recvfrom send sendto shutdown" gnuLibImports="${gnuLibImports} iconv\-h iconv-open iconv setlocale libunistring binary\-io" file="$pkgSrc/gl/Makefile.am" cp "$file" "${file}-origine" sed -i.cleanlpgl 's/\-\-lgpl=2//g' "$file" sed -i.cleanvalgrind 's/valgrind\-tests / /g' "$file" echo "gnuLibAvoid/Imports :$file" sed -i.replace1 "s/\-\-avoid=lseek\-tests /$gnuLibAvoid /g" "$file" sed -i.replace2 "s/alloca /alloca $gnuLibImports /g" "$file" file="$pkgSrc/gl/gnulib.mk" cp "$file" "${file}-origine" sed -i.cleanAvoid 's/\-\-avoid=[a-zA-Z\_\-]* / /g' "${file}" echo "gnuLibAvoid/Imports :$file" sed -i.replace "s/arpa\_inet /$gnuLibAvoid alloca $gnuLibImports /g" "$file" file="$pkgSrc/src/gl/Makefile.am" cp "$file" "${file}-origine" echo "gnuLibAvoid/Imports :$file" if [ "gnutls_3_2_21" = "${pkgVersion}" ];then # toReplace="parse\-datetime" echo sed -i.replaceA "s/parse\-datetime /$gnuLibAvoid parse\-datetime posix\_spawn\-tests spawn stdio nonblocking ld\-version\-script manywarnings byteswap lib\-msvc\-compat lib\-symbol\-versions limits c\-ctype stdnoreturn string strings read\-file /g" "$file" > /tmp/sed-gnutls.log sed -i.replaceA "s/parse\-datetime /$gnuLibAvoid parse\-datetime posix\_spawn\-tests spawn stdio nonblocking ld\-version\-script manywarnings byteswap lib\-msvc\-compat lib\-symbol\-versions limits c\-ctype stdnoreturn string strings read\-file /g" "$file" 2>&1 >> /tmp/sed-gnutls.log else toReplace="accept" echo sed -i.replaceB "s/${toReplace} /$gnuLibAvoid ${toReplace} posix\_spawn\-tests spawn stdio nonblocking ld\-version\-script manywarnings byteswap lib\-msvc\-compat lib\-symbol\-versions limits c\-ctype stdnoreturn string strings read\-file /g" "$file" > /tmp/sed-gnutls.log sed -i.replaceB "s/${toReplace} /$gnuLibAvoid ${toReplace} posix\_spawn\-tests spawn stdio nonblocking ld\-version\-script manywarnings byteswap lib\-msvc\-compat lib\-symbol\-versions limits c\-ctype stdnoreturn string strings read\-file /g" "$file" 2>&1 >> /tmp/sed-gnutls.log fi echo "en@boldquot" > ${pkgSrc}/po/LINGUAS echo "en@quot" >> ${pkgSrc}/po/LINGUAS if [ "${autoconfVers}" = "2.71" ];then for patchFile in "certtool.c" "ocsptool.c" "certtool-common.c";do # sed -i.patchFreadFile 's/fread_file(infile, \&size)/fread_file(infile, 0, \&size)/g' "${pkgSrc}/src/$patchFile" || exit 1 sed -i.patchFreadFileRemaining \ -e 's/fread_file(infile, &cert_size)/fread_file(infile, 0, \&cert_size)/g' \ -e 's/fread_file(ca_file, &ca_size)/fread_file(ca_file, 0, \&ca_size)/g' \ -e 's/fread_file(infile, &size)/fread_file(infile, 0, \&size)/g' \ "${pkgSrc}/src/$patchFile" || exit 1 done fi ( cd "${pkgSrc}/src" && autogen tpmtool-args.def ) fi gnuLibFilesToSearch="$gnuLibFilesToSearch $( echo "${pkgSrc}/gl/Makefile.am" | tr ' ' '¤' )" gnuLibFilesToSearch="$gnuLibFilesToSearch $( echo "${pkgSrc}/gl/gnulib.mk" | tr ' ' '¤' )" gnuLibFilesToSearch="$gnuLibFilesToSearch $( echo "${pkgSrc}/src/gl/Makefile.am" | tr ' ' '¤' )" extraConfigure="--enable-shared" extraConfigure="${extraConfigure} --with-trousers-lib=/usr/local/lib/libtspi.so" oldlibs="$LIBS" filesToInit="${pkgSrc}/src/libopts/configure $( pkgSrc="${pkgSrc}" findConfigures )" . "${rootDarkMake}/lib/autotools/libtool/install/basics" if [ "${autoconfVers}" = "2.71" ];then sed -i.patchReadBinaryFile \ 's/^#define read_binary_file _gnutls_read_binary_file$/\/\* Compatibility with the old read-file API. \*\/\n#define read_binary_file(filename, length) read_file((filename), RF_BINARY, (length))/' \ "${pkgSrc}/config.h" || exit 1 . "${rootDarkMake}/lib/autotools/make/install/stdCleanMakeInstall" --check fi exit 0 cd $pkgSrc cpt=0 fileLog="${pkgDirLog}/C${cpt}_configureHelp.log" cpt=$((cpt + 1 ));shDebug 1 "CONFIGURE Help $fileLog" printEnv > $fileLog ./configure --help >> $fileLog 2>&1 fileLog="${pkgDirLog}/C${cpt}_configure.log" cpt=$((cpt + 1 ));shDebug 1 "CONFIGURE $fileLog" printEnv > $fileLog echo ./configure ${extraConfigure} >> $fileLog 2>&1 ./configure ${extraConfigure} >> $fileLog 2>&1 tail -50l $fileLog echo "Press any key to continue... ";read REPLY . ${rootDarkMake}/lib/autotools/make/install/stdCleanMakeInstall --check #extraConfigure="${extraConfigure}" withoutGnuLibInit=1 \ #. ${rootDarkMake}/lib/autotools/libtool/install/basics #if [ ! -f $pkgSrc/configure ];then # echo "[ $pkgName/$pkgVersion ] ======== BOOTSTRAP ========" # make bootstrap > $pkgDirLog/bootstrap.log 2>&1 # touch ./ChangeLog; autoreconf -fiv > $pkgDirLog/autoreconf.log 2>&1 #fi #echo "$paramsConfigure #P11_KIT_LIBS=$P11_KIT_LIBS #P11_KIT_CFLAGS=$P11_KIT_CFLAGS #HOGWEED_LIBS=$HOGWEED_LIBS #HOGWEED_CFLAGS=$HOGWEED_CFLAGS #NETTLE_LIBS=$NETTLE_LIBS #NETTLE_CFLAGS=$NETTLE_CFLAGS #LIBTASN1_LIBS=$LIBTASN1_LIBS #LIBTASN1_CFLAGS=$LIBTASN1_CFLAGS #LIBTROUSERS_LIBS=$LIBTROUSERS_LIBS #LIBTROUSERS_CFLAGS=$LIBTROUSERS_CFLAGS #--with-trousers-lib=/usr/local/lib/libtspi.so #" # P11_KIT_LIBS="$P11_KIT_LIBS" P11_KIT_CFLAGS="$P11_KIT_CFLAGS"\ # HOGWEED_LIBS="$HOGWEED_LIBS" HOGWEED_CFLAGS="$HOGWEED_CFLAGS"\ # NETTLE_LIBS="$NETTLE_LIBS" NETTLE_CFLAGS="$NETTLE_CFLAGS"\ # LIBTASN1_LIBS="$LIBTASN1_LIBS" LIBTASN1_CFLAGS="$LIBTASN1_CFLAGS"\ # LIBTROUSERS_LIBS="$LIBTROUSERS_LIBS" LIBTROUSERS_CFLAGS="$LIBTROUSERS_CFLAGS"\ # ./configure --enable-shared --with-trousers-lib=/usr/local/lib/libtspi.so >> "$pkgDirLog/configure.log" 2>&1 #shDebug 1 "================== CONFIGURE ========================" # P11_KIT_LIBS="$P11_KIT_LIBS" P11_KIT_CFLAGS="$P11_KIT_CFLAGS"\ # HOGWEED_LIBS="$HOGWEED_LIBS" HOGWEED_CFLAGS="$HOGWEED_CFLAGS"\ # NETTLE_LIBS="$NETTLE_LIBS" NETTLE_CFLAGS="$NETTLE_CFLAGS"\ # LIBTASN1_LIBS="$LIBTASN1_LIBS" LIBTASN1_CFLAGS="$LIBTASN1_CFLAGS"\ # LIBTROUSERS_LIBS="$LIBTROUSERS_LIBS" LIBTROUSERS_CFLAGS="$LIBTROUSERS_CFLAGS"\ # LIBGNUTLS_LIBS="$LIBGNUTLS_LIBS" LIBGNUTLS_CFLAGS="$LIBGNUTLS_CFLAGS" \ # ./configure --enable-shared --with-trousers-lib=/usr/local/lib/libtspi.so --with-included-unistring > $pkgDirLog/C1_configure.log 2>&1 ## "stdio-write.c" # gnuLibList="error.c getaddrinfo.c gai_strerror.c getpass.c inet_ntop.c inet_pton.c readline.c strerror.c strerror-override.c" # gnuLibList="${gnuLibList} stdio-write.c stdio-read.c time.in.h alloca.c" # # for fileName in ${gnuLibList};do # file="/usr/share/gnulib/lib/${fileName}" # [ -f "${file}" ] && for dest in "${pkgSrc}/src/gl" "${pkgSrc}/gl";do # cp "${file}" "${dest}" && echo cp "${file}" "${dest}" # done # done ## mkdir "$pkgDirLog/0_autoupdate" ## pkgSrc="${pkgSrc}" pkgDirLog="$pkgDirLog/0_autoupdate" ${rootDarkMake}/lib/autotools/autoconf/install/autoupdate # # filesToInit="$( pkgSrc="${pkgSrc}" findConfigures )" # . ${rootDarkMake}/lib/autotools/libtool/install/init # # for fileName in ${gnuLibList};do # file="/usr/share/gnulib/lib/${fileName}" # [ -f "${file}" ] && for dest in "${pkgSrc}/src/gl" "${pkgSrc}/gl";do # [ ! -f "${dest}/${fileName}" ] && cp "${file}" "${dest}" && echo cp "${file}" "${dest}" # done # done ## file="${pkgSrc}/lib/unistring/Makefile.am" ## sed -i "s/\-\-lgpl=3orGPLv2/\-\-lgpl=3/g" "${file}" # withoutGnuLibInit=1\ # . ${rootDarkMake}/lib/autotools/libtool/install/init