]> git.ipfire.org Git - people/stevee/pakfire.git/blob - macros/constants.macro
Move quality-agent to pakfire.
[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 = %{tarball}
23 tarball = %{thisapp}.tar.gz
24
25 # Macro definitions
26
27 # Macro to extract tarballs.
28 # Guesses the compression type automatically.
29 MACRO_EXTRACT = tar xvaf
30
31 # Macro to define and start the quality agent.
32 # Long term goal is to improve the commited code.
33 MACRO_QUALITY_AGENT = /usr/lib/pakfire/quality-agent
34
35 # Macro to strip debugging symbols.
36 MACRO_STRIP = /usr/lib/buildsystem-tools/stripper %{BUILDROOT}
37
38 def MACRO_PATCHES
39 patches="%{patches}"
40
41 if [ -n "${patches}" ]; then
42 _patches=""
43 for patch in ${patches}; do
44 _patches="${_patches} %{DIR_PATCHES}/${patch}"
45 done
46 patches="${_patches}"
47 unset _patches
48 else
49 for patch in %{DIR_PATCHES}/*.{diff,patch{,0}}; do
50 [ -e "${patch}" ] || continue
51 patches="${patches} ${patch}"
52 done
53 fi
54
55 for patch in ${patches}; do
56 case "${patch}" in
57 *.patch0)
58 cmd="patch -Np0"
59 ;;
60 *.patch|*.diff)
61 cmd="patch -Np1"
62 ;;
63 esac
64
65 ${cmd} -i ${patch}
66 done
67 unset cmd patch patches
68 end
69
70 # Remove rpath from libtool.
71 def MACRO_FIX_LIBTOOL
72 if [ -e "%{DIR_APP}/libtool" ]; then
73 sed -e %{DIR_APP}/libtool \
74 -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g'
75 -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g'
76 fi
77 end