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