qi: Bump to version 2.0 (Release Candidate 12)
[dragora.git] / recipes / tools / qi / recipe
blob38b3621a3918268cff53b51b9dfcf67b5dbec8ed
1 # Build recipe for qi.
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.
17 program=qi
18 version=2.0rc12
19 arch=noarch
20 release=1
22 # Define a category for the output of the package name
23 pkgcategory=tools
25 tarname=${program}-${version}.tar.lz
27 # Remote source(s)
28 fetch="
29  http://rsync.dragora.org/current/sources/$tarname
30  http://mirror.cedia.org.ec/dragora/current/sources/$tarname
33 description="
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
57 license=GPLv3+
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
64 full_pkgname=$program
66 build()
68     set -e
70     # Figure out architecture name for default package names in Dragora 3+
71     #
72     # See git_tree/targets/ for 'package_arch' on it.
73     #
74     case $(gcc -dumpmachine) in
75     aarch64-*)
76         package_arch=arm64
77         ;;
78     arm-*-musleabi)
79         package_arch=armfp
80         ;;
81     arm-*-musleabihf)
82         package_arch=armhf
83         ;;
84     armv7hl-*-musleabihf)
85         package_arch=armhl
86         ;;
87     *x32-*)
88         package_arch=x32
89         ;;
90     x86_64-*)
91         package_arch=amd64
92         ;;
93     powerpc64le-*)
94         package_arch=ppc64le
95         ;;
96     esac
98     unpack "${tardir}/$tarname"
100     cd "$srcdir"
102     # Set sane permissions
103     chmod -R u+w,go-w,a+rX-s .
105     ./configure \
106      --prefix=/usr \
107      --libexecdir=/usr/libexec \
108      --bindir=/usr/bin \
109      --sbindir=/usr/sbin \
110      --sysconfdir=/etc \
111      --localstatedir=/var \
112      --infodir=/usr/share/info \
113      --mandir=/usr/share/man \
114      --docdir=/usr/share/doc \
115      --packagedir=/usr/pkg \
116      --targetdir=/ \
117      --arch="${package_arch:-$(uname -m)}"
119     unset package_arch
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
126     then
127         cp -p /tools/etc/qirc "${destdir}/etc/"
128         cp -p /tools/etc/qirc "${destdir}/etc/qirc.bak"
129         chmod 644 "${destdir}"/etc/qirc*
130     fi
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}"