1+ # Copyright (C) 2023-2025, Xiadnoring (Timur Zajnullin).
2+ # All rights reserved.
3+ #
4+ # Redistribution and use in source and binary forms, with or without
5+ # modification, are permitted provided that the following conditions are met:
6+ #
7+ # * Redistributions of source code must retain the above copyright
8+ # notice, this list of conditions and the following disclaimer.
9+ #
10+ # * Redistributions in binary form must reproduce the above copyright
11+ # notice, this list of conditions and the following disclaimer in the
12+ # documentation and/or other materials provided with the distribution.
13+ #
14+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15+ # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16+ # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17+ # DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
18+ # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19+ # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20+ # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21+ # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23+ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24+
25+ # 1) check
26+
27+ LAST_DIRECTORY=$( pwd | awk -F ' /' ' {print $NF}' 2>&1 )
28+
29+ if ! [ " $LAST_DIRECTORY " = " manapi-http" ]; then
30+ echo " Please, retry from 'manapi-http' directory"
31+ exit 0
32+ fi
33+
34+ ROOT=$( pwd)
35+
36+ # 2) configure
37+ cmake -B build-dbg -DCMAKE_BUILD_TYPE=Debug -DMANAPIHTTP_GRPC_DEPENDENCY=OFF -DMANAPIHTTP_DISABLE_TRACE_HARD=ON \
38+ -DMANAPIHTTP_BUILD_TYPE=lib -DMANAPIHTTP_JSON_DEBUG=ON -DMANAPIHTTP_NGHTTP2_DEPENDENCY=ON -DMANAPIHTTP_NGHTTP3_DEPENDENCY=OFF \
39+ -DMANAPIHTTP_OPENSSL_DEPENDENCY=ON -DMANAPIHTTP_WOFLSSL_DEPENDENCY=OFF -DMANAPIHTTP_BROTLI_DEPENDENCY=ON -DMANAPIHTTP_ZSTD_DEPENDENCY=ON \
40+ -DMANAPIHTTP_ZLIB_DEPENDENCY=ON -DBUILD_SHARED_LIBS=ON -DMANAPIHTTP_STD_BACKTRACE_DEPENDENCY=OFF -DCMAKE_INSTALL_PREFIX=$( pwd) /package/usr \
41+ -DMANAPIHTTP_INSTALL_DIR=/x86_64-linux-gnu
42+
43+ # 3) compile
44+ cmake --build build-dbg -j10
45+
46+ # 4) install
47+ rm -rf package/usr
48+ cmake --install build-dbg
49+
50+ # 5) fake root
51+
52+ # 5.1) pkgconfig
53+ find package/usr/lib/pkgconfig -name ' manapihttp*.*' -exec sed -i -e ' s|' $ROOT ' /package||g' {} \;
54+ # 5.2) cmake
55+ find package/usr/lib/cmake/manapihttp -name ' *.*' -exec sed -i -e ' s|' $ROOT ' /package||g' {} \;
56+ # 5.3) includes
57+ find package/usr/include/x86_64-linux-gnu/manapihttp -name ' *.*' -exec sed -i -e ' s|' $ROOT ' /package||g' {} \;
58+
59+ # 6) Package
60+ dpkg-deb --root-owner-group --build ./package manapihttp-vx.x.xubuntu24.04-dbg.deb
61+
62+ # 7) clean up
63+ if [ -f include/ManapiParams.hpp ]; then
64+ rm include/ManapiParams.hpp
65+ fi
0 commit comments