recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / libs / libid3tag / recipe
bloba2cce90489ed5fbdd4465bc4bbcb89cc53977fff
1 # Build recipe for libid3tag.
3 # Copyright (c) 2018 Markus Tornow, <tornow@riseup.net>.
4 # Copyright (c) 2018 Matias Fonzo, <selk@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 #    http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 # Exit immediately on any error
19 set -e
21 program=libid3tag
22 version=0.15.1b
23 release=1
25 # Define a category for the output of the package name
26 pkgcategory=libs
28 tarname=${program}-${version}.tar.gz
30 # Remote source(s)
31 fetch=ftp://ftp.mars.org/pub/mpeg/$tarname
33 description="
34 ID3 tag manipulation library.
35   
36 libid3tag is a library for reading and (eventually) writing ID3 tags,
37 both ID3v1 and the various versions of ID3v2.
40 homepage=https://www.underbit.com/products/mad/
41 license=GPLv2+
43 # Source documentation
44 docs="CHANGES COPYING COPYRIGHT CREDITS README TODO VERSION"
45 docsdir="${docdir}/${program}-${version}"
47 build()
49     unpack "${tardir}/$tarname"
51     cd "$srcdir"
53     # Set sane permissions
54     chmod -R u+w,go-w,a+rX-s .
56     # Update for hosts based on musl
57     cp -f "${worktree}/archive/common/config.guess" config.guess
58     cp -f "${worktree}/archive/common/config.sub" config.sub
60     # Apply fixes since this release is from 2004 (Thanks to Fedora and Debian)
61     patch -p0 < "${worktree}/patches/libid3tag/libid3tag-0.15.1b-fix_overflow.patch"
62     patch -p1 < "${worktree}/patches/libid3tag/libid3tag-0.15.1b-id3v1-zero-padding.patch"
63     patch -p1 < "${worktree}/patches/libid3tag/libid3tag-0.15.1b-handle-unknown-encoding.patch"
64     patch -p0 < "${worktree}/patches/libid3tag/libid3tag-0.15.1b-id3v2-endless-loop.patch"
65     patch -p1 < "${worktree}/patches/libid3tag/libid3tag-0.15.1b-gperf-size_t.patch"
67     touch NEWS AUTHORS ChangeLog
69     # Force these files to be regenerated from the .gperf sources
70     rm -f compat.c frametype.c
72     autoreconf -vif
74     ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
75     $configure_args \
76     --libdir=/usr/lib${libSuffix} \
77     --enable-static=no \
78     --enable-shared=yes \
79     --disable-debugging \
80     --build="$(gcc -dumpmachine)"
82     make -j${jobs} V=1
83     make -j${jobs} DESTDIR="$destdir" install
85     strip --strip-unneeded "${destdir}/usr/lib${libSuffix}/"libid3tag.so.0.?.0
87     # Write missing .pc for pkgconf
88     mkdir -p "${destdir}/usr/lib${libSuffix}/pkgconfig"
89     cat << EOF > "${destdir}/usr/lib${libSuffix}/pkgconfig/id3tag.pc"
90 prefix=/usr
91 exec_prefix=\${prefix}
92 libdir=\${exec_prefix}/lib${libSuffix}
93 includedir=\${prefix}/include
95 Name: id3tag
96 Description: ID3 tag manipulation library
97 Version: ${version}
98 Requires:
99 Libs: -L\${libdir} -lid3tag -lz
100 Cflags: -I\${includedir}
104     # Copy documentation
105     mkdir -p "${destdir}/$docsdir"
106     cp -p $docs "${destdir}/$docsdir"