]>
Commit | Line | Data |
---|---|---|
c07a3ca7 MT |
1 | |
2 | ||
3 | def MACRO_EXTRACT_TARBALL | |
c07a3ca7 MT |
4 | for source in %{sources}; do |
5 | %{MACRO_EXTRACT} %{DIR_DL}/${source} || exit 1 | |
6 | done | |
7 | unset source | |
8 | ||
9 | [ -d "%{DIR_APP}" ] && cd %{DIR_APP} | |
c07a3ca7 MT |
10 | end |
11 | ||
12 | def MACRO_INSTALL_FILES | |
13 | %{MACRO_INSTALL_DEFAULT_FILES} | |
14 | %{MACRO_INSTALL_SYSTEMD_FILES} | |
15 | %{MACRO_INSTALL_SYSTEMD_TMPFILES} | |
16 | %{MACRO_INSTALL_PAM_FILES} | |
17 | %{MACRO_INSTALL_LOGROTATE_FILES} | |
18 | end | |
19 | ||
20 | # XXX to be removed soon | |
21 | def MACRO_INSTALL_DEFAULT_FILES | |
22 | for file in %{DIR_SOURCE}/default/*; do | |
23 | [ -e "${file}" ] || continue | |
24 | mkdir -p %{BUILDROOT}/etc/default | |
25 | cp -vf ${file} %{BUILDROOT}/etc/default/$(basename ${file}) | |
26 | done | |
27 | unset file | |
28 | end | |
29 | ||
30 | def MACRO_INSTALL_PAM_FILES | |
31 | for file in %{DIR_SOURCE}/{*.pam,pam.d/*}; do | |
32 | [ -e "${file}" ] || continue | |
33 | mkdir -p %{BUILDROOT}/etc/pam.d | |
34 | cp -vf ${file} %{BUILDROOT}/etc/pam.d/$(basename ${file%*.pam}) | |
35 | done | |
36 | unset file | |
37 | end | |
38 | ||
39 | def MACRO_INSTALL_LOGROTATE_FILES | |
40 | for file in %{DIR_SOURCE}/{*.logrotate,logrotate/*}; do | |
41 | [ -e "${file}" ] || continue | |
42 | mkdir -p %{BUILDROOT}/etc/logrotate.d | |
43 | cp -vf ${file} %{BUILDROOT}/etc/logrotate.d/$(basename ${file%*.logrotate}) | |
44 | done | |
45 | unset file | |
46 | end | |
47 | ||
48 | def MACRO_PYTHON_COMPILE | |
49 | # XXX TODO | |
50 | end | |
51 | ||
a7406cbd MT |
52 | MACRO_PERL_CLEANUP |
53 | # Remove perllocal.pod. | |
54 | rm -f %{BUILDROOT}/usr/lib/perl*/perllocal.pod | |
55 | ||
56 | # Remove all .packlist files. | |
57 | find %{BUILDROOT}/usr/{lib,share}/perl* -name ".packlist" 2>/dev/null | \ | |
58 | xargs --no-run-if-empty rm -f | |
59 | end | |
60 | ||
24992eab | 61 | MACRO_PATCHES = /usr/lib/pakfire/patch --search-path=%{DIR_PATCHES} %{patches} |
49e0e073 | 62 | |
c07a3ca7 MT |
63 | # Pre-defined build scripts. |
64 | build | |
ddabaf53 MT |
65 | # These variables are used if you have to add some targets |
66 | # directly to the make command. | |
67 | make_build_targets = | |
68 | make_install_targets = install | |
69 | ||
c07a3ca7 | 70 | def _prepare |
3ce6a8ad | 71 | rm -rf %{BUILDROOT}/* |
c44f9d6a | 72 | mkdir -p %{DIR_SRC} && cd %{DIR_SRC} |
c07a3ca7 MT |
73 | |
74 | %{prepare} | |
75 | end | |
76 | ||
77 | def prepare | |
78 | # Extract source tarball. | |
79 | %{MACRO_EXTRACT_TARBALL} | |
80 | ||
81 | # Apply all patches. | |
82 | %{MACRO_PATCHES} | |
83 | ||
84 | # Run custom commands. | |
85 | %{prepare_cmds} | |
86 | end | |
87 | ||
88 | def prepare_cmds | |
89 | end | |
90 | ||
91 | def _build | |
92 | [ -d "%{DIR_APP}" ] && cd %{DIR_APP} | |
93 | ||
94 | %{build} | |
95 | end | |
96 | ||
97 | def build | |
98 | if [ -e "%{CONFIGURE_SCRIPT}" ]; then | |
99 | ./%{CONFIGURE_SCRIPT} \ | |
100 | %{configure_options} | |
101 | ||
102 | ${MACRO_FIX_LIBTOOL} | |
103 | fi | |
104 | ||
105 | # Run custom commands. | |
106 | %{configure_cmds} | |
107 | ||
108 | make %{PARALLELISMFLAGS} %{make_build_targets} | |
109 | ||
110 | # Run more custom commands. | |
111 | %{build_cmds} | |
112 | end | |
113 | ||
114 | def configure_cmds | |
115 | end | |
116 | ||
117 | def build_cmds | |
118 | end | |
119 | ||
120 | def _test | |
121 | [ -d "%{DIR_APP}" ] && cd %{DIR_APP} | |
122 | ||
123 | %{test} | |
124 | end | |
125 | ||
126 | def test | |
127 | end | |
128 | ||
129 | def _install | |
130 | [ -d "%{DIR_APP}" ] && cd %{DIR_APP} | |
131 | ||
132 | mkdir -pv %{BUILDROOT} | |
133 | ||
134 | %{install} | |
135 | ||
136 | %{MACRO_INSTALL_FILES} | |
137 | %{MACRO_PYTHON_COMPILE} | |
a7406cbd | 138 | %{MACRO_PERL_CLEANUP} |
c07a3ca7 MT |
139 | |
140 | %{install_post} | |
141 | ||
142 | %{MACRO_QUALITY_AGENT} | |
143 | end | |
144 | ||
145 | def install | |
146 | make DESTDIR=%{BUILDROOT} %{make_install_targets} | |
147 | ||
148 | # Run custom commands. | |
149 | %{install_cmds} | |
150 | end | |
151 | ||
152 | # XXX to be removed soon | |
153 | def install_post | |
154 | end | |
3ce6a8ad MT |
155 | |
156 | # Enable strict processing of build-id by default. | |
157 | # The build will fail if a file is missing its build-id. | |
158 | debuginfo_strict_build_id = true | |
159 | debuginfo_options = | |
c07a3ca7 | 160 | end |