3 # Copyright (c) 2017-2020 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.
22 # Define a category for the output of the package name
25 tarname=${program}-${version}.tar.lz
29 http://rsync.dragora.org/current/sources/$tarname
30 http://mirror.cedia.org.ec/dragora/current/sources/$tarname
34 A user-friendly package manager.
36 Qi is a simple but well-integrated package manager. It can create,
37 install, remove, and upgrade software packages. Qi produces binary
38 packages using recipes, which are files containing specific instructions
39 to build each package from source. Qi can manage multiple packages
40 under a single directory hierarchy. This method allows to maintain a
41 set of packages and multiple versions of them. This means that Qi could
42 be used as the main package manager or complement the existing one.
44 Qi offers a friendly command line interface, a global configuration
45 file, a simple recipe layout to deploy software packages; also works
46 with binary packages in parallel, speeding up installations and packages
47 in production. The format used for packages is a simplified but safe
48 POSIX pax archive compressed with lzip.
50 Qi is a modern (POSIX-compliant) shell script released under the
51 terms of the GNU General Public License. There are only two major
52 dependencies for the magic: graft(1) and tarlz(1), the rest is expected
53 to be found in any Unix-like system.
56 homepage=http://www.dragora.org
59 # Source documentation
60 docs="AUTHORS COPYING CREDITS NEWS README.md doc/example.order"
61 docsdir="${docdir}/${program}"
63 # Limit package name to the program name
70 # Figure out architecture name for default package names in Dragora 3+
72 # See git_tree/targets/ for 'package_arch' on it.
74 case $(gcc -dumpmachine) in
98 unpack "${tardir}/$tarname"
102 # Set sane permissions
103 chmod -R u+w,go-w,a+rX-s .
107 --libexecdir=/usr/libexec \
109 --sbindir=/usr/sbin \
111 --localstatedir=/var \
112 --infodir=/usr/share/info \
113 --mandir=/usr/share/man \
114 --docdir=/usr/share/doc \
115 --packagedir=/usr/pkg \
117 --arch="${package_arch:-$(uname -m)}"
120 make -j${jobs} DESTDIR="$destdir" install
122 ln -s qi "${destdir}/usr/bin/dragora-qi"
124 # Copy the config file used in the temporary system
125 if test -r /tools/etc/qirc
127 cp -p /tools/etc/qirc "${destdir}/etc/"
128 cp -p /tools/etc/qirc "${destdir}/etc/qirc.bak"
129 chmod 644 "${destdir}"/etc/qirc*
132 # Manage dot new file(s)
133 touch "${destdir}/etc/.graft-config"
135 # Compress and copy source documents
137 rm -f "${destdir}/${infodir}/dir"
138 lzip -9 "${destdir}/${infodir}/qi.info" \
139 "${destdir}/${mandir}/man1/qi.1"
141 mkdir -p "${destdir}${docsdir}"
142 cp -p $docs "${destdir}${docsdir}"