recipes: Rename 'pkghashtag' variable to 'pkgcategory'
[dragora.git] / recipes / networking / weechat / recipe
blob06661d28f52d9bf5fac3bc4c07de65a44d0265f7
1 # Build recipe for weechat.
3 # Copyright (c) 2019-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=weechat
18 version=2.6
19 release=2
21 # Define a category for the output of the package name
22 pkgcategory=networking
24 tarname=${program}-${version}.tar.bz2
26 # Remote source(s)
27 fetch=http://weechat.org/files/src/$tarname
29 homepage=http://weechat.org
30 license=GPLv3+
32 description="
33 WeeChat is a fast, light and extensible chat client.
35 WeeChat (Wee Enhanced Environment for Chat) is a free chat client,
36 fast and light, designed for many operating systems.  It is highly
37 customizable and extensible with scripts.
39 For more information, visit: $homepage
42 # Source documentation
43 docs=COPYING
44 docsdir="${docdir}/${program}-${version}"
46 build()
48     set -e
50     unpack "${tardir}/$tarname"
52     cd "$srcdir"
54     # Set sane permissions
55     chmod -R u+w,go-w,a+rX-s .
57     mkdir -p BUILD
58     cd BUILD
60     # Note about NLS: it does not work with gettex-tiny, currently.
62     cmake \
63      -DCMAKE_C_FLAGS_RELEASE:STRING="$QICFLAGS"      \
64      -DCMAKE_CXX_FLAGS_RELEASE:STRING="$QICXXFLAGS"  \
65      -DCMAKE_EXE_LINKER_FLAGS:STRING="$QILDFLAGS"    \
66      -DCMAKE_INSTALL_PREFIX=/usr                     \
67      -DCMAKE_BUILD_TYPE=Release                      \
68      -DCMAKE_VERBOSE_MAKEFILE=ON                     \
69      -DCMAKE_SKIP_INSTALL_RPATH=YES                  \
70      -DLIBDIR=/usr/lib${libSuffix}                   \
71      -DENABLE_NLS=OFF                                \
72      -DENABLE_ENCHANT=OFF                            \
73      -DENABLE_PHP=OFF                                \
74      -DENABLE_MAN=ON                                 \
75      -DENABLE_DOC=OFF                                \
76      ..
78     make -j${jobs}
79     make -j${jobs} DESTDIR="$destdir" install
81     # Move generated documentation directory, if enabled
83     mkdir -p "${destdir}${docsdir}"
85     if test -d "${destdir}/usr/share/doc/weechat"
86     then
87         for file in "${destdir}/usr/share/doc/weechat"/*
88         do
89             mv -f -- "$file" "${destdir}${docsdir}"
90         done
91         unset file
92         rm -rf "${destdir}/usr/share/doc/weechat"
93     fi
95     cd ..
97     # Copy documentation
98     cp -p $docs "${destdir}${docsdir}"
100     # Compress and link man pages (if needed)
101     if test -d "${destdir}/$mandir"
102     then
103         (
104             cd "${destdir}/$mandir"
105             find . -type f -exec lzip -9 '{}' +
106             find . -type l | while read -r file
107             do
108                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
109                 rm -- "$file"
110             done
111         )
112     fi