-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
50 lines (43 loc) · 1.65 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# Undupes: Find duplicate files.
# Copyright (C) 2024 Mmanu Chaturvedi <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# SPDX-License-Identifier: AGPL-3.0
# SPDX-FileCopyrightText: 2024 Mmanu Chaturvedi <[email protected]>
set -euo pipefail
declare -r DISTRO_INFO="$(dpkg --print-architecture 2>/dev/null)_$(lsb_release -is 2>/dev/null)_$(lsb_release -cs 2>/dev/null)"
declare -r BUILD_DIR="${BUILD_DIR:-${PWD}/build}"
declare -r INSTALL_PREFIX=${INSTALL_PREFIX:-"${BUILD_DIR}/install"}
declare -r PACKAGES_DIR="${PACKAGES_DIR:-${PWD}/_packages}"
export UNDUPES="${INSTALL_PREFIX}/bin/undupes"
cmake \
-DCMAKE_CXX_COMPILER=/usr/bin/g++ \
-DCMAKE_BUILD_TYPE=Release \
-S . \
-B ${BUILD_DIR} \
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
-DDISTRO_INFO:STRING=${DISTRO_INFO} \
.
pushd ${BUILD_DIR}
make -j
make install
make undupes
popd
bash -x run_all_tests.sh
pushd ${BUILD_DIR}
cpack -G DEB undupes
popd
dpkg -i ${PACKAGES_DIR}/*${DISTRO_INFO}.deb
UNDUPES=$(find /opt -type f -name undupes) bash -x run_all_tests.sh