]> git.ipfire.org Git - pakfire.git/blob - macros/constants.macro
f7bcfd74ee73df10ae85d9bad39dc56345348149
[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 to strip debugging symbols.
31 MACRO_STRIP = /usr/lib/buildsystem-tools/stripper %{BUILDROOT}
32
33 MACRO_PATCHES
34 patches="%{patches}"
35
36 if [ -n "${patches}" ]; then
37 _patches=""
38 for patch in ${patches}; do
39 _patches="${_patches} %{DIR_PATCHES}/${patch}"
40 done
41 patches="${_patches}"
42 unset _patches
43 else
44 for patch in %{DIR_PATCHES}/*.{diff,patch{,0}}; do
45 [ -e "${patch}" ] || continue
46 patches="${patches} ${patch}"
47 done
48 fi
49
50 for patch in ${patches}; do
51 case "${patch}" in
52 *.patch0)
53 cmd="patch -Np0"
54 ;;
55 *.patch|*.diff)
56 cmd="patch -Np1"
57 ;;
58 esac
59
60 ${cmd} -i ${patch}
61 done
62 unset cmd patch patches
63 end
64
65 # Remove rpath from libtool.
66 MACRO_FIX_LIBTOOL
67 if [ -e "%{DIR_APP}/libtool" ]; then
68 sed -e %{DIR_APP}/libtool \
69 -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g'
70 -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g'
71 fi
72 end