]> git.ipfire.org Git - people/stevee/pakfire.git/blob - macros/constants.macro
Rewrite the buildsystem of this package.
[people/stevee/pakfire.git] / macros / constants.macro
1
2 # XXX just for now
3 PARALLELISMFLAGS = -j2
4
5 BASEDIR = /build
6 BUILDROOT = /buildroot
7
8 DIR_APP = %{DIR_SRC}/%{thisapp}
9 DIR_DL = %{BASEDIR}/files
10 DIR_PATCHES = %{BASEDIR}/patches
11 DIR_SRC = /usr/src
12 DIR_TMP = /tmp
13 DIR_SOURCE = %{BASEDIR}
14
15 CONFIGURE_SCRIPT = configure
16 configure_options = \
17 --host=%{DISTRO_MACHINE} \
18 --build=%{DISTRO_MACHINE} \
19 --prefix=/usr
20
21 patches =
22 sources = %{thisapp}.tar.gz
23
24 # Macro definitions
25
26 # Macro to extract tarballs.
27 # Guesses the compression type automatically.
28 MACRO_EXTRACT = tar xaf
29
30 MACRO_PATCHES
31 patches="%{patches}"
32
33 if [ -n "${patches}" ]; then
34 _patches=""
35 for patch in ${patches}; do
36 _patches="${_patches} %{DIR_PATCHES}/${patch}"
37 done
38 patches="${_patches}"
39 unset _patches
40 else
41 for patch in %{DIR_PATCHES}/*.{diff,patch{,0}}; do
42 [ -e "${patch}" ] || continue
43 patches="${patches} ${patch}"
44 done
45 fi
46
47 for patch in ${patches}; do
48 case "${patch}" in
49 *.patch0)
50 cmd="patch -Np0"
51 ;;
52 *.patch|*.diff)
53 cmd="patch -Np1"
54 ;;
55 esac
56
57 ${cmd} -i ${patch}
58 done
59 unset cmd patch patches
60 end
61
62 # Remove rpath from libtool.
63 MACRO_FIX_LIBTOOL
64 if [ -e "%{DIR_APP}/libtool" ]; then
65 sed -e %{DIR_APP}/libtool \
66 -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g'
67 -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g'
68 fi
69 end