3 # Copyright (c) 2017-2024 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
25 # Define a category for the output of the package name
28 tarname=${program}-${version}.tar.lz
32 https://dragora.mirror.garr.it/current/sources/$tarname
33 rsync://rsync.dragora.org/current/sources/$tarname
37 A user-friendly package manager (version $version).
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 and safer
51 variant of POSIX pax archive compressed in lzip format.
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
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}@${pkgcategory}"
71 # Figure out architecture name for default package names in Dragora 3+
73 # See git_tree/targets/ for 'package_arch' on it.
75 case $(gcc -dumpmachine) in
99 unpack "${tardir}/$tarname"
103 # Set sane permissions
104 chmod -R u+w,go-w,a+rX-s .
108 --libexecdir=/usr/libexec \
110 --sbindir=/usr/sbin \
112 --localstatedir=/var \
113 --infodir=/usr/share/info \
114 --mandir=/usr/share/man \
115 --docdir=/usr/share/doc \
116 --packagedir=/usr/pkg \
118 --arch="${package_arch:-$(uname -m)}" \
119 --qi-cflags="$QICFLAGS" \
120 --qi-cxxflags="$QICXXFLAGS" \
121 --qi-ldflags="$QILDFLAGS" \
122 --qi-cppflags="$QICPPFLAGS"
124 unset -v package_arch
125 make -j${jobs} DESTDIR="$destdir" install
127 ln -s qi "${destdir}/usr/bin/dragora-qi"
129 # Copy the config file used in the temporary system
130 if test -r /tools/etc/qirc && test ! -e /etc/qirc
132 cp -p /tools/etc/qirc "${destdir}/etc/"
133 cp -p /tools/etc/qirc "${destdir}/etc/qirc.bak"
134 chmod 644 "${destdir}"/etc/qirc*
137 # Manage dot new file(s)
138 touch "${destdir}/etc/.graft-config"
140 # Compress and copy source documents
142 rm -f "${destdir}/${infodir}/dir"
143 lzip -9 "${destdir}/${infodir}/qi.info" \
144 "${destdir}/${mandir}/man1/qi.1"
146 mkdir -p "${destdir}/$docsdir"
147 cp -p $docs "${destdir}/$docsdir"