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