3 def MACRO_EXTRACT_TARBALL
4 for source in %{sources}; do
5 %{MACRO_EXTRACT} %{DIR_DL}/${source} || exit 1
9 [ -d "%{DIR_APP}" ] && cd %{DIR_APP}
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}
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})
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})
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})
48 def MACRO_PYTHON_COMPILE
49 if [ -x "%{python3}" ]; then
50 %{python3_bytecompile} \
51 %{BUILDROOT}%{python3_sitearch} \
52 %{BUILDROOT}%{python3_sitelib}
55 if [ -x "%{python}" ]; then
56 %{python_bytecompile} \
57 %{BUILDROOT}%{python_sitearch} \
58 %{BUILDROOT}%{python_sitelib}
62 def MACRO_FIX_AUTOTOOLS
63 if [ "%{DISTRO_ARCH}" = "aarch64" ]; then
64 for i in $(find %{DIR_SRC} -name config.guess -or -name config.sub); do
65 if ! grep -q "aarch64" ${i}; then
66 if [ -e "%{datadir}/pakfire/$(basename ${i})" ]; then
67 cp -vf %{datadir}/pakfire/$(basename ${i}) $(dirname ${i})
74 MACRO_PATCHES = /usr/lib/pakfire/patch --search-path=%{DIR_PATCHES} "%{patches}"
76 # Pre-defined build scripts.
78 # These variables are used if you have to add some targets
79 # directly to the make command.
81 make_install_targets = install
85 mkdir -p %{DIR_SRC} && cd %{DIR_SRC}
91 # Extract source tarball.
92 %{MACRO_EXTRACT_TARBALL}
97 # Run custom commands.
100 # Fix outdated autotools on aarch64
101 %{MACRO_FIX_AUTOTOOLS}
108 [ -d "%{DIR_APP}" ] && cd %{DIR_APP}
114 if [ -e "%{CONFIGURE_SCRIPT}" ]; then
115 ./%{CONFIGURE_SCRIPT} \
121 # Run custom commands.
124 make %{PARALLELISMFLAGS} %{make_build_targets}
126 # Run more custom commands.
137 [ -d "%{DIR_APP}" ] && cd %{DIR_APP}
146 [ -d "%{DIR_APP}" ] && cd %{DIR_APP}
148 mkdir -pv %{BUILDROOT}
152 %{MACRO_INSTALL_FILES}
153 %{MACRO_PYTHON_COMPILE}
155 # Cleanup perl modules.
160 %{MACRO_QUALITY_AGENT}
164 make DESTDIR=%{BUILDROOT} %{make_install_targets}
166 # Run custom commands.
170 # XXX to be removed soon
174 # Enable strict processing of build-id by default.
175 # The build will fail if a file is missing its build-id.
176 debuginfo_strict_build_id = true