qi: Bump to version 2.4 (Release Candidate 5)
[dragora.git] / recipes / tools / qi / recipe
blobd5bec496b0971b929586d1bea1f8994b222d13c7
1 # Build recipe for qi.
3 # Copyright (c) 2017-2021 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 #    http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Exit immediately on any error
18 set -e
20 program=qi
21 version=2.4-rc5
22 arch=noarch
23 release=1
25 # Define a category for the output of the package name
26 pkgcategory=tools
28 tarname=${program}-${version}.tar.lz
30 # Remote source(s)
31 fetch="
32  https://rsync.dragora.org/current/sources/$tarname
33  https://mirror.cedia.org.ec/dragora/current/sources/$tarname
36 description="
37 A user-friendly package manager.
39 Qi is a simple but well-integrated package manager.  It can create,
40 install, remove, and upgrade software packages.  Qi produces binary
41 packages using recipes, which are files containing specific instructions
42 to build each package from source.  Qi can manage multiple packages
43 under a single directory hierarchy.  This method allows to maintain a
44 set of packages and multiple versions of them.  This means that Qi could
45 be used as the main package manager or complement the existing one.
47 Qi offers a friendly command line interface, a global configuration
48 file, a simple recipe layout to deploy software packages; also works
49 with binary packages in parallel, speeding up installations and packages
50 in production.  The format used for packages is a simplified but safe
51 POSIX pax archive compressed with lzip.
53 Qi is a modern (POSIX-compliant) shell script released under the
54 terms of the GNU General Public License.  There are only two major
55 dependencies for the magic: graft(1) and tarlz(1), the rest is expected
56 to be found in any Unix-like system.
59 homepage=https://www.dragora.org
60 license=GPLv3+
62 # Source documentation
63 docs="AUTHORS COPYING CREDITS NEWS README.md doc/example.order doc/recipe*"
64 docsdir="${docdir}/${program}"
66 # Limit package name to the program name
67 full_pkgname=$program
69 build()
71     # Figure out architecture name for default package names in Dragora 3+
72     #
73     # See git_tree/targets/ for 'package_arch' on it.
74     #
75     case $(gcc -dumpmachine) in
76     aarch64-*)
77         package_arch=arm64
78         ;;
79     arm-*-musleabi)
80         package_arch=armfp
81         ;;
82     arm-*-musleabihf)
83         package_arch=armhf
84         ;;
85     armv7hl-*-musleabihf)
86         package_arch=armhl
87         ;;
88     *x32-*)
89         package_arch=x32
90         ;;
91     x86_64-*)
92         package_arch=amd64
93         ;;
94     powerpc64le-*)
95         package_arch=ppc64le
96         ;;
97     esac
99     unpack "${tardir}/$tarname"
101     cd "$srcdir"
103     # Set sane permissions
104     chmod -R u+w,go-w,a+rX-s .
106     ./configure \
107      --prefix=/usr \
108      --libexecdir=/usr/libexec \
109      --bindir=/usr/bin \
110      --sbindir=/usr/sbin \
111      --sysconfdir=/etc \
112      --localstatedir=/var \
113      --infodir=/usr/share/info \
114      --mandir=/usr/share/man \
115      --docdir=/usr/share/doc \
116      --packagedir=/usr/pkg \
117      --targetdir=/ \
118      --arch="${package_arch:-$(uname -m)}"
120     unset -v package_arch
121     make -j${jobs} DESTDIR="$destdir" install
123     ln -s qi "${destdir}/usr/bin/dragora-qi"
125     # Copy the config file used in the temporary system
126     if test -r /tools/etc/qirc
127     then
128         cp -p /tools/etc/qirc "${destdir}/etc/"
129         cp -p /tools/etc/qirc "${destdir}/etc/qirc.bak"
130         chmod 644 "${destdir}"/etc/qirc*
131     fi
133     # Manage dot new file(s)
134     touch "${destdir}/etc/.graft-config"
136     # Compress and copy source documents
138     rm -f "${destdir}/${infodir}/dir"
139     lzip -9 "${destdir}/${infodir}/qi.info" \
140             "${destdir}/${mandir}/man1/qi.1"
142     mkdir -p "${destdir}${docsdir}"
143     cp -p $docs "${destdir}${docsdir}"